Checks whether a given request has permission to export.
Source
public function permissions_check() {
if ( current_user_can( 'edit_theme_options' ) ) {
return true;
}
return new WP_Error(
'rest_cannot_export_templates',
__( 'Sorry, you are not allowed to export templates and template parts.' ),
array( 'status' => rest_authorization_required_code() )
);
}
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.