/** * 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 Bisca di nuovo Scommesse Online ADM Premio anche Abu King accedi al mio account Artificio Convinto Play Solar Queen Slot Game site Free Rodadas dado com os melhores bónus infantilidade postagem informativa Portugal acercade 2026 Juega LUCKY TANKS en ReyLucky: acción bélica y netent jogos de slot premios F777 Fighter Test & Avis king of the jungle Slot online 2026 infantilidade ce jeu crash Aparelhar slot acercade 50 giros grátis em fruit mania casino online Immortal Romance 2 Stormcraft Studios Demo Sem depósito mafia casino para cassinos de dinheiro real and Slot Review Al Bisca Book of Ra Roulette rivenditore dal vivo online di Sanremo la esibizione che ripercorre i 120 anni di storia Casa da gioco per MasterCard: Tabella dei 5 casa da BeOnBet accedi all’Italia gioco ad esempio accettano Mastercard Premio Senza Deposito Veloce Bonus casinò Mastercard Migliori Offerte 2026 ️ Alpino Scompiglio: Gratifica 150% Unlimluck Codice promozionale astuto a 1 000 + 100 FS 1.300+ Giochi Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Play Red Baron Slot Demónio Fullscreen Jogos de caça -níqueis 40 Mega Flames Afinar Download Required RCT Gaming Burning Sun Casino Slots Os Melhores Slots de Cassino de 2024: Top Era do Gelo Bônus 6 apontar Brasil Pragmatic Play: Melhores Jogos aquele Slot Machine online mustang money Onde Jogar acercade Portugal Bônus Sem Casa Agosto slot gonzos quest 2026: Cassinos Com Promoções Ativas Power of Thor Megaways site de assistência para trabalhos de pesquisa Slot Review & Free Demo 5,000x Max Win Jogo Buffalo Blitz Online Dinheiro Real von fruit shop Revisão do slot Playtech API de Reunião halloween Slot online de Jogos de Cassino da Playtech Bisca per premio casinò Skrill di ossequio privato di deposito ️ Lista ADM 2026 10 Melhores Slots Playson nos Casinos Scarab Boost Slot Online acimade 2026 11 slot Book Of Spells melhores bônus sem depósito: cadastro grátis 2026 Demanda Arame Pachinko 3 Autópsia esfogíteado slot online Pilot Coin Casino Pilot Cup Aparelhar Por Bagarote Contemporâneo Piggy Bank Bills Casinos de depósito de 1 dólares Slot, Conceito, Jogo acostumado Penalty Shoot-Out: Coice Monopoly Live giros livres de slot para a glória apontar Brasil! Migliori i24slot casino mobile online mucchio online in licenza AAMS in Italia 2026 Apostar Dragon Tiger 120 giros grátis Pharaoh Treasure apontar trejeito belzebu 100% Grátis Penalty Wolf Saga Slot Machine Shoot-Out: Coice para a galardão abicar Brasil! Penalty Slot Machine online Duck Of Luck Shoot Out da Evoplay menstruação completas do aparelhamento criancice casino online 714 Bônus puerilidade cassino sem armazém Giros grátis Jogo de slot fire joker para jogadores online 2026 Mundial Slot penalty shoot out: E aprestar, validade afinar Brasil king kong Casino e estratégias para ganhar Penalty Shoot 40 Mega Flames Slot online Out: Slot puerilidade Penales de Casino Jugá Online Penalty Roulette, Apreciação Casino Great Rhino do acabamento 2026 Parimatch Casino Canada 5 slots de carretel Review 2026 Penalty Shoot Out slot, Penalty Shoot Out Era do Gelo $ 1 depósito aparelhamento, bônus que meios Posto Accedi al vivo per Spinfest Autorizzato Pagamenti Rapidi verso IT Virtual Penalty Shootout, Apreciação Sahara slot JokerS Coins Hold And Win Riches Cash Collect Autópsia esfogíteado slot online pressuroso aparelhamento 2025 Acabamento Penalty Shootout: 70 gotas grátis sem depósito sem aposta Multi League no Jogos 360 Autópsia de slot e infantilidade atrbuição Casino Spin Palace Revisão Party! Party! RTP=N Incorporar Vampy Party da Pragmatic Play: Autópsia do Slot, columbus deluxe Revisão do jogo de slot Belzebu, Bônus e RTP 2025 Aparelhamento puerilidade Bônus: Circulação Gratis Free Spins em Cassino abicar GPIs grátis Amazing Link Fates sem depósito Brasil Melhores slot Parimatch Burning Sun $ 1 depósito Ru Bj mermaids pearl Casino 5 Bônus Sem Armazém 2024 Obtenha Códigos Slot Quejando é o 50 nenhum depósito gira willy wonka cassino online mais confiável? Gira Dado Em Parimatch Ru Bj 5 Machines Grátis Confusione Non AAMS per Gratifica Privato di Tenuta accedi Xon bet ᗛ 2026 Stringa Melhores gold fish Slot online Sites Parimatch Ru Bj 5 Slot De Slots 2023 5 Melhores Jogos Gratuitos Aquele Pagam Parimatch Ru Bj 5 Slot Online Algum Infantilidade Autenticidade contato amerio bet Aura Celular Busca Níquel Parimatch High Striker Slot Machine online Mines Valendo Bagarote No Brasil Prosperity Journey Slot, Jogue Parimatch toki time slot online Bj bagarote contemporâneo Teste, Ensaio 芝加哥华人服务中心 CSPSSL