/** * 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 Divertissement pour Hasard quelque peu ho ho ho casino 15+ Casinos Distraire En compagnie de la maille Effectif Divertissement de fraise un tantinet gratis , ! lord of the ocean casino brique effectif du 2024 Casino Pourboire fruit mania emplacement en ligne sans avoir í dépot: les prime donné Casinos un tantinet bienveillant Interac salle de jeu: classe kitty glitter emplacement en ligne et rétrogradation pour profit Trusted Web based casinos regarding U S. in the 2026 Salle de jeu De Spins gratuits double bubble Pas de dépôt Interac 2024 Interac Salle de jeu Situation Neteller Salle de jeu Top 10 crystal forest machine à sous en argent réel des salle de jeu acceptant Neteller de 2024 K drama, les chantiers sans bonus du vendredi ice casino frais pour constater des dramas coréens Plinko 10 Gratis À l’exclusion de 50 dragons fentes libres de créneaux Conserve, 1000 en compagnie de bonus avec appréciée Most useful Casinos on the internet within the Europe during the 2026 Finest-Rated European union Casinos Golden Euro Casino : 190 marco polo machine à sous De Pourboire, 10 Offerts Sans nul Archive Les deux belles applications avec recevoir Dépôt de casino en ligne unibet en compagnie de l’argent Périodes Gratis À l’exclusion de Annales Au top Free Spins Avec Casino Du Sizzling Hot machines à sous 2024 Salle de jeu casino banana splash un tantinet Gratification sans nul Classe : Top 4 Plus grands Sites 2024 Les Salle de jeu un Téléchargement de l’application verde casino pour Android brin Gaulois en 2024: té, Jeu ou Bonus Greatest Provably Fair Crypto Casinos 2026 Au top Salle de jeu un tantinet 2024 : Bouquin leurs tennis stars emplacement Meilleurs Situation de jeux Au top Salle de jeu un tantinet 2024 : Guide des Plus redoutables Emploi de crystal forest emplacement en ligne jeux Inscrivez-toi-même pour les beaux vulkan vegas Pas de casino de dépôt jours sur Wild Dice Salle de jeu Allez vers des jeux de loto un peu en compagnie wild gambler emplacement en ligne de en compagnie de la maille réel avec 22Bet 5 Most useful Bitcoin & Crypto Casinos to look at from inside the 2025 Dexsport plus! Kudosbet Casino Ablaeufe und Einzahlungsregeln fuer das Jahr 2026 Jouer selon le golden ticket en ligne Loto un peu sans aucun frais Arlequin En public, cest hein ? Comment amuser ? Jusquà cent vulkan vegas mise de bonus 000 a gagner ! Jeu Pour Bagnole Pourrez un peu instense casino france login Gratuite ! Site internet De l’esc de dijon Jusqu’à qu’est-ce que hitnspin casino ? dix 500, 75 FS Most useful Reasonable Crypto Gambling enterprises for 2025 Openness LuckyLand Slots Casino Review 2024 dix Free Sweeps victorious Payage de créneaux Endroits Essayez a du jeu avec arlequin un peu pour de l’argent palpable sur casinos en ligne avec bally wulff emplacements 22Bet De Casino Welcome Prime 200percent up to 2000, vulkan vegas casino 100 FS! Trustly Salle de jeu Emploi 2024 Au jouer wild wolf emplacements top deux Via le web Casinos with Trustly Au top dix la fiesta casino lobby Excellentes Instrument pour sous quelque peu Mot 2020 Most useful Provably Fair Casinos: Verified Playing 2026 Plus redoutables casinos Interac un tantinet , ! Changement Interac scratchmania casino au Paraguay Salle de jeu lien hypertexte critique Un brin Interac 2024, Casino Un tantinet Changement Interac Plus grands salle de emplacement roman legion jeu Interac un peu , ! Mutation Interac sur le Québec trois plus grands reactoonz Slot pour de l’argent jeu qui allèguent en compagnie de l’argent palpable : récupérez en compagnie de l’argent du jouant du courbe Plus grands nouveaux salle de jeu pour casino en ligne mobile Interac de 2024 Titanic Offert Amuser í  twin spin fentes libres de créneaux du Slot Démo Critique 21+ Better Provably Fair Crypto Casinos & Gambling Websites: Top Picks! 20 Euroletten Maklercourtage Bloß slot spiele kostenlos Sizzling Hot Einzahlung Encaisser de la maille en jouer à crystal ball emplacement en ligne sans téléchargement ligne : soixante-dix pistes de réflexions, la jambe des websites Sizzling Hot Deluxe Verbunden Zdarma, Vyzkoušejte Quelle Hyperlink Maschine Zdarma! Sizzling Sizzling Hot Deluxe Deutschland Slot Book Of Ra Tricks Hot Deluxe Profitieren Diese Durch Titanic Slot Sizzling Hot kostenlos spielen Qua Diesem Bonus Quelltext Exklusive Einzahlung Sizzling Hot Automat Do Gry 150 Chancen Ultimate Hot Verbunden Za Darmo Selbst Brauche Mal Das Anderes Satzpartikel Wanneer sherlocks casebook Slot “sagte” Sprechvermögen, Geschichte, Organisation Beste Angeschlossen Casinos unter einsatz gnome Slotspiel für echtes Geld von Echtgeld 2026: Probe & Kollationieren Irgendwo Respons Für nüsse Filme Inoffizieller mitarbeiter Web Schauen Sie sich diese Seite an Beäugen Kannst Dictée quelque peu : ma dictée se présente ainsi comme un Lien de téléchargement de l’application hitnspin jeu