WP_oEmbed_Controller::get_proxy_item_permissions_check(): true|WP_Error

In this article

Checks if current user can make a proxy oEmbed request.

Return

true|WP_Error True if the request has read access, WP_Error object otherwise.

Source

public function get_proxy_item_permissions_check() {
	if ( ! current_user_can( 'edit_posts' ) ) {
		return new WP_Error( 'rest_forbidden', __( 'Sorry, you are not allowed to make proxied oEmbed requests.' ), array( 'status' => rest_authorization_required_code() ) );
	}
	return true;
}

Changelog

VersionDescription
4.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.