WP_REST_Global_Styles_Controller::get_available_actions(): array
Get the link relations available for the post and current user.
Return
array List of link relations.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
.
View all references
protected function get_available_actions() {
$rels = array();
$post_type = get_post_type_object( $this->post_type );
if ( current_user_can( $post_type->cap->publish_posts ) ) {
$rels[] = 'https://api.w.org/action-publish';
}
if ( current_user_can( 'edit_css' ) ) {
$rels[] = 'https://api.w.org/action-edit-css';
}
return $rels;
}
Changelog
Version | Description |
---|---|
6.2.0 | Added 'edit-css' action. |
5.9.0 | Introduced. |