Make WordPress Core


Ignore:
Timestamp:
12/14/2018 02:14:13 AM (6 years ago)
Author:
jeremyfelt
Message:

Blocks: Add the reusable block post type, wp_block.

Merges [43804] from the 5.0 branch to trunk.

See #45098.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-includes/capabilities.php

    r43520 r44146  
    575575            }
    576576
     577            // Block capabilities map to their post equivalent.
     578            $block_caps = array(
     579                'edit_blocks',
     580                'edit_others_blocks',
     581                'publish_blocks',
     582                'read_private_blocks',
     583                'delete_blocks',
     584                'delete_private_blocks',
     585                'delete_published_blocks',
     586                'delete_others_blocks',
     587                'edit_private_blocks',
     588                'edit_published_blocks',
     589            );
     590            if ( in_array( $cap, $block_caps, true ) ) {
     591                $cap = str_replace( '_blocks', '_posts', $cap );
     592            }
     593
    577594            // If no meta caps match, return the original cap.
    578595            $caps[] = $cap;
Note: See TracChangeset for help on using the changeset viewer.