Make WordPress Core


Ignore:
Timestamp:
11/13/2010 08:40:38 AM (14 years ago)
Author:
nacin
Message:

Set map_meta_cap to true when capability_type = post and no custom caps are specified. see #14122.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r16319 r16338  
    884884    $defaults = array(
    885885        'labels' => array(), 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null,
    886         'capability_type' => 'post', 'capabilities' => array(), 'map_meta_cap' => false,
     886        'capability_type' => 'post', 'capabilities' => array(), 'map_meta_cap' => null,
    887887        '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'hierarchical' => false,
    888888        'public' => false, 'rewrite' => true, 'has_archive' => false, 'query_var' => true,
     
    916916    if ( null === $args->exclude_from_search )
    917917        $args->exclude_from_search = !$args->public;
     918
     919    // Back compat with quirky handling in version 3.0. #14122
     920    if ( 'post' == $args->capability_type && null === $args->map_meta_cap && empty( $args->capabilities ) )
     921        $args->map_meta_cap = true;
     922
     923    if ( null === $args->map_meta_cap )
     924        $args->map_meta_cap = false;
    918925
    919926    $args->cap = get_post_type_capabilities( $args );
Note: See TracChangeset for help on using the changeset viewer.