WP_REST_Global_Styles_Controller::get_available_actions() WordPress Method

The WP_REST_Global_Styles_Controller::get_available_actions() method is used to get the available actions for the global styles controller.

WP_REST_Global_Styles_Controller::get_available_actions() #

Get the link relations available for the post and current user.


Return

(array) List of link relations.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php

	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';
		}

		return $rels;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.