WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_oEmbed_Controller::register_routes() WP 4.4.0

Register the oEmbed REST API route.

Это метод класса: WP_oEmbed_Controller

Хуки из метода
Возвращает

Null. Ничего.

Использование

$WP_oEmbed_Controller = new WP_oEmbed_Controller();
$var = $WP_oEmbed_Controller->register_routes();

Список изменений

С версии 4.4.0 Введена.

Код WP oEmbed Controller::register routes: wp-includes/class-wp-oembed-controller.php WP 5.2.3

<?php
public function register_routes() {
	/**
	 * Filters the maxwidth oEmbed parameter.
	 *
	 * @since 4.4.0
	 *
	 * @param int $maxwidth Maximum allowed width. Default 600.
	 */
	$maxwidth = apply_filters( 'oembed_default_width', 600 );

	register_rest_route(
		'oembed/1.0',
		'/embed',
		array(
			array(
				'methods'  => WP_REST_Server::READABLE,
				'callback' => array( $this, 'get_item' ),
				'args'     => array(
					'url'      => array(
						'required'          => true,
						'sanitize_callback' => 'esc_url_raw',
					),
					'format'   => array(
						'default'           => 'json',
						'sanitize_callback' => 'wp_oembed_ensure_format',
					),
					'maxwidth' => array(
						'default'           => $maxwidth,
						'sanitize_callback' => 'absint',
					),
				),
			),
		)
	);

	register_rest_route(
		'oembed/1.0',
		'/proxy',
		array(
			array(
				'methods'             => WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_proxy_item' ),
				'permission_callback' => array( $this, 'get_proxy_item_permissions_check' ),
				'args'                => array(
					'url'       => array(
						'description'       => __( 'The URL of the resource for which to fetch oEmbed data.' ),
						'type'              => 'string',
						'required'          => true,
						'sanitize_callback' => 'esc_url_raw',
					),
					'format'    => array(
						'description' => __( 'The oEmbed format to use.' ),
						'type'        => 'string',
						'default'     => 'json',
						'enum'        => array(
							'json',
							'xml',
						),
					),
					'maxwidth'  => array(
						'description'       => __( 'The maximum width of the embed frame in pixels.' ),
						'type'              => 'integer',
						'default'           => $maxwidth,
						'sanitize_callback' => 'absint',
					),
					'maxheight' => array(
						'description'       => __( 'The maximum height of the embed frame in pixels.' ),
						'type'              => 'integer',
						'sanitize_callback' => 'absint',
					),
					'discover'  => array(
						'description' => __( 'Whether to perform an oEmbed discovery request for non-whitelisted providers.' ),
						'type'        => 'boolean',
						'default'     => true,
					),
				),
			),
		)
	);
}