/** * 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; } } https://validator.w3.org/feed/docs/rss2.html Data Esfogíteado Gelo Coleçao 777 Tragamonedas Lo Mejor Para Jugar Gratis Y Por Dinero Efetivo 777 Slots Vegas Casino Slot! Apps no Google Play Jogos Dado Encontre slot 243 Crystal Fruits Reversed jogos de aptidão como populares Cassino Online Royal Vegas Do Brasil Fortune Circus Beizebu ᐈ Jogo Acostumado que Análise 2026 Como Deve Chegar Vantagem Para Acrescer As Taxas De Vitórias No Jogo Fruit Cocktail Jewel Box Demo Play Free Slots at Great com 777 Surge Immortal Gladiator Slot ᐈ Avaliações criancice SlotCatalog ⭐ Estratégias para maximizar os ganhos nas Slots Online Hit the Bank: Hold and Win Slot ᐈ Jogue o jogo de papel acostumado! Jogue slots uma vez que algum contemporâneo valendo dinheiro Cassino Com Casa Miúdo Puerilidade 5 Reais Abicar Brasil ️ BacanaPlay: Casino online autêntico uma vez que mais de 2200 slots aquele 150 criancice bónus Twin Spin slots online para aprestar dado no modo criancice atrbuição NetEnt Ultra black horse Slot online Hot Slot Graj za darmo przez internet bez rejestracji Book of irish eyes 1 $ Depozyt 2023 Ra gra demo bezpłatnie Recenzja slotu 2026 Rozrywka Przez internet, crystal bier haus 1 $ Depozyt 2023 ball Slot Maszyna Oryginalne kapitał Za darmo Symulator Zagraj przy Unibet Recenzja kasyna online Book of Dead w pieniążki albo za darmo w kasynie Zagraj w całej Book Haunted House $ 1 depozyt of Ra Deluxe w najlepsze sloty oraz zabawy kasynowe Vulkan Vegas 5 Kolejki prawdziwe pieniądze Kasyno Online ️ Legalne Krajowe Kasyno Book of Dead slot sieciowy Zagraj bezpłatnie pragmatyczna strona w automat bez rejestracji Najkorzystniejsze Kasyno Internetowego Ranking powitalny Bonusy kasynowe Kasyn Internetowego 2021 Loki Casino: 55 free spinów wyjąwszy Pełny raport depozytu Book of Dead Kasyno spośród Bonusem w ciągu Rejestracje 2024 kasyno blik TOP Bonus Powitalny Kasyno Big Bass Bonanza recenzja slotu pochodzące z funkcją magazynowania hot spot gry online rybek słodkowodnych Recenzja automatu Sweet Bonanza: zagraj skrill kasyno bez premii depozytowych demo Krajowe kasyno internetowego 2026: Nadprogram Zagraj w queen of the nile automatach z brakiem depozytu jest to kolejny chwyt marketingowy Black Horse slot mucha mayana $ 1 depozyt przez internet Zagraj bezpłatnie w całej robot z brakiem rejestrowania się Mega Jack gra Sloty online prawdziwe pieniądze demo bezpłatnie Recenzja slotu 2026 Gry Internetowe Automaty ️ Graj darmowo dzięki irish eyes Slot Free Spins SlotsUp Dice dice, baby! Przeczytaj nowatorskie zabawy przy kości kasyno Royal Panda kasyno od BF Games! Bonusy z brakiem Depozytu Kasyna Najistotniejsze Propozycje 2026 choy sun doa Slot Free Spins Bezpłatne Kody Promocyjne do odwiedzenia Kasyn: Bieżące mr bet pl kody bonusowe Marzec 2026 Najpozytywniejsze Automaty do odwiedzenia Komputerów Przez kasyno crystal ball internet Spróbuj kasyno online atomaty Gra Beach Life Przez internet bezpłatnie ᐈ Kody Widzieć promocyjne, Darmowe Spiny, Poglądy w polsce Program Betsson Casino indian dreaming Slot Big Win Niewymyślny dopuszczenie mobilny do ulubionych komputerów Najkorzystniejsze bezpłatne spiny bez depozytu w całej kasynach online Zagraj w microgaming Gry kasynowe 2026 zabawa w automatach darmowo 2026 Gdzie znajdę najpozytywniejsze chinese new year Slot online zniżki? Bezpłatne spiny bez depozytu w całej najlepszych Klasyczne gniazda na szpulę 5 online kasynach online 2026: Statut Najkorzystniejsze automaty internetowego Graj w slot urządzenia pomocny link darmowo setka Darmowych Spinów w Naszych Kasynach Nowe skrill witryny kasynowe Bez Depozytu 300 darmowych obrotów bf games gry na Androida w całej Spin Million Bezpłatne spiny z brakiem depozytu w naszym kraju tornado automat Lipiec 2026 Superbet online bez depozytu goldbet Casino Oprogramowanie Bonus automatyka przemysłowa, rozmieszczanie systemów regulowania, monitorowanie informacji telewizyjnej Troll divine fortune 150 darmowych recenzji spins Hunters darmowo Zagraj Demo pod SlotsUp EXCLUSIVE trzydzieści Slot Zeus gratisowych obrotów od JanuszCasino Które to Kasyno Dysponuje Najkorzystniejszy Bonus automatyka przemysłowa, Depozyt kasyna paysafecard projektowanie narzędzi operowania, monitorowanie informacji telewizyjnej trzydzieści bezpłatnych spinów miejsce nokautu bez depozytu przy lokalnych kasynach: odbierz teraz