Ticket #26397: class-wp-posts-list-table.2.diff
File class-wp-posts-list-table.2.diff, 7.3 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 on post and media list tables. 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 * The filter name is dependent on whether the current post type is 663 * hierarchical (page_row_actions) or not (post_row_actions). 664 * 665 * @since 3.0.2 666 * 667 * @param array $actions The array of actions. 668 * @param object $post The post object for the row. 669 */ 615 670 $actions = apply_filters( is_post_type_hierarchical( $post->post_type ) ? 'page_row_actions' : 'post_row_actions', $actions, $post ); 616 671 echo $this->row_actions( $actions ); 617 672 … … 637 692 } 638 693 639 694 echo '<td ' . $attributes . '>'; 640 if ( 'excerpt' == $mode ) 695 if ( 'excerpt' == $mode ) { 696 /** 697 * Filter the published time of the post. 698 * 699 * @since 3.0.2 700 * 701 * @param array $t_time The published time. 702 * @param object $post The post object. 703 * @param string $column_name The column name. 704 * @param string $mode The list display mode ( 'excerpt' or 'list' ). 705 */ 641 706 echo apply_filters( 'post_date_column_time', $t_time, $post, $column_name, $mode ); 642 else 707 } else { 708 /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */ 643 709 echo '<abbr title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, $column_name, $mode ) . '</abbr>'; 710 } 644 711 echo '<br />'; 645 712 if ( 'publish' == $post->post_status ) { 646 713 _e( 'Published' ); … … 719 786 } 720 787 ?> 721 788 <td <?php echo $attributes ?>><?php 722 if ( is_post_type_hierarchical( $post->post_type ) ) 789 if ( is_post_type_hierarchical( $post->post_type ) ) { 790 /** 791 * Fires for each row in the list table. 792 * 793 * @since 3.0.2 794 * 795 * @param string $column_name The name of the column to display. 796 * @param int $post_id The ID of the current post. 797 */ 723 798 do_action( 'manage_pages_custom_column', $column_name, $post->ID ); 724 else 799 } else { 800 /** 801 * Fires for each row in the list table. 802 * 803 * @since 3.0.2 804 * 805 * @param string $column_name The name of the column to display. 806 * @param int $post_id The ID of the current post. 807 */ 725 808 do_action( 'manage_posts_custom_column', $column_name, $post->ID ); 809 } 810 /** 811 * Fires for each row in the list table. 812 * 813 * The dynamic portion of the hook name, $post->post_type, refers to post type. 814 * 815 * @since 3.0.2 816 * 817 * @param string $column_name The name of the column to display. 818 * @param int $post_id The ID of the current post. 819 */ 726 820 do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID ); 727 821 ?></td> 728 822 <?php … … 906 1000 907 1001 if ( $bulk ) 908 1002 $dropdown_args['show_option_no_change'] = __( '— No Change —' ); 1003 /** 1004 * Filter the array of args in the quick edit dropdown. 1005 * 1006 * @since 3.0.2 1007 * 1008 * @see wp_dropdown_pages(). 1009 * 1010 * @param array $dropdown_args The array of args. 1011 */ 909 1012 $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args ); 910 1013 wp_dropdown_pages( $dropdown_args ); 911 1014 ?> … … 1079 1182 foreach ( $columns as $column_name => $column_display_name ) { 1080 1183 if ( isset( $core_columns[$column_name] ) ) 1081 1184 continue; 1185 /**x 1186 * Fires one time for each custom column. 1187 * 1188 * The action name is dependent on whether bulk editing (bulk_edit_custom_box) 1189 * or quick editing (quick_edit_custom_box) is being performed. 1190 * 1191 * @since 3.0.2 1192 * 1193 * @param string $column_name The name of the column to edit. 1194 * @param object $post_type The type of the posts. 1195 */ 1082 1196 do_action( $bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $screen->post_type ); 1083 1197 } 1084 1198 ?>