Make WordPress Core


Ignore:
Timestamp:
09/29/2011 09:21:15 PM (13 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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?>
Note: See TracChangeset for help on using the changeset viewer.