コード例 #1
0
}
$parent_file = 'edit-pages.php';
wp_enqueue_script('inline-edit-post');
$post_stati = array('publish' => array(__('Published|page'), __('Published pages'), _n_noop('Published <span class="count">(%s)</span>|page', 'Published <span class="count">(%s)</span>')), 'future' => array(__('Scheduled|page'), __('Scheduled pages'), _n_noop('Scheduled <span class="count">(%s)</span>|page', 'Scheduled <span class="count">(%s)</span>')), 'pending' => array(__('Pending Review|page'), __('Pending pages'), _n_noop('Pending Review <span class="count">(%s)</span>|page', 'Pending Review <span class="count">(%s)</span>')), 'draft' => array(__('Draft|page'), _c('Drafts|manage posts header'), _n_noop('Draft <span class="count">(%s)</span>|page', 'Drafts <span class="count">(%s)</span>')), 'private' => array(__('Private|page'), __('Private pages'), _n_noop('Private <span class="count">(%s)</span>|page', 'Private <span class="count">(%s)</span>')));
$query = array('post_type' => 'page', 'orderby' => 'menu_order title', 'what_to_show' => 'posts', 'posts_per_page' => -1, 'posts_per_archive_page' => -1, 'order' => 'asc');
$post_status_label = __('Pages');
if (isset($_GET['post_status']) && in_array($_GET['post_status'], array_keys($post_stati))) {
    $post_status_label = $post_stati[$_GET['post_status']][1];
    $query['post_status'] = $_GET['post_status'];
    $query['perm'] = 'readable';
}
$query = apply_filters('manage_pages_query', $query);
wp($query);
if (is_singular()) {
    wp_enqueue_script('admin-comments');
    enqueue_comment_hotkeys_js();
}
require_once 'admin-header.php';
?>

<div class="wrap">
<?php 
screen_icon();
?>
<h2><?php 
echo wp_specialchars($title);
if (isset($_GET['s']) && $_GET['s']) {
    printf('<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', wp_specialchars(get_search_query()));
}
?>
</h2>
コード例 #2
0
 /**
  * default method for the 'edit' route for cpt admin pages
  *
  * For reference on what to put in here, refer to wp-admin/post.php
  *
  * @access protected
  * @return string   template for edit cpt form
  */
 protected function _edit_cpt_item()
 {
     global $post, $title, $is_IE;
     $post_id = isset($this->_req_data['post']) ? $this->_req_data['post'] : NULL;
     $post = !empty($post_id) ? get_post($post_id, OBJECT, 'edit') : NULL;
     if (empty($post)) {
         wp_die(__('You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?'));
     }
     if (!empty($_GET['get-post-lock'])) {
         $test = wp_set_post_lock($post_id);
         wp_redirect(get_edit_post_link($post_id, 'url'));
         exit;
     }
     $this->_template_args['editing'] = TRUE;
     $this->_template_args['post_ID'] = $post_id;
     $this->_template_args['post'] = $post;
     $this->_template_args['post_type'] = $this->_cpt_routes[$this->_req_action];
     $this->_template_args['post_type_object'] = $this->_cpt_object;
     $this->_template_args['is_IE'] = $is_IE;
     if ($last = wp_check_post_lock($post->ID)) {
         add_action('admin_notices', '_admin_notice_post_locked');
     } else {
         $this->_template_args['active_post_lock'] = wp_set_post_lock($post->ID);
         wp_enqueue_script('autosave');
     }
     $title = $this->_cpt_object->labels->edit_item;
     if (isset($this->_cpt_routes[$this->_req_data['action']]) && !isset($this->_labels['hide_add_button_on_cpt_route']['edit_attendee'])) {
         $this->_template_args['post_new_file'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'create_new', 'page' => $this->page_slug), 'admin.php');
     }
     if (post_type_supports($this->_cpt_routes[$this->_req_action], 'comments')) {
         wp_enqueue_script('admin-comments');
         enqueue_comment_hotkeys_js();
     }
     add_action('admin_print_styles', array($this, 'add_new_admin_page_global'));
     $template = WP_ADMIN_PATH . 'edit-form-advanced.php';
     EEH_Template::display_template($template, $this->_template_args);
 }
コード例 #3
0
 /**
  * default method for the 'edit' route for cpt admin pages
  *
  * For reference on what to put in here, refer to wp-admin/post.php
  *
  * @access protected
  * @return string   template for edit cpt form
  */
 protected function _edit_cpt_item()
 {
     global $post, $title, $is_IE, $post_type, $post_type_object;
     $post_id = isset($this->_req_data['post']) ? $this->_req_data['post'] : NULL;
     $post = !empty($post_id) ? get_post($post_id, OBJECT, 'edit') : NULL;
     if (empty($post)) {
         wp_die(__('You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?'));
     }
     if (!empty($_GET['get-post-lock'])) {
         wp_set_post_lock($post_id);
         wp_redirect(get_edit_post_link($post_id, 'url'));
         exit;
     }
     $editing = TRUE;
     $post_ID = $post_id;
     $post = $post;
     $post_type = $this->_cpt_routes[$this->_req_action];
     $post_type_object = $this->_cpt_object;
     $is_IE = $is_IE;
     if (!wp_check_post_lock($post->ID)) {
         $active_post_lock = wp_set_post_lock($post->ID);
         //wp_enqueue_script('autosave');
     }
     $title = $this->_cpt_object->labels->edit_item;
     add_action('admin_footer', '_admin_notice_post_locked');
     if (isset($this->_cpt_routes[$this->_req_data['action']]) && !isset($this->_labels['hide_add_button_on_cpt_route'][$this->_req_data['action']])) {
         $create_new_action = apply_filters('FHEE__EE_Admin_Page_CPT___edit_cpt_item__create_new_action', 'create_new', $this);
         $post_new_file = EE_Admin_Page::add_query_args_and_nonce(array('action' => $create_new_action, 'page' => $this->page_slug), 'admin.php');
     }
     if (post_type_supports($this->_cpt_routes[$this->_req_action], 'comments')) {
         wp_enqueue_script('admin-comments');
         enqueue_comment_hotkeys_js();
     }
     add_action('admin_print_styles', array($this, 'add_new_admin_page_global'));
     //modify the default editor title field with default title.
     add_filter('enter_title_here', array($this, 'add_custom_editor_default_title'), 10);
     include_once WP_ADMIN_PATH . 'edit-form-advanced.php';
 }
コード例 #4
0
 /**
  * Load reviews screen
  */
 public function load_reviews_screen()
 {
     // Enquque edit-comments.js
     wp_enqueue_script('admin-comments');
     enqueue_comment_hotkeys_js();
     // Load & instantiate the reviews list table class
     require_once 'class-wc-reviews-list-table.php';
     // Supplying the screen name allows using many built-in
     // filters, such as `manage_{$screen}_columns`, etc.
     $this->reviews_list_table = new WC_Reviews_List_Table(array('screen' => $this->reviews_page_hook));
     // Process bulk actions
     $this->reviews_list_table->process_bulk_action();
     // Add screen options
     $this->add_reviews_screen_options();
 }