/** * WP_oEmbed_Controller class, used to provide an oEmbed endpoint. * * @package WordPress * @subpackage Embeds * @since 4.4.0 */ /** * oEmbed API endpoint controller. * * Registers the REST API route and delivers the response data. * The output format (XML or JSON) is handled by the REST API. * * @since 4.4.0 */ #[AllowDynamicProperties] final class WP_oEmbed_Controller { /** * Register the oEmbed REST API route. * * @since 4.4.0 */ 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' ), 'permission_callback' => '__return_true', 'args' => array( 'url' => array( 'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ), 'required' => true, 'type' => 'string', 'format' => 'uri', ), '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.' ), 'required' => true, 'type' => 'string', 'format' => 'uri', ), '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 unsanctioned providers.' ), 'type' => 'boolean', 'default' => true, ), ), ), ) ); } /** * Callback for the embed API endpoint. * * Returns the JSON object for the post. * * @since 4.4.0 * * @param WP_REST_Request $request Full data about the request. * @return array|WP_Error oEmbed response data or WP_Error on failure. */ public function get_item( $request ) { $post_id = url_to_postid( $request['url'] ); /** * Filters the determined post ID. * * @since 4.4.0 * * @param int $post_id The post ID. * @param string $url The requested URL. */ $post_id = apply_filters( 'oembed_request_post_id', $post_id, $request['url'] ); $data = get_oembed_response_data( $post_id, $request['maxwidth'] ); if ( ! $data ) { return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) ); } return $data; } /** * Checks if current user can make a proxy oEmbed request. * * @since 4.8.0 * * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ 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; } /** * Callback for the proxy API endpoint. * * Returns the JSON object for the proxied item. * * @since 4.8.0 * * @see WP_oEmbed::get_html() * @global WP_Embed $wp_embed WordPress Embed object. * @global WP_Scripts $wp_scripts * * @param WP_REST_Request $request Full data about the request. * @return object|WP_Error oEmbed response data or WP_Error on failure. */ public function get_proxy_item( $request ) { global $wp_embed, $wp_scripts; $args = $request->get_params(); // Serve oEmbed data from cache if set. unset( $args['_wpnonce'] ); $cache_key = 'oembed_' . md5( serialize( $args ) ); $data = get_transient( $cache_key ); if ( ! empty( $data ) ) { return $data; } $url = $request['url']; unset( $args['url'] ); // Copy maxwidth/maxheight to width/height since WP_oEmbed::fetch() uses these arg names. if ( isset( $args['maxwidth'] ) ) { $args['width'] = $args['maxwidth']; } if ( isset( $args['maxheight'] ) ) { $args['height'] = $args['maxheight']; } // Short-circuit process for URLs belonging to the current site. $data = get_oembed_response_data_for_url( $url, $args ); if ( $data ) { return $data; } $data = _wp_oembed_get_object()->get_data( $url, $args ); if ( false === $data ) { // Try using a classic embed, instead. /* @var WP_Embed $wp_embed */ $html = $wp_embed->get_embed_handler_html( $args, $url ); if ( $html ) { // Check if any scripts were enqueued by the shortcode, and include them in the response. $enqueued_scripts = array(); foreach ( $wp_scripts->queue as $script ) { $enqueued_scripts[] = $wp_scripts->registered[ $script ]->src; } return (object) array( 'provider_name' => __( 'Embed Handler' ), 'html' => $html, 'scripts' => $enqueued_scripts, ); } return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) ); } /** This filter is documented in wp-includes/class-wp-oembed.php */ $data->html = apply_filters( 'oembed_result', _wp_oembed_get_object()->data2html( (object) $data, $url ), $url, $args ); /** * Filters the oEmbed TTL value (time to live). * * Similar to the {@see 'oembed_ttl'} filter, but for the REST API * oEmbed proxy endpoint. * * @since 4.8.0 * * @param int $time Time to live (in seconds). * @param string $url The attempted embed URL. * @param array $args An array of embed request arguments. */ $ttl = apply_filters( 'rest_oembed_ttl', DAY_IN_SECONDS, $url, $args ); set_transient( $cache_key, $data, $ttl ); return $data; } } news – Page 3 – tejas-apartment.teson.xyz

news

NV kasyno dowiadczenie uytkownika i funkcje platformy.49

NV kasyno – doświadczenie użytkownika i funkcje platformy ▶️ GRAĆ Содержимое Wprowadzenie do NV kasyna Funkcje i narzędzia NV kasyna Wyniki i korzyści z korzystania z NV kasyna Wyniki korzystania z NV kasyna Jeśli szukasz najlepszego kasyna online, NV kasyno jest jednym z najpopularniejszych wyborów. W tym artykule przedstawimy doświadczenie użytkownika i funkcje tej platformy, […]

