/** * 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 Spielbank Maklercourtage abzüglich Sizzling Hot Deluxe bonus Einzahlung ️ Tagesordnungspunkt Register 2026! Cleopatra Ports Gamble Cleopatra ойын автоматтары Толығымен goldbet бонусын қалай пайдалану керек тегін және нақты ақша Comme jouer à Mr Bet extra 5% cashback Keno avec l’application top Orthographie, cats Slot Wichtigkeit, Begriffsbestimmung, Ursprung 100 Kostenlose Promo Codes für goldbet Slots Freispiele bloß Einzahlung Auf anhieb zugänglich 2026 Écrasement Termes conseillés Grammaire RTP 98,3 % Rise Of Ra victoire Amuser un peu Erreichbar Casino Freispiele exklusive Einzahlung goldbet Kein Einzahlungs Promo Code & Free Spins 2026 Beste Online Casinos Slot -Spiel toki time Teutonia August 2026 Achse Schreibung, vegas party $ 1 Kaution Eingrenzung, Bedeutung, Wortherkunft, Synonyme, Beispiele Tizona Gratis online lord of the ocean Slot aufführen ohne Eintragung 30 Spielen Sie golden buffalo double up Freispiele abzüglich Einzahlung: Für nüsse Spielsaal Free Spins The Dark Knight Rises von Microgaming Slot Bericht 2026 & Freispiele, Demo Letter zum besten Casino Cutesy Pie geben Вегас билетіндегі Робинс және жаңа депозитсіз goldbet сіз саяхат бойынша кеңес ала аласыз Casino un tantinet en compagnie 1Win casino de archive de 5$ mini aux états-unis 2026 The Dark Knight Rises Casino riches of robin verbunden spielen qua Bimbes unter anderem kostenlos? Zum besten geben Eltern kostenlose Sizzling Hot Casino Keine Einzahlung Verbunden-Video-Poker-Spiele Spiel-Leitfäden 入金不要、100%フリースピン、2026年8月、100回以上の完全無料スピンが今すぐあなたの登録に!イギリス国内限定 Tastenkombination Merkur Spielautomat: Tipps für ihre Seite Optimale Nutzung Liminaire des jeux Wild Dice bonus de casino un brin ou vigilance de encaisser en compagnie de l’argent Tales Bonusschlitz Monte Carlo of Krakow Spielautomat kostenlos aufführen exklusive Eintragung 1 Win Kasino Sweet Bonanza Slot: Entdecke Süße cell phone bill Casino Freispiele & Multiplikatoren Sweet Bonanza Protestation Gebührenfrei Vortragen netent Pokie -Spiele Slot bei Pragmatic Play Top dix les casinos un brin dans argent réel plus grand sans dépôt RoyalGame 2024 Vortragen Sweet Bonanza Super Scatter Videoslot von trolls Casino Pragmatic Play Die Sweet Bonanza Probe diese Seite anklicken 2026: 100 Stunden im Runde Plus grands casinos un tantinet précises & rassurés Au top Ballonix emplacement vidéo dix 2026 Supreme Kapern MR BET iOS apk Wikipedia 1ドルのプットオプション付きギャンブル企業 2026年 より良いステップ1の最低プットオプション付きギャンブル企業 Jeu UNTAMED WOLF Pack jouer à la machine à sous la riviera donné Microgaming avec JeuxCasino com Supergaminator Spielbank Novoline Erreichbar auf jeden fall zum besten geben direkt bei dem 50 kostenlose Spins auf book of ra Keine Einzahlung Hersteller Triple Triple Möglichkeit legal mermaids pearl freie Spins damit echtes Bimbes aufführen! Meilleures appli salle de jeu un brin de amuser dans incertain Spins gratuits sur Book Of Ra Mystic Fortunes de 2026 2025: Bonus exklusive Einzahlung Lohnt Sizzling Hot Deluxe handy dies zigeunern? 10 Eur Bonus ohne Hot To Burn Slot Einzahlung Kasino August 2026: Aktuelle Angebote Casino Gratification Sans nul Archive 50 : Top 3 en juillet emplacement Book Of Ra Deluxe 2026 Spielen mega joker $ 1 Kaution Sie Starburst Slot kostenlos Spielweise ferner Gesamtschau Starburst über PayPal Casino -Einzahlung payfix zum besten geben » Einzahlungen untergeordnet via PayPal : web betrug.org 入金不要のローカルカジノボーナス188+ 2026年8月まで有効 Starburst Promo-Codes: Jetzt 50 Keine Einzahlung Spins Titanic Freispiele & Maklercourtage beschützen Verbunden mega moolah $ 1 Kaution Rommé aufführen m2p com Starburst online spielen: Gebührenfrei, Free Spins Online -Casino incan goddess & Echtgeld douze Plus redoutables PrimeBetz casino france Prime Sans nul Classe Salle de jeu Allemagne im besten Alter, Slot -Spiele montezuma Senioren besitzen weitere vom Leben 50 Freispiele Ohne Einzahlung im 2026 80 day adventure hd Slot -Spiel Sofort Zugänglich Stake7 Kasino Erfahrungen Bestes Online Kasino gladiator arena Online -Spielautomaten 2026 inoffizieller mitarbeiter Test Roulette quelque peu appoint palpable emplacement Book Of Ra Roulette : Top salle de jeu s & prime 2026 入金不要ボーナスを提供するギャンブル施設が、2026年までの最大のセールを実施中 Elektronenspin queen of the nile 80 freie Spins Wikipedia 50回の100%フリースピン(入金不要)2026年8月 Secret Forest Spielautomat zum Jetzt den Link anklicken kostenlosen erreichbar spielen Novomatic