Make WordPress Core

Changeset 38129


Ignore:
Timestamp:
07/21/2016 07:18:36 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Menus: In wp_nav_menu_item_post_type_meta_box():

  • Rename the $post_type parameter to $box for clarity and consistency with other meta box functions.
  • Make the docs more consistent with post_format_meta_box() and other meta box functions.
  • Correct type and description for the third argument of nav_menu_items_{$post_type_name}_recent filter.

See #37211.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/nav-menu.php

    r38128 r38129  
    298298 *
    299299 * @param string $object Not used.
    300  * @param array $post_type {
    301  *     Data that will be used as arguments of the post type meta box.
     300 * @param array  $box {
     301 *     Post type menu item meta box arguments.
    302302 *
    303303 *     @type string       $id       Meta box ID (used in the 'id' attribute for the meta box).
    304  *     @type string       $title    Title of the meta box.
    305  *     @type string       $callback Function that fills the box with the desired content.
    306  *     @type WP_Post_Type $args     The current post type object for this menu item meta box.
     304 *     @type string       $title    Meta box title.
     305 *     @type string       $callback Meta box display callback.
     306 *     @type WP_Post_Type $args     Extra meta box arguments (the post type object for this meta box).
    307307 * }
    308308 */
    309 function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
     309function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
    310310    global $_nav_menu_placeholder, $nav_menu_selected_id;
    311311
    312     $post_type_name = $post_type['args']->name;
     312    $post_type_name = $box['args']->name;
    313313
    314314    // Paginate browsing for large numbers of post objects.
     
    328328    );
    329329
    330     if ( isset( $post_type['args']->_default_query ) )
    331         $args = array_merge($args, (array) $post_type['args']->_default_query );
     330    if ( isset( $box['args']->_default_query ) )
     331        $args = array_merge($args, (array) $box['args']->_default_query );
    332332
    333333    // @todo transient caching of these results with proper invalidation on updating of a post of this type
     
    419419                 * @since 4.3.0
    420420                 *
    421                  * @param array  $most_recent An array of post objects being listed.
    422                  * @param array  $args        An array of WP_Query arguments.
    423                  * @param object $post_type   The current post type object for this menu item meta box.
     421                 * @param array $most_recent An array of post objects being listed.
     422                 * @param array $args        An array of WP_Query arguments.
     423                 * @param array $box         Arguments passed to wp_nav_menu_item_post_type_meta_box().
    424424                 */
    425                 $most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $post_type );
     425                $most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $box );
    426426
    427427                echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args );
Note: See TracChangeset for help on using the changeset viewer.