Changeset 59122 for trunk/src/wp-includes/capabilities.php
- Timestamp:
- 09/30/2024 06:47:20 AM (23 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/capabilities.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/capabilities.php
r58998 r59122 802 802 $caps = map_meta_cap( 'edit_user', $user_id, $args[0] ); 803 803 break; 804 case 'edit_block_binding': 805 $block_editor_context = $args[0]; 806 if ( isset( $block_editor_context->post ) ) { 807 $object_id = $block_editor_context->post->ID; 808 } 809 /* 810 * If the post ID is null, check if the context is the site editor. 811 * Fall back to the edit_theme_options in that case. 812 */ 813 if ( ! isset( $object_id ) ) { 814 if ( ! isset( $block_editor_context->name ) || 'core/edit-site' !== $block_editor_context->name ) { 815 $caps[] = 'do_not_allow'; 816 break; 817 } 818 $caps = map_meta_cap( 'edit_theme_options', $user_id ); 819 break; 820 } 821 822 $object_subtype = get_object_subtype( 'post', (int) $object_id ); 823 if ( empty( $object_subtype ) ) { 824 $caps[] = 'do_not_allow'; 825 break; 826 } 827 828 $caps = map_meta_cap( "edit_{$object_subtype}", $user_id, $object_id ); 829 break; 804 830 default: 805 831 // Handle meta capabilities for custom post types.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)