Ticket #26397: class-wp-posts-list-table.diff
File class-wp-posts-list-table.diff, 6.9 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/class-wp-posts-list-table.php
89 89 90 90 $post_type = $this->screen->post_type; 91 91 $per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' ); 92 /** This filter is documented in wp-admin/includes/post.php */ 92 93 $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type ); 93 94 94 95 if ( $this->hierarchical_display ) … … 215 216 ); 216 217 wp_dropdown_categories( $dropdown_options ); 217 218 } 219 /** 220 * Fires before 'Filter' button in list table top navigation. 221 * 222 * @since 3.0.2 223 */ 218 224 do_action( 'restrict_manage_posts' ); 219 225 submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) ); 220 226 } … … 265 271 $taxonomies = get_object_taxonomies( $post_type, 'objects' ); 266 272 $taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' ); 267 273 274 /** 275 * Filter the taxonomy columns on post and custom post type list tables 276 * 277 * The dynamic portion of the hook name, $post_type, refers to the post type slug. 278 * 279 * @since 3.5.0 280 * 281 * @param array $taxonomies The array of taxonomy names to show as a column 282 * @param string $post_type The post type. 283 */ 268 284 $taxonomies = apply_filters( "manage_taxonomies_for_{$post_type}_columns", $taxonomies, $post_type ); 269 285 $taxonomies = array_filter( $taxonomies, 'taxonomy_exists' ); 270 286 … … 285 301 286 302 $posts_columns['date'] = __( 'Date' ); 287 303 288 if ( 'page' == $post_type ) 304 if ( 'page' == $post_type ) { 305 /** 306 * Filter the columns on pages list table. 307 * 308 * @since 3.0.2 309 * 310 * @param array $post_columns The array of column names. 311 */ 289 312 $posts_columns = apply_filters( 'manage_pages_columns', $posts_columns ); 290 else 313 } else { 314 /** 315 * Filter the columns on posts list table. 316 * 317 * @since 3.0.2 318 * 319 * @param array $posts_columns The array of column names. 320 * @param string $post_type The post type 321 */ 291 322 $posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type ); 323 } 324 /** 325 * Filter the columns on custom post types list table. 326 * 327 * The dynamic portion of the hook name, $post_type, refers to the post_type. 328 * 329 * @since 3.0.2 330 * 331 * @param array $post_columns The array of column names. 332 * @param string $post_type The post type of the list table. 333 */ 292 334 $posts_columns = apply_filters( "manage_{$post_type}_posts_columns", $posts_columns ); 293 335 294 336 return $posts_columns; … … 605 647 } 606 648 if ( $post_type_object->public ) { 607 649 if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) { 608 if ( $can_edit_post ) 650 if ( $can_edit_post ) { 651 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 609 652 $actions['view'] = '<a href="' . esc_url( apply_filters( 'preview_post_link', set_url_scheme( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>'; 653 } 610 654 } elseif ( 'trash' != $post->post_status ) { 611 655 $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>'; 612 656 } 613 657 } 614 658 659 /** 660 * Filter the array of post/page row actions. 661 * 662 * @since 3.0.2 663 * 664 * @param array $actions The array of actions. 665 */ 615 666 $actions = apply_filters( is_post_type_hierarchical( $post->post_type ) ? 'page_row_actions' : 'post_row_actions', $actions, $post ); 616 667 echo $this->row_actions( $actions ); 617 668 … … 637 688 } 638 689 639 690 echo '<td ' . $attributes . '>'; 640 if ( 'excerpt' == $mode ) 691 if ( 'excerpt' == $mode ) { 692 /** 693 * Filter the array of taxonomies to be added as a column . 694 * 695 * @since 3.0.2 696 * 697 * @param array $taxonomies The array of taxonomy names. 698 * @param object $post The post object. 699 * @param string $column_name The column name. 700 * @param string $mode The list display mode ( 'excerpt' or 'list' ). 701 */ 641 702 echo apply_filters( 'post_date_column_time', $t_time, $post, $column_name, $mode ); 642 else 703 } else { 704 /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */ 643 705 echo '<abbr title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, $column_name, $mode ) . '</abbr>'; 706 } 644 707 echo '<br />'; 645 708 if ( 'publish' == $post->post_status ) { 646 709 _e( 'Published' ); … … 719 782 } 720 783 ?> 721 784 <td <?php echo $attributes ?>><?php 722 if ( is_post_type_hierarchical( $post->post_type ) ) 785 if ( is_post_type_hierarchical( $post->post_type ) ) { 786 /** 787 * Fires for each row in the list table. 788 * 789 * @since 3.0.2 790 * 791 * @param string $column_name The name of the column to display. 792 * @param int $post->ID The ID of the current post. 793 */ 723 794 do_action( 'manage_pages_custom_column', $column_name, $post->ID ); 724 else 795 } else { 796 /** 797 * Fires for each row in the list table. 798 * 799 * @since 3.0.2 800 * 801 * @param string $column_name The name of the column to display. 802 * @param int $post->ID The ID of the current post. 803 */ 725 804 do_action( 'manage_posts_custom_column', $column_name, $post->ID ); 805 } 806 /** 807 * Fires for each row in the list table. 808 * 809 * The dynamic portion of the hook name, $post->post_type, refers to post type. 810 * 811 * @since 3.0.2 812 * 813 * @param string $column_name The name of the column to display. 814 * @param int $post->ID The ID of the current post. 815 */ 726 816 do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID ); 727 817 ?></td> 728 818 <?php … … 906 996 907 997 if ( $bulk ) 908 998 $dropdown_args['show_option_no_change'] = __( '— No Change —' ); 999 /** 1000 * Filter the array of args in the quick edit dropdown. 1001 * 1002 * @since 3.0.2 1003 * 1004 * @param array $dropdown_args The array of args. 1005 */ 909 1006 $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args ); 910 1007 wp_dropdown_pages( $dropdown_args ); 911 1008 ?> … … 1079 1176 foreach ( $columns as $column_name => $column_display_name ) { 1080 1177 if ( isset( $core_columns[$column_name] ) ) 1081 1178 continue; 1179 /** 1180 * Fires one time for each custom column. 1181 * 1182 * @since 3.0.2 1183 * 1184 * @param string $column_name The name of the column to edit. 1185 * @param object $screen->post_type The type of the posts. 1186 */ 1082 1187 do_action( $bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $screen->post_type ); 1083 1188 } 1084 1189 ?>