Re-maps 'edit_post' meta cap for a customize_changeset post to be the same as 'customize' maps.
Description
There is essentially a "meta meta" cap in play here, where 'edit_post' meta cap maps to the 'customize' meta cap which then maps to 'edit_theme_options'. This is currently required in core for wp_create_post_autosave() because it will call _wp_translate_postdata() which in turn will check if a user can 'edit_post', but the the caps for the customize_changeset post type are all mapping to the meta capability.This should be able to be removed once #40922 is addressed in core.
Parameters
$capsstring[]
Array of the user's capabilities.
$capstring
Capability name.
$user_idint
The user ID.
$argsarray
Adds the context to the cap. Typically the object ID.
Return
array
Capabilities.
Uses · 3
get_post_type()Retrieves the post type of the current post or of a given post.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/class-wp-customize-manager.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.