NV kasyno dowiadczenie uytkownika i funkcje platformy.49 Read More »

1win Online Betting and Casino Official site in India.1159

1win Online Betting and Casino Official site in India ▶️ PLAY Содержимое Why Choose 1win for Online Betting and Casino Games Are you looking for a reliable and secure online betting and casino platform in India? Look no further than 1win! With its official site, you can enjoy a wide range of games, including slots,

1win Online Betting and Casino Official site in India.1159 Read More »

Online casinos met snelle uitbetaling in Belgi.1684 (2)

Online casino’s met snelle uitbetaling in België ▶️ SPELEN Содержимое Online casino’s met snelle uitbetaling in België Als je op zoek bent naar een online casino met snelle uitbetaling in België, dan ben je bij het juiste adres. In dit artikel zullen we je helpen bij het vinden van de beste goksites in België, waar

Online casinos met snelle uitbetaling in Belgi.1684 (2) Read More »

Malina Kasyno PL Oferta gier online slotw i stow kasynowych.6022

Malina Kasyno PL – Oferta gier online, slotów i stołów kasynowych ▶️ GRAĆ Содержимое Witryna kasyno online – jak zalogować się w Malina Casino Oferta gier kasynowych Regulamin i warunki gry w Malina Kasyno Jeśli szukasz najlepszych gier online i kasynowych, to Malina Kasyno PL jest idealnym wyborem. Oferujemy szeroki wybór gier, w tym slotów,

Malina Kasyno PL Oferta gier online slotw i stow kasynowych.6022 Read More »

Malina Kasyno PL Oferta gier online slotw i stow kasynowych.5162

Malina Kasyno PL – Oferta gier online, slotów i stołów kasynowych ▶️ GRAĆ Содержимое Witryna kasyno online – jak wybrać najlepsze kasyno online? Co powiniemy szukać w kasynie online? Oferta gier kasynowych Wybór gier kasynowych Regulamin i warunki gry w Malina Casino Jeśli szukasz najlepszych gier online i kasynowych, to Malina Kasyno PL jest idealnym

Malina Kasyno PL Oferta gier online slotw i stow kasynowych.5162 Read More »

NV Casino online licencja i wiarygodno kasyna.258

NV Casino online – licencja i wiarygodność kasyna ▶️ GRAĆ Содержимое Wprowadzenie do NV Casino Co możesz oczekiwać od NV Casino? Weryfikacja licencji i certyfikatów Certyfikaty NV Casino online Zasada działania i bezpieczeństwo danych W dzisiejszym świecie, gdzie coraz więcej ludzi decyduje się na grę w kasyno online, ważne jest, aby wybrać kasyno, które oferuje

NV Casino online licencja i wiarygodno kasyna.258 Read More »

Vavada online casino w Polsce kasyno na ywo.1299

Vavada online casino w Polsce – kasyno na żywo ▶️ GRAĆ Содержимое Wprowadzenie do świata hazardu online Co to jest hazard online? Kasyno Vavada: co oferuje? Wielkość portfela gier Jeśli szukasz kasyna online, które oferuje emocjonującą grę i atrakcyjne bonusy, to Vavada jest idealnym wyborem. To kasyno online, które oferuje szeroki wybór gier, w tym

Vavada online casino w Polsce kasyno na ywo.1299 Read More »

Vavada online casino w Polsce opinie graczy.1274

Vavada online casino w Polsce – opinie graczy ▶️ GRAĆ Содержимое Wprowadzenie do Vavada Wprowadzenie do Vavada – korzyści Opinie graczy o Vavada Recenzje graczy Zwycięstwo w Vavada – jak zdobyć bonus? Jeśli szukasz najlepszego online casino, które oferuje emocjonujące gry hazardowe, to Vavada jest idealnym wyborem. W Polsce Vavada online casino cieszy się ogromną

Vavada online casino w Polsce opinie graczy.1274 Read More »

Casibom Casino Resmi Giri.2856

Casibom Casino Resmi Giriş ▶️ OYNAMAK Содержимое Rehber ve Adımlar casibom gelen giriş ve güncel uygulama Casibom Casino Resmi Giriş Destek ve Güvenlik casibom giriş sayfasına hoş geldiniz. Casibom 158 giriş sayfası, güvenli ve hızlı bir deneyim sunar. Casibo veya Cadibom gibi alternatiflerden farklı olarak, Casibom güncel giriş sayfası en iyi deneyimi sağlar. Casibom güncel

Casibom Casino Resmi Giri.2856 Read More »