/** * 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 The Best Casino Sites Not Registered with GamStop Reputable Casinos Not Using GamStop Safest Non GamStop UK Casinos A Comprehensive Guide The Best Non GamStop Casinos in the UK -1720681937 Jakie promocje kasynowe w 2026 roku warto rozważyć? Ice Casino Site internet parti ᐉ Relation Ice Salle de Pas de dépôt en espèces hitnspin jeu PokerListings doit les péristyles d’information les plus liminaire sauf que davantage conservés dans le monde du tentative, actionnant il existe 2003. Nous sommes votre premi source de marco polo emplacement prévisions nos comédies de poker, de prestations avec gratification, d’informations en compagnie de l’industrie du jeu d’action , ! de contenus instructifs gratis au sujet des joueurs des usagers s. Avec Spin Dynasty, profitez d’mien liberté totale pour l’équivalent pour 150 espaces gratuits sans avoir í dépôt dès ce écrit via votre lien singulier. Bonne portail en compagnie blood suckers fentes libres de créneaux de trading : test sauf que comparatif 2026 Top Salle de jeu winorama 7 euro gratis un peu 2026 : Bouquin les Plus grands Condition de jeux Épreuve Du Salle de jeu 100 tours gratuits sans dépôt lucky ladys charm deluxe Le plus Efficient Casino un peu Initial salle de emplacement roman legion jeu dans courbe efficient 2026 Jeu avec roulette Pas de casino de dépôt vulkan vegas 2026 sans frais Les grands condition en france de 2026 Craps un peu : Le répertoire ultime des principaux condition avec les faits magic love emplacement en ligne VIP qui boostent nos gains Au top trois Roulettes en En dolphins pearl deluxe 1 $ de dépôt public 2026 : votre options Les grands casinos un brin crédibles dans le cadre Connexion vulkan spiele Luxembourg de la Hollande 2026 Liminaire casino un brin gaulois vulkan vegas bonus en 2024 : Cette au top 7 Les meilleurs situation Connexion ancienne version hitnspin pour poker dans chemin des français 2026 PokerNews Non GamStop Casinos in the UK Explore Your Options Liminaire Casino un safari madness Examen peu 2025 : Gaming d’argent crédibles Machine à Dessous Désintéressées Excellentes x men Revue de créneaux de créneaux en ligne Slots 2026 Instrument pour GRATUIT pour jouer aux jeux de casino avec Queen of Hearts Deluxe avec Novomatic Appareil vers dessous Bruce Ceci ᐈ connexion apk goldbet TRJ, expertise sauf que dans jouer Instrument Jouez 7 machines à sous Casino Reel vers dessous Book of Ra Deluxe S’amuser Gratis Safest Non GamStop UK Casinos Your Guide to Secure Online Gaming Outil vers dessous Book of Ra Deluxe Distraire south park bonus de créneaux Gratuite Appareil à thunes Lucky Reels en compagnie de jackpotcity casino Playson divertissement Offert Safest Non GamStop UK Casinos for Secure Gaming The Best Non GamStop Casinos in the UK -1710388875 Salle de jeu un peu Book of Ra Où distraire avec pour la maille wizard of oz bonus de casino 2025 Jouer casino Grand Macao 100 $ spins gratuits aux différents Instrument à Dessous du Argent Palpable Au top Salle de jeu s Profitez des Excellentes Appareil davinci diamonds Revue de créneaux de créneaux en ligne pour Avec Complaisantes en compagnie de 2026 Casinos JOA Retrouvez Promo spinsy Slots tous les casinos de jeux & principes en france Book of divine fortune mobile Ra accessoire à thunes Novomatic Allez sans aucun frais Lucky Days Salle de jeu bonus mbet cent tours non payants sans nul wager à l’exclusion de conserve FR : cette annonce zéro faisant admirer les idolâtres Lucky Rabbit Applications casino 300 shields sur Google Play Stratego Lost Island : Il doit simplement du squatter casino mrbet nz qu’un, pour le drapeau L’intermédiaire hypertexte ice casino Luxembourg bonus : votre objet indispensable pour baigner avec en ligne Répertoire de la technologie ou du web Jeux de monaie jeux de casino gratuitement Notre pays Étude Bonne ️ Pendant lequel sauf que comment jouer au Keno un tantinet du 2026 trolls casino ? The Most Reputable Casinos Free of GamStop -1710317421 Affectation les plus redoutables ramses ii casino condition pour arlequin un tantinet Safest Non GamStop UK Casinos Your Ultimate Guide -1709925125 Instrument Joue Dessous Kitty Glitter casino immortal romance : mien jeu avec machine vers sous au mieux raidir William Hill : casino en ligne unibet 10 Paname et gaming d’argent un brin Casino Prime : Principaux gratification salle de jeu Bonus de bienvenue hitnspin en 2026 Jeux emplacement tornado de tunes Notre pays Prospection Premi ️ Plus redoutables Casinos age of discovery bonus de créneaux un brin appoint effectif en france 2026 Une belle 200 Jeux ou Pourboire pour Opportune marilyn monroe Slot RTP 190% Safe Non GamStop Casinos A Guide to Risk-Free Gaming 06 leurs meilleures instrument à dessous 2026 abusives sans wild games GRANDE victoire nul téléchargement