WordPress.org

Make WordPress Core

Changeset 18818


Ignore:
Timestamp:
09/29/2011 09:21:15 PM (8 years ago)
Author:
nacin
Message:

Add filter for the args into wp_dropdown_pages() in the page attributes box. Give the list_pages filter the context of the post object. fixes #8592 for 3.3.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r18722 r18818  
    847847                <span class="title"><?php _e( 'Parent' ); ?></span>
    848848    <?php
    849         $dropdown_args = array( 'post_type' => $post_type_object->name, 'selected' => $post->post_parent, 'name' => 'post_parent', 'show_option_none' => __( 'Main Page (no parent)' ), 'option_none_value' => 0, 'sort_column'=> 'menu_order, post_title' );
     849        $dropdown_args = array(
     850            'post_type'         => $post_type_object->name,
     851            'selected'          => $post->post_parent,
     852            'name'              => 'post_parent',
     853            'show_option_none'  => __( 'Main Page (no parent)' ),
     854            'option_none_value' => 0,
     855            'sort_column'       => 'menu_order, post_title',
     856        );
     857
    850858        if ( $bulk )
    851859            $dropdown_args['show_option_no_change'] =  __( '&mdash; No Change &mdash;' );
  • trunk/wp-admin/includes/meta-boxes.php

    r18632 r18818  
    561561    $post_type_object = get_post_type_object($post->post_type);
    562562    if ( $post_type_object->hierarchical ) {
    563         $pages = wp_dropdown_pages(array('post_type' => $post->post_type, 'exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('(no parent)'), 'sort_column'=> 'menu_order, post_title', 'echo' => 0));
     563        $dropdown_args = array(
     564            'post_type'        => $post->post_type,
     565            'exclude_tree'     => $post->ID,
     566            'selected'         => $post->post_parent,
     567            'name'             => 'parent_id',
     568            'show_option_none' => __('(no parent)'),
     569            'sort_column'      => 'menu_order, post_title',
     570            'echo'             => 0,
     571        );
     572
     573        $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
     574        $pages = wp_dropdown_pages( $dropdown_args );
    564575        if ( ! empty($pages) ) {
    565576?>
  • trunk/wp-includes/post-template.php

    r18739 r18818  
    11081108            $output .= ' selected="selected"';
    11091109        $output .= '>';
    1110         $title = apply_filters( 'list_pages', $page->post_title );
     1110        $title = apply_filters( 'list_pages', $page->post_title, $page );
    11111111        $output .= $pad . esc_html( $title );
    11121112        $output .= "</option>\n";
Note: See TracChangeset for help on using the changeset viewer.