WP_oEmbed_Controller::get_proxy_item_permissions_check() WordPress Method

The WP_oEmbed_Controller::get_proxy_item_permissions_check() method is used to check whether a user has permission to access an oEmbed resource via a proxy. This method is used to check whether a user has permission to access an oEmbed resource via a proxy. A proxy is used to access oEmbed resources from sites that do not support oEmbed discovery. This method returns true if the user has the 'edit_posts' capability. Otherwise, it returns false.

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.


Top ↑

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


Top ↑

Changelog

Changelog
VersionDescription
4.8.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.