WP_REST_Global_Styles_Controller::get_available_actions()protectedWP 5.9.0

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

{} It's a method of the class: WP_REST_Global_Styles_Controller{}

No Hooks.

Return

Array. List of link relations.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_available_actions();

Changelog

Since 5.9.0 Introduced.

Code of WP_REST_Global_Styles_Controller::get_available_actions() WP 6.0

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