當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。