本文整理汇总了PHP中WP_List_Table::display_rows_or_placeholder方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_List_Table::display_rows_or_placeholder方法的具体用法?PHP WP_List_Table::display_rows_or_placeholder怎么用?PHP WP_List_Table::display_rows_or_placeholder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_List_Table
的用法示例。
在下文中一共展示了WP_List_Table::display_rows_or_placeholder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function display_rows_or_placeholder()
{
$message = call_user_func($this->_message_callback);
if ($message !== false) {
?>
<tr class="no-items">
<td class="colspanchange" colspan="<?php
echo $this->get_column_count();
?>
">
<?php
echo $message;
?>
</td>
</tr>
<?php
} else {
parent::display_rows_or_placeholder();
}
}
示例2: display_rows_or_placeholder
/**
* Add notifications above the table to indicate which bookings are
* being shown.
* @since 1.3
*/
public function display_rows_or_placeholder()
{
global $rtb_controller;
$notifications = array();
$status = '';
if (!empty($_GET['status'])) {
$status = $_GET['status'];
if ($status == 'trash') {
$notifications['status'] = __("You're viewing bookings that have been moved to the trash.", 'restaurant-reservations');
} elseif (!empty($rtb_controller->cpts->booking_statuses[$status])) {
$notifications['status'] = sprintf(_x("You're viewing bookings that have been marked as %s.", 'Indicates which booking status is currently being filtered in the list of bookings.', 'restaurant-reservations'), $rtb_controller->cpts->booking_statuses[$_GET['status']]['label']);
}
}
if (!empty($this->filter_start_date) || !empty($this->filter_end_date)) {
$notifications['date'] = sprintf(_x('Only bookings from %s are being shown.', 'Notification of booking date range, eg - bookings from 2014-12-02-2014-12-05', 'restaurant-reservations'), $this->get_current_date_range());
} elseif (!empty($_GET['date_range']) && $_GET['date_range'] == 'today') {
$notifications['date'] = __("Only today's bookings are being shown.", 'restaurant-reservations');
} elseif (empty($_GET['date_range'])) {
$notifications['date'] = __('Only upcoming bookings are being shown.', 'restaurant-reservations');
}
$notifications = apply_filters('rtb_admin_bookings_table_filter_notifications', $notifications);
if (!empty($notifications)) {
?>
<tr class="notice <?php
echo esc_attr($status);
?>
">
<td colspan="<?php
echo count($this->get_columns());
?>
">
<?php
echo join(' ', $notifications);
?>
</td>
</tr>
<?php
}
parent::display_rows_or_placeholder();
}