WordPress.org

Make WordPress Core

Ticket #14122: fix-capabilities-on-default.patch

File fix-capabilities-on-default.patch, 469 bytes (added by WraithKenny, 3 years ago)

Adds a check to see if register_post_type is using default capabilities and turns on map_meta_cap

  • wp-includes/post.php

     
    920920        if ( empty($args->capability_type) ) 
    921921                $args->capability_type = 'post'; 
    922922 
     923        if ( $args->capability_type == 'post' && empty($args->capabilities) ) 
     924                $args->map_meta_cap = true; 
     925 
    923926        $args->cap = get_post_type_capabilities( $args ); 
    924927        unset($args->capabilities); 
    925928