当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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();
        }
    }
开发者ID:sbayer55,项目名称:The-Road-Gallery,代码行数:20,代码来源:class-gf-feed-addon.php

示例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();
        }
开发者ID:dridri51,项目名称:wordpress_workflow,代码行数:47,代码来源:WP_List_Table.BookingsTable.class.php


注:本文中的WP_List_Table::display_rows_or_placeholder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。