W3cubDocs

/WordPress

WP_oEmbed_Controller::get_proxy_item_permissions_check()

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

File: wp-includes/class-wp-oembed-controller.php

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

Version Description
4.8.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_oembed_controller/get_proxy_item_permissions_check