wp/wp-admin/includes/class-wp-posts-list-table.php
author ymh <ymh.work@gmail.com>
Tue, 09 Jun 2015 03:35:32 +0200
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
permissions -rw-r--r--
upgrade wordpress + plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * Posts List Table class.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 * @subpackage List_Table
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * @since 3.1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * @access private
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
class WP_Posts_List_Table extends WP_List_Table {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
	 * Whether the items should be displayed hierarchically or linearly
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
	 * @since 3.1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
	 * @var bool
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
	 * @access protected
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
	 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    19
	protected $hierarchical_display;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
	 * Holds the number of pending comments for each post
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
	 * @since 3.1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
	 * @var int
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
	 * @access protected
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
	 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    28
	protected $comment_pending_count;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
	 * Holds the number of posts for this user
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
	 * @since 3.1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
	 * @var int
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
	 * @access private
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
	 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    37
	private $user_posts_count;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
	 * Holds the number of posts which are sticky.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
	 * @since 3.1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
	 * @var int
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
	 * @access private
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
	 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    46
	private $sticky_posts_count = 0;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    47
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    48
	private $is_trash;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    50
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    51
	 * Constructor.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    52
	 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    53
	 * @since 3.1.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    54
	 * @access public
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    55
	 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    56
	 * @see WP_List_Table::__construct() for more information on default arguments.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    57
	 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    58
	 * @param array $args An associative array of arguments.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    59
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    60
	public function __construct( $args = array() ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
		global $post_type_object, $wpdb;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
		parent::__construct( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
			'plural' => 'posts',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
			'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
		) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
		$post_type = $this->screen->post_type;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
		$post_type_object = get_post_type_object( $post_type );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
		if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
			$exclude_states = get_post_stati( array( 'show_in_admin_all_list' => false ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
			$this->user_posts_count = $wpdb->get_var( $wpdb->prepare( "
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
				SELECT COUNT( 1 ) FROM $wpdb->posts
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
				WHERE post_type = %s AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
				AND post_author = %d
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
			", $post_type, get_current_user_id() ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
			if ( $this->user_posts_count && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
				$_GET['author'] = get_current_user_id();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
		if ( 'post' == $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
			$sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
			$this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status NOT IN ('trash', 'auto-draft') AND ID IN ($sticky_posts)", $post_type ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    89
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    90
	 * Sets whether the table layout should be hierarchical or not.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    91
	 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    92
	 * @since 4.2.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    93
	 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    94
	 * @param bool $display Whether the table layout should be hierarchical.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    95
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    96
	public function set_hierarchical_display( $display ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    97
		$this->hierarchical_display = $display;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    98
	}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    99
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   100
	public function ajax_user_can() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
		return current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_posts );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   104
	public function prepare_items() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
		global $avail_post_stati, $wp_query, $per_page, $mode;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
		$avail_post_stati = wp_edit_posts_query();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   109
		$this->set_hierarchical_display( is_post_type_hierarchical( $this->screen->post_type ) && 'menu_order title' == $wp_query->query['orderby'] );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
		$total_items = $this->hierarchical_display ? $wp_query->post_count : $wp_query->found_posts;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
		$post_type = $this->screen->post_type;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
		$per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   115
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   116
		/** This filter is documented in wp-admin/includes/post.php */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
 		$per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
		if ( $this->hierarchical_display )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   120
			$total_pages = ceil( $total_items / $per_page );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
		else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   122
			$total_pages = $wp_query->max_num_pages;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   123
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   124
		if ( ! empty( $_REQUEST['mode'] ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   125
			$mode = $_REQUEST['mode'] == 'excerpt' ? 'excerpt' : 'list';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   126
			set_user_setting ( 'posts_list_mode', $mode );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   127
		} else {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   128
			$mode = get_user_setting ( 'posts_list_mode', 'list' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   129
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   130
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
		$this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] == 'trash';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   132
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   133
		$this->set_pagination_args( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   134
			'total_items' => $total_items,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   135
			'total_pages' => $total_pages,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   136
			'per_page' => $per_page
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   137
		) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   140
	public function has_items() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   141
		return have_posts();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   142
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   143
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   144
	public function no_items() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   145
		if ( isset( $_REQUEST['post_status'] ) && 'trash' == $_REQUEST['post_status'] )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
			echo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
		else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   148
			echo get_post_type_object( $this->screen->post_type )->labels->not_found;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   149
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   150
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   151
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   152
	 * Determine if the current view is the "All" view.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   153
	 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   154
	 * @since 4.2.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   155
	 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   156
	 * @return bool Whether the current ivew is the "All" view.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   157
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   158
	protected function is_base_request() {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   159
		if ( empty( $_GET ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   160
			return true;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   161
		} elseif ( 1 === count( $_GET ) && ! empty( $_GET['post_type'] ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   162
			return $this->screen->post_type === $_GET['post_type'];
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   163
		}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   164
	}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   165
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   166
	protected function get_views() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   167
		global $locked_post_status, $avail_post_stati;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   168
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   169
		$post_type = $this->screen->post_type;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   170
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   171
		if ( !empty($locked_post_status) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   172
			return array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   173
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   174
		$status_links = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   175
		$num_posts = wp_count_posts( $post_type, 'readable' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   176
		$class = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   177
		$allposts = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   178
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
		$current_user_id = get_current_user_id();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   180
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   181
		if ( $this->user_posts_count ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
			if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user_id ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
				$class = ' class="current"';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   184
			$status_links['mine'] = "<a href='edit.php?post_type=$post_type&author=$current_user_id'$class>" . sprintf( _nx( 'Mine <span class="count">(%s)</span>', 'Mine <span class="count">(%s)</span>', $this->user_posts_count, 'posts' ), number_format_i18n( $this->user_posts_count ) ) . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   185
			$allposts = '&all_posts=1';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   186
			$class = '';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   187
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   188
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   189
		$total_posts = array_sum( (array) $num_posts );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   190
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   191
		// Subtract post types that are not included in the admin all list.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   192
		foreach ( get_post_stati( array('show_in_admin_all_list' => false) ) as $state )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   193
			$total_posts -= $num_posts->$state;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   194
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   195
		if ( empty( $class ) && $this->is_base_request() && ! $this->user_posts_count ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   196
			$class =  ' class="current"';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   197
		}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   198
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   199
		$all_inner_html = sprintf(
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   200
			_nx(
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   201
				'All <span class="count">(%s)</span>',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   202
				'All <span class="count">(%s)</span>',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   203
				$total_posts,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   204
				'posts'
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   205
			),
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   206
			number_format_i18n( $total_posts )
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   207
		);
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   208
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   209
		$status_links['all'] = "<a href='edit.php?post_type=$post_type{$allposts}'$class>" . $all_inner_html . '</a>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   210
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   211
		foreach ( get_post_stati(array('show_in_admin_status_list' => true), 'objects') as $status ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   212
			$class = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   213
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   214
			$status_name = $status->name;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   215
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   216
			if ( !in_array( $status_name, $avail_post_stati ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   217
				continue;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   218
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   219
			if ( empty( $num_posts->$status_name ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   220
				continue;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   221
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   222
			if ( isset($_REQUEST['post_status']) && $status_name == $_REQUEST['post_status'] )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   223
				$class = ' class="current"';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   224
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   225
			$status_links[$status_name] = "<a href='edit.php?post_status=$status_name&amp;post_type=$post_type'$class>" . sprintf( translate_nooped_plural( $status->label_count, $num_posts->$status_name ), number_format_i18n( $num_posts->$status_name ) ) . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   226
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   227
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   228
		if ( ! empty( $this->sticky_posts_count ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   229
			$class = ! empty( $_REQUEST['show_sticky'] ) ? ' class="current"' : '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   230
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   231
			$sticky_link = array( 'sticky' => "<a href='edit.php?post_type=$post_type&amp;show_sticky=1'$class>" . sprintf( _nx( 'Sticky <span class="count">(%s)</span>', 'Sticky <span class="count">(%s)</span>', $this->sticky_posts_count, 'posts' ), number_format_i18n( $this->sticky_posts_count ) ) . '</a>' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   232
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   233
			// Sticky comes after Publish, or if not listed, after All.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   234
			$split = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   235
			$status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   236
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   237
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   238
		return $status_links;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   239
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   240
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   241
	protected function get_bulk_actions() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   242
		$actions = array();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   243
		$post_type_obj = get_post_type_object( $this->screen->post_type );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   244
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   245
		if ( $this->is_trash ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   246
			$actions['untrash'] = __( 'Restore' );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   247
		} else {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   248
			$actions['edit'] = __( 'Edit' );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   249
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   250
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   251
		if ( current_user_can( $post_type_obj->cap->delete_posts ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   252
			if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   253
				$actions['delete'] = __( 'Delete Permanently' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   254
			} else {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   255
				$actions['trash'] = __( 'Move to Trash' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   256
			}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   257
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   258
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   259
		return $actions;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   260
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   261
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   262
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   263
	 * @global int $cat
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   264
	 * @param string $which
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   265
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   266
	protected function extra_tablenav( $which ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   267
		global $cat;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   268
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   269
		<div class="alignleft actions">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   270
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   271
		if ( 'top' == $which && !is_singular() ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   272
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   273
			$this->months_dropdown( $this->screen->post_type );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   274
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   275
			if ( is_object_in_taxonomy( $this->screen->post_type, 'category' ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   276
				$dropdown_options = array(
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   277
					'show_option_all' => __( 'All categories' ),
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   278
					'hide_empty' => 0,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   279
					'hierarchical' => 1,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   280
					'show_count' => 0,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   281
					'orderby' => 'name',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   282
					'selected' => $cat
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   283
				);
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   284
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   285
				echo '<label class="screen-reader-text" for="cat">' . __( 'Filter by category' ) . '</label>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   286
				wp_dropdown_categories( $dropdown_options );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   287
			}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   288
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   289
			/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   290
			 * Fires before the Filter button on the Posts and Pages list tables.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   291
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   292
			 * The Filter button allows sorting by date and/or category on the
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   293
			 * Posts list table, and sorting by date on the Pages list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   294
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   295
			 * @since 2.1.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   296
			 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   297
			do_action( 'restrict_manage_posts' );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   298
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   299
			submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   300
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   301
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   302
		if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   303
			submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   304
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   305
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   306
		</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   307
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   308
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   309
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   310
	public function current_action() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   311
		if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   312
			return 'delete_all';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   313
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   314
		return parent::current_action();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   315
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   316
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   317
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   318
	 * @global string $mode
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   319
	 * @param string $which
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   320
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   321
	protected function pagination( $which ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   322
		global $mode;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   323
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   324
		parent::pagination( $which );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   325
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   326
		if ( 'top' == $which && ! is_post_type_hierarchical( $this->screen->post_type ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   327
			$this->view_switcher( $mode );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   328
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   329
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   330
	protected function get_table_classes() {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   331
		return array( 'widefat', 'fixed', 'striped', is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   332
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   333
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   334
	public function get_columns() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   335
		$post_type = $this->screen->post_type;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   336
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   337
		$posts_columns = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   338
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   339
		$posts_columns['cb'] = '<input type="checkbox" />';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   340
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   341
		/* translators: manage posts column name */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   342
		$posts_columns['title'] = _x( 'Title', 'column name' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   343
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   344
		if ( post_type_supports( $post_type, 'author' ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   345
			$posts_columns['author'] = __( 'Author' );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   346
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   347
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   348
		$taxonomies = get_object_taxonomies( $post_type, 'objects' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   349
		$taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   350
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   351
		/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   352
		 * Filter the taxonomy columns in the Posts list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   353
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   354
		 * The dynamic portion of the hook name, `$post_type`, refers to the post
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   355
		 * type slug.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   356
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   357
		 * @since 3.5.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   358
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   359
		 * @param array  $taxonomies Array of taxonomies to show columns for.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   360
		 * @param string $post_type  The post type.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   361
		 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   362
		$taxonomies = apply_filters( "manage_taxonomies_for_{$post_type}_columns", $taxonomies, $post_type );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   363
		$taxonomies = array_filter( $taxonomies, 'taxonomy_exists' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   364
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   365
		foreach ( $taxonomies as $taxonomy ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   366
			if ( 'category' == $taxonomy )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   367
				$column_key = 'categories';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   368
			elseif ( 'post_tag' == $taxonomy )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   369
				$column_key = 'tags';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   370
			else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   371
				$column_key = 'taxonomy-' . $taxonomy;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   372
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   373
			$posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   374
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   375
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   376
		$post_status = !empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   377
		if ( post_type_supports( $post_type, 'comments' ) && !in_array( $post_status, array( 'pending', 'draft', 'future' ) ) )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   378
			$posts_columns['comments'] = '<span class="vers comment-grey-bubble" title="' . esc_attr__( 'Comments' ) . '"><span class="screen-reader-text">' . __( 'Comments' ) . '</span></span>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   379
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   380
		$posts_columns['date'] = __( 'Date' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   381
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   382
		if ( 'page' == $post_type ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   383
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   384
			/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   385
			 * Filter the columns displayed in the Pages list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   386
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   387
			 * @since 2.5.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   388
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   389
			 * @param array $post_columns An array of column names.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   390
			 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   391
			$posts_columns = apply_filters( 'manage_pages_columns', $posts_columns );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   392
		} else {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   393
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   394
			/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   395
			 * Filter the columns displayed in the Posts list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   396
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   397
			 * @since 1.5.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   398
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   399
			 * @param array  $posts_columns An array of column names.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   400
			 * @param string $post_type     The post type slug.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   401
			 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   402
			$posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   403
		}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   404
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   405
		/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   406
		 * Filter the columns displayed in the Posts list table for a specific post type.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   407
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   408
		 * The dynamic portion of the hook name, `$post_type`, refers to the post type slug.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   409
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   410
		 * @since 3.0.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   411
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   412
		 * @param array $post_columns An array of column names.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   413
		 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   414
		$posts_columns = apply_filters( "manage_{$post_type}_posts_columns", $posts_columns );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   415
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   416
		return $posts_columns;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   417
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   418
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   419
	protected function get_sortable_columns() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   420
		return array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   421
			'title'    => 'title',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   422
			'parent'   => 'parent',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   423
			'comments' => 'comment_count',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   424
			'date'     => array( 'date', true )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   425
		);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   426
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   427
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   428
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   429
	 * @global WP_Query $wp_query
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   430
	 * @global int $per_page
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   431
	 * @param array $posts
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   432
	 * @param int $level
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   433
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   434
	public function display_rows( $posts = array(), $level = 0 ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   435
		global $wp_query, $per_page;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   436
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   437
		if ( empty( $posts ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   438
			$posts = $wp_query->posts;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   439
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   440
		add_filter( 'the_title', 'esc_html' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   441
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   442
		if ( $this->hierarchical_display ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   443
			$this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   444
		} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   445
			$this->_display_rows( $posts, $level );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   446
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   447
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   448
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   449
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   450
	 * @global string $mode
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   451
	 * @param array $posts
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   452
	 * @param int $level
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   453
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   454
	private function _display_rows( $posts, $level = 0 ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   455
		global $mode;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   456
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   457
		// Create array of post IDs.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   458
		$post_ids = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   459
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   460
		foreach ( $posts as $a_post )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   461
			$post_ids[] = $a_post->ID;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   462
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   463
		$this->comment_pending_count = get_pending_comments_num( $post_ids );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   464
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   465
		foreach ( $posts as $post )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   466
			$this->single_row( $post, $level );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   467
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   468
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   469
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   470
	 * @global wpdb $wpdb
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   471
	 * @param array $pages
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   472
	 * @param int $pagenum
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   473
	 * @param int $per_page
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   474
	 * @return false|null
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   475
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   476
	private function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   477
		global $wpdb;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   478
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   479
		$level = 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   480
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   481
		if ( ! $pages ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   482
			$pages = get_pages( array( 'sort_column' => 'menu_order' ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   483
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   484
			if ( ! $pages )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   485
				return false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   486
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   487
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   488
		/*
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   489
		 * Arrange pages into two parts: top level pages and children_pages
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   490
		 * children_pages is two dimensional array, eg.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   491
		 * children_pages[10][] contains all sub-pages whose parent is 10.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   492
		 * It only takes O( N ) to arrange this and it takes O( 1 ) for subsequent lookup operations
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   493
		 * If searching, ignore hierarchy and treat everything as top level
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   494
		 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   495
		if ( empty( $_REQUEST['s'] ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   496
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   497
			$top_level_pages = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   498
			$children_pages = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   499
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   500
			foreach ( $pages as $page ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   501
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   502
				// Catch and repair bad pages.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   503
				if ( $page->post_parent == $page->ID ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   504
					$page->post_parent = 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   505
					$wpdb->update( $wpdb->posts, array( 'post_parent' => 0 ), array( 'ID' => $page->ID ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   506
					clean_post_cache( $page );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   507
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   508
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   509
				if ( 0 == $page->post_parent )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   510
					$top_level_pages[] = $page;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   511
				else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   512
					$children_pages[ $page->post_parent ][] = $page;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   513
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   514
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   515
			$pages = &$top_level_pages;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   516
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   517
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   518
		$count = 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   519
		$start = ( $pagenum - 1 ) * $per_page;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   520
		$end = $start + $per_page;
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   521
		$to_display = array();
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   522
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   523
		foreach ( $pages as $page ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   524
			if ( $count >= $end )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   525
				break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   526
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   527
			if ( $count >= $start ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   528
				$to_display[$page->ID] = $level;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   529
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   530
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   531
			$count++;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   532
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   533
			if ( isset( $children_pages ) )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   534
				$this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   535
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   536
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   537
		// If it is the last pagenum and there are orphaned pages, display them with paging as well.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   538
		if ( isset( $children_pages ) && $count < $end ){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   539
			foreach ( $children_pages as $orphans ){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   540
				foreach ( $orphans as $op ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   541
					if ( $count >= $end )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   542
						break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   543
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   544
					if ( $count >= $start ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   545
						$to_display[$op->ID] = 0;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   546
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   547
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   548
					$count++;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   549
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   550
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   551
		}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   552
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   553
		$ids = array_keys( $to_display );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   554
		_prime_post_caches( $ids );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   555
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   556
		if ( ! isset( $GLOBALS['post'] ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   557
			$GLOBALS['post'] = reset( $ids );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   558
		}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   559
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   560
		foreach ( $to_display as $page_id => $level ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   561
			echo "\t";
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   562
			$this->single_row( $page_id, $level );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   563
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   564
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   565
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   566
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   567
	 * Given a top level page ID, display the nested hierarchy of sub-pages
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   568
	 * together with paging support
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   569
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   570
	 * @since 3.1.0 (Standalone function exists since 2.6.0)
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   571
	 * @since 4.2.0 Added the `$to_display` parameter.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   572
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   573
	 * @param array $children_pages
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   574
	 * @param int $count
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   575
	 * @param int $parent
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   576
	 * @param int $level
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   577
	 * @param int $pagenum
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   578
	 * @param int $per_page
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   579
	 * @param array $to_display List of pages to be displayed. Passed by reference.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   580
	 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   581
	private function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page, &$to_display ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   582
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   583
		if ( ! isset( $children_pages[$parent] ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   584
			return;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   585
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   586
		$start = ( $pagenum - 1 ) * $per_page;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   587
		$end = $start + $per_page;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   588
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   589
		foreach ( $children_pages[$parent] as $page ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   590
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   591
			if ( $count >= $end )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   592
				break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   593
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   594
			// If the page starts in a subtree, print the parents.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   595
			if ( $count == $start && $page->post_parent > 0 ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   596
				$my_parents = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   597
				$my_parent = $page->post_parent;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   598
				while ( $my_parent ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   599
					// Get the ID from the list or the attribute if my_parent is an object
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   600
					$parent_id = $my_parent;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   601
					if ( is_object( $my_parent ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   602
						$parent_id = $my_parent->ID;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   603
					}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   604
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   605
					$my_parent = get_post( $parent_id );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   606
					$my_parents[] = $my_parent;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   607
					if ( !$my_parent->post_parent )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   608
						break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   609
					$my_parent = $my_parent->post_parent;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   610
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   611
				$num_parents = count( $my_parents );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   612
				while ( $my_parent = array_pop( $my_parents ) ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   613
					$to_display[$my_parent->ID] = $level - $num_parents;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   614
					$num_parents--;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   615
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   616
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   617
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   618
			if ( $count >= $start ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   619
				$to_display[$page->ID] = $level;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   620
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   621
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   622
			$count++;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   623
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   624
			$this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   625
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   626
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   627
		unset( $children_pages[$parent] ); //required in order to keep track of orphans
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   628
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   629
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   630
	/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   631
	 * @global string $mode
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   632
	 * @param WP_Post $post
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   633
	 * @param int $level
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   634
	 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   635
	public function single_row( $post, $level = 0 ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   636
		global $mode;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   637
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   638
		$global_post = get_post();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   639
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   640
		$post = get_post( $post );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   641
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   642
		$GLOBALS['post'] = $post;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   643
		setup_postdata( $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   644
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   645
		$edit_link = get_edit_post_link( $post->ID );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   646
		$title = _draft_or_post_title();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   647
		$post_type_object = get_post_type_object( $post->post_type );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   648
		$can_edit_post = current_user_can( 'edit_post', $post->ID );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   649
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   650
		$classes = 'iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   651
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   652
		$lock_holder = wp_check_post_lock( $post->ID );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   653
		if ( $lock_holder ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   654
			$classes .= ' wp-locked';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   655
			$lock_holder = get_userdata( $lock_holder );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   656
		}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   657
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   658
		if ( $post->post_parent ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   659
		    $count = count( get_post_ancestors( $post->ID ) );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   660
		    $classes .= ' level-'. $count;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   661
		} else {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   662
		    $classes .= ' level-0';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   663
		}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   664
	?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   665
		<tr id="post-<?php echo $post->ID; ?>" class="<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>">
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   666
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   667
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   668
		list( $columns, $hidden ) = $this->get_column_info();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   669
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   670
		foreach ( $columns as $column_name => $column_display_name ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   671
			$class = "class=\"$column_name column-$column_name\"";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   672
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   673
			$style = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   674
			if ( in_array( $column_name, $hidden ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   675
				$style = ' style="display:none;"';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   676
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   677
			$attributes = "$class$style";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   678
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   679
			switch ( $column_name ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   680
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   681
			case 'cb':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   682
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   683
			<th scope="row" class="check-column">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   684
				<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   685
				if ( $can_edit_post ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   686
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   687
				?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   688
				<label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php printf( __( 'Select %s' ), $title ); ?></label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   689
				<input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   690
				<div class="locked-indicator"></div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   691
				<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   692
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   693
				?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   694
			</th>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   695
			<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   696
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   697
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   698
			case 'title':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   699
				$attributes = 'class="post-title page-title column-title"' . $style;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   700
				if ( $this->hierarchical_display ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   701
					if ( 0 == $level && (int) $post->post_parent > 0 ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   702
						// Sent level 0 by accident, by default, or because we don't know the actual level.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   703
						$find_main_page = (int) $post->post_parent;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   704
						while ( $find_main_page > 0 ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   705
							$parent = get_post( $find_main_page );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   706
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   707
							if ( is_null( $parent ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   708
								break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   709
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   710
							$level++;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   711
							$find_main_page = (int) $parent->post_parent;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   712
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   713
							if ( !isset( $parent_name ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   714
								/** This filter is documented in wp-includes/post-template.php */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   715
								$parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   716
							}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   717
						}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   718
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   719
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   720
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   721
				$pad = str_repeat( '&#8212; ', $level );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   722
				echo "<td $attributes><strong>";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   723
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   724
				if ( $format = get_post_format( $post->ID ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   725
					$label = get_post_format_string( $format );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   726
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   727
					echo '<a href="' . esc_url( add_query_arg( array( 'post_format' => $format, 'post_type' => $post->post_type ), 'edit.php' ) ) . '" class="post-state-format post-format-icon post-format-' . $format . '" title="' . $label . '">' . $label . ":</a> ";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   728
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   729
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   730
				if ( $can_edit_post && $post->post_status != 'trash' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   731
					echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ) . '">' . $pad . $title . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   732
				} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   733
					echo $pad . $title;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   734
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   735
				_post_states( $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   736
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   737
				if ( isset( $parent_name ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   738
					echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   739
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   740
				echo "</strong>\n";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   741
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   742
				if ( $can_edit_post && $post->post_status != 'trash' ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   743
					if ( $lock_holder ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   744
						$locked_avatar = get_avatar( $lock_holder->ID, 18 );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   745
						$locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   746
					} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   747
						$locked_avatar = $locked_text = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   748
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   749
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   750
					echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   751
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   752
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   753
				if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   754
						the_excerpt();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   755
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   756
				$actions = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   757
				if ( $can_edit_post && 'trash' != $post->post_status ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   758
					$actions['edit'] = '<a href="' . get_edit_post_link( $post->ID ) . '" title="' . esc_attr__( 'Edit this item' ) . '">' . __( 'Edit' ) . '</a>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   759
					$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr__( 'Edit this item inline' ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   760
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   761
				if ( current_user_can( 'delete_post', $post->ID ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   762
					if ( 'trash' == $post->post_status )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   763
						$actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash' ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   764
					elseif ( EMPTY_TRASH_DAYS )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   765
						$actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash' ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   766
					if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   767
						$actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently' ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   768
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   769
				if ( $post_type_object->public ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   770
					if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   771
						if ( $can_edit_post ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   772
							$preview_link = set_url_scheme( get_permalink( $post->ID ) );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   773
							/** This filter is documented in wp-admin/includes/meta-boxes.php */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   774
							$preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   775
							$actions['view'] = '<a href="' . esc_url( $preview_link ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   776
						}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   777
					} elseif ( 'trash' != $post->post_status ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   778
						$actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   779
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   780
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   781
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   782
				if ( is_post_type_hierarchical( $post->post_type ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   783
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   784
					/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   785
					 * Filter the array of row action links on the Pages list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   786
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   787
					 * The filter is evaluated only for hierarchical post types.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   788
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   789
					 * @since 2.8.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   790
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   791
					 * @param array   $actions An array of row action links. Defaults are
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   792
					 *                         'Edit', 'Quick Edit', 'Restore, 'Trash',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   793
					 *                         'Delete Permanently', 'Preview', and 'View'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   794
					 * @param WP_Post $post    The post object.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   795
					 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   796
					$actions = apply_filters( 'page_row_actions', $actions, $post );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   797
				} else {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   798
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   799
					/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   800
					 * Filter the array of row action links on the Posts list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   801
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   802
					 * The filter is evaluated only for non-hierarchical post types.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   803
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   804
					 * @since 2.8.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   805
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   806
					 * @param array   $actions An array of row action links. Defaults are
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   807
					 *                         'Edit', 'Quick Edit', 'Restore, 'Trash',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   808
					 *                         'Delete Permanently', 'Preview', and 'View'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   809
					 * @param WP_Post $post    The post object.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   810
					 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   811
					$actions = apply_filters( 'post_row_actions', $actions, $post );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   812
				}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   813
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   814
				echo $this->row_actions( $actions );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   815
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   816
				get_inline_data( $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   817
				echo '</td>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   818
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   819
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   820
			case 'date':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   821
				if ( '0000-00-00 00:00:00' == $post->post_date ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   822
					$t_time = $h_time = __( 'Unpublished' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   823
					$time_diff = 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   824
				} else {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   825
					$t_time = get_the_time( __( 'Y/m/d g:i:s a' ) );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   826
					$m_time = $post->post_date;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   827
					$time = get_post_time( 'G', true, $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   828
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   829
					$time_diff = time() - $time;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   830
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   831
					if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   832
						$h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   833
					else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   834
						$h_time = mysql2date( __( 'Y/m/d' ), $m_time );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   835
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   836
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   837
				echo '<td ' . $attributes . '>';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   838
				if ( 'excerpt' == $mode ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   839
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   840
					/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   841
					 * Filter the published time of the post.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   842
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   843
					 * If $mode equals 'excerpt', the published time and date are both displayed.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   844
					 * If $mode equals 'list' (default), the publish date is displayed, with the
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   845
					 * time and date together available as an abbreviation definition.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   846
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   847
					 * @since 2.5.1
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   848
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   849
					 * @param array   $t_time      The published time.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   850
					 * @param WP_Post $post        Post object.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   851
					 * @param string  $column_name The column name.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   852
					 * @param string  $mode        The list display mode ('excerpt' or 'list').
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   853
					 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   854
					echo apply_filters( 'post_date_column_time', $t_time, $post, $column_name, $mode );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   855
				} else {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   856
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   857
					/** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   858
					echo '<abbr title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, $column_name, $mode ) . '</abbr>';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   859
				}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   860
				echo '<br />';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   861
				if ( 'publish' == $post->post_status ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   862
					_e( 'Published' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   863
				} elseif ( 'future' == $post->post_status ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   864
					if ( $time_diff > 0 )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   865
						echo '<strong class="attention">' . __( 'Missed schedule' ) . '</strong>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   866
					else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   867
						_e( 'Scheduled' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   868
				} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   869
					_e( 'Last Modified' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   870
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   871
				echo '</td>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   872
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   873
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   874
			case 'comments':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   875
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   876
			<td <?php echo $attributes ?>><div class="post-com-count-wrapper">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   877
			<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   878
				$pending_comments = isset( $this->comment_pending_count[$post->ID] ) ? $this->comment_pending_count[$post->ID] : 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   879
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   880
				$this->comments_bubble( $post->ID, $pending_comments );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   881
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   882
			</div></td>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   883
			<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   884
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   885
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   886
			case 'author':
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   887
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   888
			<td <?php echo $attributes ?>><?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   889
				printf( '<a href="%s">%s</a>',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   890
					esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'author' => get_the_author_meta( 'ID' ) ), 'edit.php' )),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   891
					get_the_author()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   892
				);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   893
			?></td>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   894
			<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   895
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   896
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   897
			default:
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   898
				if ( 'categories' == $column_name )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   899
					$taxonomy = 'category';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   900
				elseif ( 'tags' == $column_name )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   901
					$taxonomy = 'post_tag';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   902
				elseif ( 0 === strpos( $column_name, 'taxonomy-' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   903
					$taxonomy = substr( $column_name, 9 );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   904
				else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   905
					$taxonomy = false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   906
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   907
				if ( $taxonomy ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   908
					$taxonomy_object = get_taxonomy( $taxonomy );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   909
					echo '<td ' . $attributes . '>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   910
					if ( $terms = get_the_terms( $post->ID, $taxonomy ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   911
						$out = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   912
						foreach ( $terms as $t ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   913
							$posts_in_term_qv = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   914
							if ( 'post' != $post->post_type )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   915
								$posts_in_term_qv['post_type'] = $post->post_type;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   916
							if ( $taxonomy_object->query_var ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   917
								$posts_in_term_qv[ $taxonomy_object->query_var ] = $t->slug;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   918
							} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   919
								$posts_in_term_qv['taxonomy'] = $taxonomy;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   920
								$posts_in_term_qv['term'] = $t->slug;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   921
							}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   922
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   923
							$out[] = sprintf( '<a href="%s">%s</a>',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   924
								esc_url( add_query_arg( $posts_in_term_qv, 'edit.php' ) ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   925
								esc_html( sanitize_term_field( 'name', $t->name, $t->term_id, $taxonomy, 'display' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   926
							);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   927
						}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   928
						/* translators: used between list items, there is a space after the comma */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   929
						echo join( __( ', ' ), $out );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   930
					} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   931
						echo '&#8212;';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   932
					}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   933
					echo '</td>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   934
					break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   935
				}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   936
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   937
			<td <?php echo $attributes ?>><?php
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   938
				if ( is_post_type_hierarchical( $post->post_type ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   939
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   940
					/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   941
					 * Fires in each custom column on the Posts list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   942
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   943
					 * This hook only fires if the current post type is hierarchical,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   944
					 * such as pages.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   945
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   946
					 * @since 2.5.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   947
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   948
					 * @param string $column_name The name of the column to display.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   949
					 * @param int    $post_id     The current post ID.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   950
					 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   951
					do_action( 'manage_pages_custom_column', $column_name, $post->ID );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   952
				} else {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   953
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   954
					/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   955
					 * Fires in each custom column in the Posts list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   956
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   957
					 * This hook only fires if the current post type is non-hierarchical,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   958
					 * such as posts.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   959
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   960
					 * @since 1.5.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   961
					 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   962
					 * @param string $column_name The name of the column to display.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   963
					 * @param int    $post_id     The current post ID.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   964
					 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   965
					do_action( 'manage_posts_custom_column', $column_name, $post->ID );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   966
				}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   967
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   968
				/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   969
				 * Fires for each custom column of a specific post type in the Posts list table.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   970
				 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   971
				 * The dynamic portion of the hook name, `$post->post_type`, refers to the post type.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   972
				 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   973
				 * @since 3.1.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   974
				 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   975
				 * @param string $column_name The name of the column to display.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   976
				 * @param int    $post_id     The current post ID.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   977
				 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   978
				do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   979
			?></td>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   980
			<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   981
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   982
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   983
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   984
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   985
		</tr>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   986
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   987
		$GLOBALS['post'] = $global_post;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   988
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   989
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   990
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   991
	 * Outputs the hidden row displayed when inline editing
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   992
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   993
	 * @since 3.1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   994
	 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   995
	public function inline_edit() {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   996
		global $mode;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   997
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   998
		$screen = $this->screen;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   999
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1000
		$post = get_default_post_to_edit( $screen->post_type );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1001
		$post_type_object = get_post_type_object( $screen->post_type );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1002
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1003
		$taxonomy_names = get_object_taxonomies( $screen->post_type );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1004
		$hierarchical_taxonomies = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1005
		$flat_taxonomies = array();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1006
		foreach ( $taxonomy_names as $taxonomy_name ) {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1007
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1008
			$taxonomy = get_taxonomy( $taxonomy_name );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1009
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1010
			$show_in_quick_edit = $taxonomy->show_in_quick_edit;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1011
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1012
			/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1013
			 * Filter whether the current taxonomy should be shown in the Quick Edit panel.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1014
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1015
			 * @since 4.2.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1016
			 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1017
			 * @param bool   $show_in_quick_edit Whether to show the current taxonomy in Quick Edit.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1018
			 * @param string $taxonomy_name      Taxonomy name.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1019
			 * @param string $post_type          Post type of current Quick Edit post.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1020
			 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1021
			if ( ! apply_filters( 'quick_edit_show_taxonomy', $show_in_quick_edit, $taxonomy_name, $screen->post_type ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1022
				continue;
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1023
			}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1024
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1025
			if ( $taxonomy->hierarchical )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1026
				$hierarchical_taxonomies[] = $taxonomy;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1027
			else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1028
				$flat_taxonomies[] = $taxonomy;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1029
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1030
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1031
		$m = ( isset( $mode ) && 'excerpt' == $mode ) ? 'excerpt' : 'list';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1032
		$can_publish = current_user_can( $post_type_object->cap->publish_posts );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1033
		$core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1034
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1035
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1036
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1037
	<form method="get"><table style="display: none"><tbody id="inlineedit">
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1038
		<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1039
		$hclass = count( $hierarchical_taxonomies ) ? 'post' : 'page';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1040
		$bulk = 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1041
		while ( $bulk < 2 ) { ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1042
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1043
		<tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="inline-edit-row inline-edit-row-<?php echo "$hclass inline-edit-" . $screen->post_type;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1044
			echo $bulk ? " bulk-edit-row bulk-edit-row-$hclass bulk-edit-{$screen->post_type}" : " quick-edit-row quick-edit-row-$hclass inline-edit-{$screen->post_type}";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1045
		?>" style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1046
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1047
		<fieldset class="inline-edit-col-left"><div class="inline-edit-col">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1048
			<h4><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></h4>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1049
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1050
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1051
	if ( post_type_supports( $screen->post_type, 'title' ) ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1052
		if ( $bulk ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1053
			<div id="bulk-title-div">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1054
				<div id="bulk-titles"></div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1055
			</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1056
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1057
	<?php else : // $bulk ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1058
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1059
			<label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1060
				<span class="title"><?php _e( 'Title' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1061
				<span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1062
			</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1063
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1064
			<label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1065
				<span class="title"><?php _e( 'Slug' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1066
				<span class="input-text-wrap"><input type="text" name="post_name" value="" /></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1067
			</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1068
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1069
	<?php endif; // $bulk
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1070
	endif; // post_type_supports title ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1071
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1072
	<?php if ( !$bulk ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1073
			<label><span class="title"><?php _e( 'Date' ); ?></span></label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1074
			<div class="inline-edit-date">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1075
				<?php touch_time( 1, 1, 0, 1 ); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1076
			</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1077
			<br class="clear" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1078
	<?php endif; // $bulk
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1079
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1080
		if ( post_type_supports( $screen->post_type, 'author' ) ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1081
			$authors_dropdown = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1082
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1083
			if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1084
				$users_opt = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1085
					'hide_if_only_one_author' => false,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1086
					'who' => 'authors',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1087
					'name' => 'post_author',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1088
					'class'=> 'authors',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1089
					'multi' => 1,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1090
					'echo' => 0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1091
				);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1092
				if ( $bulk )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1093
					$users_opt['show_option_none'] = __( '&mdash; No Change &mdash;' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1094
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1095
				if ( $authors = wp_dropdown_users( $users_opt ) ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1096
					$authors_dropdown  = '<label class="inline-edit-author">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1097
					$authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1098
					$authors_dropdown .= $authors;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1099
					$authors_dropdown .= '</label>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1100
				endif;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1101
			endif; // authors
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1102
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1103
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1104
	<?php if ( !$bulk ) echo $authors_dropdown;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1105
	endif; // post_type_supports author
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1106
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1107
	if ( !$bulk && $can_publish ) :
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1108
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1109
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1110
			<div class="inline-edit-group">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1111
				<label class="alignleft">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1112
					<span class="title"><?php _e( 'Password' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1113
					<span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1114
				</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1115
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1116
				<em class="alignleft inline-edit-or">
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1117
					<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1118
					/* translators: Between password field and private checkbox on post quick edit interface */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1119
					echo __( '&ndash;OR&ndash;' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1120
					?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1121
				</em>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1122
				<label class="alignleft inline-edit-private">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1123
					<input type="checkbox" name="keep_private" value="private" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1124
					<span class="checkbox-title"><?php echo __( 'Private' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1125
				</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1126
			</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1127
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1128
	<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1129
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1130
		</div></fieldset>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1131
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1132
	<?php if ( count( $hierarchical_taxonomies ) && !$bulk ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1133
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1134
		<fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1135
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1136
	<?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1137
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1138
			<span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ) ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1139
			<input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1140
			<ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1141
				<?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1142
			</ul>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1143
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1144
	<?php endforeach; //$hierarchical_taxonomies as $taxonomy ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1145
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1146
		</div></fieldset>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1147
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1148
	<?php endif; // count( $hierarchical_taxonomies ) && !$bulk ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1149
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1150
		<fieldset class="inline-edit-col-right"><div class="inline-edit-col">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1151
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1152
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1153
		if ( post_type_supports( $screen->post_type, 'author' ) && $bulk )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1154
			echo $authors_dropdown;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1155
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1156
		if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1157
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1158
			if ( $post_type_object->hierarchical ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1159
		?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1160
			<label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1161
				<span class="title"><?php _e( 'Parent' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1162
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1163
		$dropdown_args = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1164
			'post_type'         => $post_type_object->name,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1165
			'selected'          => $post->post_parent,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1166
			'name'              => 'post_parent',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1167
			'show_option_none'  => __( 'Main Page (no parent)' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1168
			'option_none_value' => 0,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1169
			'sort_column'       => 'menu_order, post_title',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1170
		);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1171
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1172
		if ( $bulk )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1173
			$dropdown_args['show_option_no_change'] =  __( '&mdash; No Change &mdash;' );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1174
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1175
		/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1176
		 * Filter the arguments used to generate the Quick Edit page-parent drop-down.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1177
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1178
		 * @since 2.7.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1179
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1180
		 * @see wp_dropdown_pages()
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1181
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1182
		 * @param array $dropdown_args An array of arguments.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1183
		 */
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1184
		$dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1185
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1186
		wp_dropdown_pages( $dropdown_args );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1187
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1188
			</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1189
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1190
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1191
			endif; // hierarchical
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1192
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1193
			if ( !$bulk ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1194
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1195
			<label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1196
				<span class="title"><?php _e( 'Order' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1197
				<span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order ?>" /></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1198
			</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1199
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1200
	<?php	endif; // !$bulk
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1201
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1202
			if ( 'page' == $screen->post_type ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1203
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1204
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1205
			<label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1206
				<span class="title"><?php _e( 'Template' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1207
				<select name="page_template">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1208
	<?php	if ( $bulk ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1209
					<option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1210
	<?php	endif; // $bulk ?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1211
    				<?php
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1212
					/** This filter is documented in wp-admin/includes/meta-boxes.php */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1213
					$default_title = apply_filters( 'default_page_template_title',  __( 'Default Template' ), 'quick-edit' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1214
    				?>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1215
					<option value="default"><?php echo esc_html( $default_title ); ?></option>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1216
					<?php page_template_dropdown() ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1217
				</select>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1218
			</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1219
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1220
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1221
			endif; // page post_type
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1222
		endif; // page-attributes
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1223
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1224
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1225
	<?php if ( count( $flat_taxonomies ) && !$bulk ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1226
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1227
	<?php foreach ( $flat_taxonomies as $taxonomy ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1228
		<?php if ( current_user_can( $taxonomy->cap->assign_terms ) ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1229
			<label class="inline-edit-tags">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1230
				<span class="title"><?php echo esc_html( $taxonomy->labels->name ) ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1231
				<textarea cols="22" rows="1" name="tax_input[<?php echo esc_attr( $taxonomy->name )?>]" class="tax_input_<?php echo esc_attr( $taxonomy->name )?>"></textarea>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1232
			</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1233
		<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1234
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1235
	<?php endforeach; //$flat_taxonomies as $taxonomy ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1236
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1237
	<?php endif; // count( $flat_taxonomies ) && !$bulk  ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1238
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1239
	<?php if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) :
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1240
		if ( $bulk ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1241
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1242
			<div class="inline-edit-group">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1243
		<?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1244
			<label class="alignleft">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1245
				<span class="title"><?php _e( 'Comments' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1246
				<select name="comment_status">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1247
					<option value=""><?php _e( '&mdash; No Change &mdash;' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1248
					<option value="open"><?php _e( 'Allow' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1249
					<option value="closed"><?php _e( 'Do not allow' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1250
				</select>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1251
			</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1252
		<?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1253
			<label class="alignright">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1254
				<span class="title"><?php _e( 'Pings' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1255
				<select name="ping_status">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1256
					<option value=""><?php _e( '&mdash; No Change &mdash;' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1257
					<option value="open"><?php _e( 'Allow' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1258
					<option value="closed"><?php _e( 'Do not allow' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1259
				</select>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1260
			</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1261
		<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1262
			</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1263
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1264
	<?php else : // $bulk ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1265
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1266
			<div class="inline-edit-group">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1267
			<?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1268
				<label class="alignleft">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1269
					<input type="checkbox" name="comment_status" value="open" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1270
					<span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1271
				</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1272
			<?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1273
				<label class="alignleft">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1274
					<input type="checkbox" name="ping_status" value="open" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1275
					<span class="checkbox-title"><?php _e( 'Allow Pings' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1276
				</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1277
			<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1278
			</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1279
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1280
	<?php endif; // $bulk
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1281
	endif; // post_type_supports comments or pings ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1282
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1283
			<div class="inline-edit-group">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1284
				<label class="inline-edit-status alignleft">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1285
					<span class="title"><?php _e( 'Status' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1286
					<select name="_status">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1287
	<?php if ( $bulk ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1288
						<option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1289
	<?php endif; // $bulk ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1290
					<?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review" ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1291
						<option value="publish"><?php _e( 'Published' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1292
						<option value="future"><?php _e( 'Scheduled' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1293
	<?php if ( $bulk ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1294
						<option value="private"><?php _e( 'Private' ) ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1295
	<?php endif; // $bulk ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1296
					<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1297
						<option value="pending"><?php _e( 'Pending Review' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1298
						<option value="draft"><?php _e( 'Draft' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1299
					</select>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1300
				</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1301
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1302
	<?php if ( 'post' == $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1303
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1304
	<?php	if ( $bulk ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1305
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1306
				<label class="alignright">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1307
					<span class="title"><?php _e( 'Sticky' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1308
					<select name="sticky">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1309
						<option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1310
						<option value="sticky"><?php _e( 'Sticky' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1311
						<option value="unsticky"><?php _e( 'Not Sticky' ); ?></option>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1312
					</select>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1313
				</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1314
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1315
	<?php	else : // $bulk ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1316
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1317
				<label class="alignleft">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1318
					<input type="checkbox" name="sticky" value="sticky" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1319
					<span class="checkbox-title"><?php _e( 'Make this post sticky' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1320
				</label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1321
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1322
	<?php	endif; // $bulk ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1323
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1324
	<?php endif; // 'post' && $can_publish && current_user_can( 'edit_others_cap' ) ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1325
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1326
			</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1327
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1328
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1329
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1330
	if ( $bulk && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1331
		$post_formats = get_theme_support( 'post-formats' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1332
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1333
		?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1334
		<label class="alignleft" for="post_format">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1335
		<span class="title"><?php _ex( 'Format', 'post format' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1336
		<select name="post_format">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1337
			<option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1338
			<option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1339
			<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1340
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1341
			foreach ( $post_formats[0] as $format ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1342
				?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1343
				<option value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1344
				<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1345
			}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1346
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1347
			?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1348
		</select></label>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1349
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1350
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1351
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1352
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1353
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1354
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1355
		</div></fieldset>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1356
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1357
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1358
		list( $columns ) = $this->get_column_info();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1359
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1360
		foreach ( $columns as $column_name => $column_display_name ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1361
			if ( isset( $core_columns[$column_name] ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1362
				continue;
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1363
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1364
			if ( $bulk ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1365
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1366
				/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1367
				 * Fires once for each column in Bulk Edit mode.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1368
				 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1369
				 * @since 2.7.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1370
				 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1371
				 * @param string  $column_name Name of the column to edit.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1372
				 * @param WP_Post $post_type   The post type slug.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1373
				 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1374
				do_action( 'bulk_edit_custom_box', $column_name, $screen->post_type );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1375
			} else {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1376
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1377
				/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1378
				 * Fires once for each column in Quick Edit mode.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1379
				 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1380
				 * @since 2.7.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1381
				 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1382
				 * @param string  $column_name Name of the column to edit.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1383
				 * @param WP_Post $post_type   The post type slug.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1384
				 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1385
				do_action( 'quick_edit_custom_box', $column_name, $screen->post_type );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1386
			}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1387
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1388
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1389
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1390
		<p class="submit inline-edit-save">
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1391
			<a href="#inline-edit" class="button-secondary cancel alignleft"><?php _e( 'Cancel' ); ?></a>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1392
			<?php if ( ! $bulk ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1393
				wp_nonce_field( 'inlineeditnonce', '_inline_edit', false );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1394
				?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1395
				<a href="#inline-edit" class="button-primary save alignright"><?php _e( 'Update' ); ?></a>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1396
				<span class="spinner"></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1397
			<?php } else {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
  1398
				submit_button( __( 'Update' ), 'button-primary alignright', 'bulk_edit', false );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1399
			} ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1400
			<input type="hidden" name="post_view" value="<?php echo esc_attr( $m ); ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1401
			<input type="hidden" name="screen" value="<?php echo esc_attr( $screen->id ); ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1402
			<?php if ( ! $bulk && ! post_type_supports( $screen->post_type, 'author' ) ) { ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1403
				<input type="hidden" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1404
			<?php } ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1405
			<span class="error" style="display:none"></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1406
			<br class="clear" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1407
		</p>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1408
		</td></tr>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1409
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1410
		$bulk++;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1411
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1412
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1413
		</tbody></table></form>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1414
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1415
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
  1416
}