wp/wp-admin/includes/class-wp-posts-list-table.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
   721 			/**
   721 			/**
   722 			 * Filters the columns displayed in the Pages list table.
   722 			 * Filters the columns displayed in the Pages list table.
   723 			 *
   723 			 *
   724 			 * @since 2.5.0
   724 			 * @since 2.5.0
   725 			 *
   725 			 *
   726 			 * @param string[] $post_columns An associative array of column headings.
   726 			 * @param string[] $posts_columns An associative array of column headings.
   727 			 */
   727 			 */
   728 			$posts_columns = apply_filters( 'manage_pages_columns', $posts_columns );
   728 			$posts_columns = apply_filters( 'manage_pages_columns', $posts_columns );
   729 		} else {
   729 		} else {
   730 
   730 
   731 			/**
   731 			/**
   732 			 * Filters the columns displayed in the Posts list table.
   732 			 * Filters the columns displayed in the Posts list table.
   733 			 *
   733 			 *
   734 			 * @since 1.5.0
   734 			 * @since 1.5.0
   735 			 *
   735 			 *
   736 			 * @param string[] $post_columns An associative array of column headings.
   736 			 * @param string[] $posts_columns An associative array of column headings.
   737 			 * @param string   $post_type    The post type slug.
   737 			 * @param string   $post_type     The post type slug.
   738 			 */
   738 			 */
   739 			$posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );
   739 			$posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );
   740 		}
   740 		}
   741 
   741 
   742 		/**
   742 		/**
   749 		 *  - `manage_post_posts_columns`
   749 		 *  - `manage_post_posts_columns`
   750 		 *  - `manage_page_posts_columns`
   750 		 *  - `manage_page_posts_columns`
   751 		 *
   751 		 *
   752 		 * @since 3.0.0
   752 		 * @since 3.0.0
   753 		 *
   753 		 *
   754 		 * @param string[] $post_columns An associative array of column headings.
   754 		 * @param string[] $posts_columns An associative array of column headings.
   755 		 */
   755 		 */
   756 		return apply_filters( "manage_{$post_type}_posts_columns", $posts_columns );
   756 		return apply_filters( "manage_{$post_type}_posts_columns", $posts_columns );
   757 	}
   757 	}
   758 
   758 
   759 	/**
   759 	/**
   788 
   788 
   789 		return $sortables;
   789 		return $sortables;
   790 	}
   790 	}
   791 
   791 
   792 	/**
   792 	/**
       
   793 	 * Generates the list table rows.
       
   794 	 *
       
   795 	 * @since 3.1.0
       
   796 	 *
   793 	 * @global WP_Query $wp_query WordPress Query object.
   797 	 * @global WP_Query $wp_query WordPress Query object.
   794 	 * @global int $per_page
   798 	 * @global int      $per_page
       
   799 	 *
   795 	 * @param array $posts
   800 	 * @param array $posts
   796 	 * @param int   $level
   801 	 * @param int   $level
   797 	 */
   802 	 */
   798 	public function display_rows( $posts = array(), $level = 0 ) {
   803 	public function display_rows( $posts = array(), $level = 0 ) {
   799 		global $wp_query, $per_page;
   804 		global $wp_query, $per_page;
  1270 
  1275 
  1271 	/**
  1276 	/**
  1272 	 * Handles the post author column output.
  1277 	 * Handles the post author column output.
  1273 	 *
  1278 	 *
  1274 	 * @since 4.3.0
  1279 	 * @since 4.3.0
       
  1280 	 * @since 6.8.0 Added fallback text when author's name is unknown.
  1275 	 *
  1281 	 *
  1276 	 * @param WP_Post $post The current WP_Post object.
  1282 	 * @param WP_Post $post The current WP_Post object.
  1277 	 */
  1283 	 */
  1278 	public function column_author( $post ) {
  1284 	public function column_author( $post ) {
  1279 		$args = array(
  1285 		$author = get_the_author();
  1280 			'post_type' => $post->post_type,
  1286 
  1281 			'author'    => get_the_author_meta( 'ID' ),
  1287 		if ( ! empty( $author ) ) {
  1282 		);
  1288 			$args = array(
  1283 		echo $this->get_edit_link( $args, get_the_author() );
  1289 				'post_type' => $post->post_type,
       
  1290 				'author'    => get_the_author_meta( 'ID' ),
       
  1291 			);
       
  1292 			echo $this->get_edit_link( $args, esc_html( $author ) );
       
  1293 		} else {
       
  1294 			echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . __( '(no author)' ) . '</span>';
       
  1295 		}
  1284 	}
  1296 	}
  1285 
  1297 
  1286 	/**
  1298 	/**
  1287 	 * Handles the default column output.
  1299 	 * Handles the default column output.
  1288 	 *
  1300 	 *
  1835 								'sort_column'       => 'menu_order, post_title',
  1847 								'sort_column'       => 'menu_order, post_title',
  1836 							);
  1848 							);
  1837 
  1849 
  1838 							if ( $bulk ) {
  1850 							if ( $bulk ) {
  1839 								$dropdown_args['show_option_no_change'] = __( '&mdash; No Change &mdash;' );
  1851 								$dropdown_args['show_option_no_change'] = __( '&mdash; No Change &mdash;' );
       
  1852 								$dropdown_args['id']                    = 'bulk_edit_post_parent';
  1840 							}
  1853 							}
  1841 
  1854 
  1842 							/**
  1855 							/**
  1843 							 * Filters the arguments used to generate the Quick Edit page-parent drop-down.
  1856 							 * Filters the arguments used to generate the Quick Edit page-parent drop-down.
  1844 							 *
  1857 							 *