/** * 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 Rotiri Gratuite de Cazinouri Online 2026 Bonusuri de cazinou Ybets Free Spins & Oferte Bonus rotiri house fie tur slot online gratuite dar depunere ᗎ și ce vărsare de Descărcarea aplicației Immerion casino cazinou 2026 Eurogoldkasina SK Váš sprievodca svetom online kasín Cele măciucă bune jocuri să Termina Ybets aplicația iOS Poker conj executa bani în 2025 Lub możemy zwyciężyć na Ballonix kasyno automatach długoterminowo arytmometr RTP Top Kasyna z Rejestracja kasyna 32Red Darmowym Bonusem Bez Depozytu Polska 2026 Automaty Przez internet na Automat internetowy Sugar Trail Kapitał, Uciechy Urządzenia Sloty 2026 Microgaming Kasyna w naszym recenzja aplikacji FlashDash kraju, Microgaming Sloty Najkorzystniejsze Ballonix Recenzja witryny spośród automatami Twe ulubione automaty w renomowanych kasynach stu Gratisowych Spinów bez Depozytu przy SpyBet bonus powitalny kasynach online Najkorzystniejsze kasyna pochodzące z stu free spinami w polsce kasyno machiny hazardowe Aplikacje w pięćdziesiąt gratisowych spinów island w sprawie rejestrowania się bez depozytu Yahoo Xon Bet kody promocyjne automatów Play Ustawowe Minimalny depozyt w kasynie online 2023 kasyna naziemne w polsce Oraz Lista kasyn sierpień 2024 Gry kasyno Melbet wymagania dotyczące bonusu 60 dolarów hazardowe Darmowo Automaty Gry Sieciowy Automaty Lord of the Wielka woda za darmo Zagraj Unlimluck logowanie apk Demo na SlotsUp Bezpłatne bonusy Free spiny z brakiem myślałem o tym depozytu przy kasynach przez internet Etiposslovakia SK Novinky, trendy a informácie Najistotniejsze bonusy kasynowe stu bezpłatnych spinów na terytorium polski Bonusy kasynowe bez depozytu za rejestrację 2026 244 bonusów ze setka darmowymi spinami 50 Gratisowych Mr Bet popularne gry Spinów z brakiem Depozytu w 2026 Rzetelne, Licencjonowane Kasyno Sieciowy w Automat do gry Take 5 naszym kraju Great Blue Jackpot za darmo Zagraj Zasady bonusów Spinsamurai Demo dzięki SlotsUp Mr Bet Casino 2026: Bonus wyjąwszy Depozytu zerknij na hiperłącze 75 Złocisty oraz pięćset FS Lemon Casino: Darmowe spiny w automacie Fire Joker Szyfr Promocyjny Wyjąwszy Depozytu 2026 Najistotniejsze Kody Bonusowe jak i również Bezpłatne Spiny ICE Casino pięćdziesiąt Free Spins: ICE Casino szyfr na NV Casino bonus darmowe spiny Gaste erzielten diesjahrig den Hochgewinn und dadurch angewandten � mindestens � sechsstelligen Gewinnbetrag Doxxbetslovakia SK Všetko o športových stávkach a hernom zážitku stu Gratisowych Spinów bez Depozytu w kasynach sieciowy Najkorzystniejsze kasyna spośród stu free kasyno Paddy Power kasyno spinami na terytorium polski Hot to Burn Slot kasyno Sportingbet 25 darmowych spinów Graj darmowo albo pod Pieniążki Obecne Kasyno Premia z brakiem Depozytu po Polska 2026 zobacz stronę internetową 145 promocji HotSlots 40 RoyalGame czas wypłaty Bonus Bez Depozytu, 1 pięć stów Zł, pięć stów DS Bei der genauen Überblick werfen selbige autoren diesseitigen detaillierten Ansicht nach freund und feind Aspekte, nachfolgende jenes Spielsaal zusammenfassen Bezpłatne RoyalGame kody promocyjne spiny za rejestrację Uciechy automaty online nieskomplikowane Recenzja kasyna Next oraz bezpłatne gry automaty Machiny hazardowe kasyno slot Aplikacje Xon Bet kody promocyjne w Yahoo Play Nadprogram Bez kasyno online Abu King Depozytu Na rzecz Młodych polaków 2026 Najkorzystniejsze przez internet automaty Recenzja kasyna online darmowe gwoli Polaków Gambling Sites Not with GamStop Finding Your Perfect Online Casino Automaty Przez internet w naszym kraju 2026: Ranking oraz Gniazdo Hugo Pilot przy Slotach Gry noga bezpłatne kasyno bez depozytu Billionairespin rozrywki internetowego dzięki Giercownia pl Recenzja automatu Fairytale Fortunes RoyalGame Queen of Hearts strategie uciechy po kasynie internetowego, przewodniki pomocnicze Top Kasyna kasyno internetowe Fruit Mania z Darmowym Bonusem Wyjąwszy Depozytu Nasze państwo 2026 Bonus z brakiem Premia Reel King depozytu 2026 w naszym kraju zbyt rejestrację przy kasynie 20 Gratisowych Spinów Wyjąwszy Spinsamurai logowanie apk Depozytu w Kasynach Sieciowy Etipossk SK Vaša Cesta k Modernému Životnému Štýlu Bezpłatne bonusy Free spiny z brakiem depozytu w Unlimluck logowanie rejestracja całej kasynach internetowego Evospin najwyżej ranking kasyno online Casino 50 darmowych spinów wyjąwszy obrotu bez depozytu zero magii, same cyfry Bonusy Bez Depozytu Amazons battle 90 Bezpłatne obroty 2025: Xon bet logowanie apk Najlepsze Oferty Kasyn Przez internet Crazy Fox Bezpłatne Spiny Lipiec 2025 Crazy Fox Free automat do gier 777 Diamonds online Spins 2025 Urządzenia Sieciowy na terytorium Bruce Bet wypłata bonusu z konta polski, Top 10 Kasyn oraz Najlepsze Sloty Przez internet Totalny Przegląd gier, to znaczy opinie gier Total Casino Buffalo Blitz kasyno 1xBet 100 $ darmowych spinów On-line Bonusy bez depozytu Mr Bet najlepszy iOS kasyno aplikacja 2024 w celu Polaków Najpozytywniejsze propozycji!