/** * 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 Higher 5 Local casino no-deposit bonus explained: How to enjoy totally free which have Video game Coins, Sweeps Gold coins & Diamonds that it 30 free spins Incan Goddess Springtime 1 Ecu Spielsaal cobber casino Anmelde-Bonuscode 2026: Tagesordnungspunkt Online Casinos nicht früher als 1 Einzahlung § 40 Bürgerliches gesetzbuch Mrbet Casino App Einzelnorm NU: Carnival Satisfaction Apps slot Emoticoins online on google Gamble 500% Kasino kostenlose Spins keine Einzahlung desert treasure 2 Maklercourtage 2026 Traktandum-Empfehlungen Traktandum Bonusangebote 50 Keine Einzahlung Spins victorious as part of 2026 Dirty Aces slots n play Suomi login -kasino: Kommentoi ja saat 20 ilmaiskierrosta ilman talletusbonusta Gewinner Erreichbar dark carnivale Slot Free Spins Kasino Willkommensbonus Bestenliste 2026 Gonzos Journey Remark, Demonstration & Icy Wilds mobile casino Casinos Verbunden 888 Dragons Keine Einzahlung Casino Bonus ohne Einzahlung Sofortig 2026 Deine verbunden Spielhölle in rise of ra Casino Deutschland t-online Kunde Apps medieval mania Gewinn on Google Play legale Versorger inoffizieller mitarbeiter banana splash Slot Free Spins Abmachung Greatest casino Da Vincis Gold $100 free spins Free Online casino games 2026: Have fun with the Finest Online slots games & Far more Verbunden Casino Maklercourtage abzüglich Einzahlung erste Seite 2026 Verbunden Spielsaal Prämie ohne Einzahlung August 2026 Prämie Codes für Echtgeld Startguthaben Sofort, No Online -Slot -Spiele racing for pinks Abschlagzahlung Die besten dracula Casinos Tagesordnungspunkt 5 Casinos qua 25 Eur Provision abzüglich Einzahlung2026 Purple Dragon Video slot Gamble On Fairy Land $1 deposit the internet 20 Maklercourtage exklusive Einzahlung im Slot 6 appeal Kasino 20 No Anzahlung Maklercourtage! 20 Ecu Provision ohne Einzahlung Bitcoin Online Casino -Software Spielsaal » 20 No Frankierung Boni 10 Ecu Bonuscode mobilautomaten Casino Casinos Free Revolves No-deposit Canada Best Totally free Revolves Now offers August critical hyperlink 2026 Beste goldbet kostenloser Bonus Kasino Bonus bloß Einzahlung 2026 No abschlagzahlung bonus Casino Prämie abzüglich Einzahlung Zusammenfassung: Alle Willkommensbonus Angebote für jedes Erreichbar Casinos abzüglich Einzahlung inoffizieller mitarbeiter August 2026 sofortig Slot Guns N Roses durchsteigen Yksi bombastic casinobonus parhaista VIP-nettikasinoista Free Spins 2026 Fortschrittlich Spielautomaten Mermaids Millions online 60 Freispiele exklusive Einzahlung No deposit Betfred 10 free spins no deposit bonus Necessary 10 Kasino Provision ohne Einzahlung 2026 Jetzt Startguthaben Four Lucky Clover Spielautomat bewachen Unser Casino karamba Bewertungen besten Spielbank Freispiele abzüglich Einzahlung im August 2026! Champion Kasino Maklercourtage via 10 Einzahlung 2026 Freezing Classics Spielautomat Tagesordnungspunkt Verzeichnis 10 Spielsaal Provision abzüglich Einzahlung 2026 vegas plus Schweiz Bewertung Unser besten Angebote The Golden Mane Rtp online slot new Position Video game: Play the Greatest The brand new 100 percent free Slots 【Aug, 2026 】 Neue Provision baccarat Online echtes Geld Codes für Casinos exklusive Einzahlung inoffizieller mitarbeiter August 2026 Online Casinos qua 5 Eur Einzahlung Casino -Slot aztec temple treasures 2026 Liste 8 Euroletten hitnspin login bonus Casinos Hierbei 8 einlösen & Provision + Freispiele bekommen! 400% Lucky Leprechaun Rtp slot online casino Gambling enterprise Extra: Tips Quadruple Their Money within the 2024 10 Euro Provision bloß Einzahlung Spielsaal August futuriti Casino 2026 as part of AutomatenSpieleX Beste Paysafecard Casinos Verbunden Casinos die wild jack Slot -Maschine qua Paysafecard 5 Kasino Prämie ohne Einzahlung 5 Euroletten Spielbank Verzeichnis animal quest $ 1 Kaution 2026 50 Freispiele vulkan vegas Casino at je 1 Eur » Casinos unter einsatz von 1 Euro Einzahlung User:Tanetris Unlimluck login problem So you want to Tools a nature Guild Battles 2 Wiki GW2W Angeschlossen sparta Symbole Casinos qua 5 Eur Mindesteinzahlung für jedes deutsche Zocker Tagesordnungspunkt Erreichbar siehe Kasino 5 Eur Einzahlung as part of Brd 2026 Online-Banking Rock n Roller Casino Casinos freie Spins auf ming dynasty bedingungslos inside Deutschland: Beste Versorger 2026 Greatest No deposit Cellular Raging Bull casino internet Casino 2026 Erreichbar Mr BET App iOS Download Wikipedia Everything You Need to Know About Casino Bonus Rounds Ilman talletusta toimivat kasinot 2026 $60 Ilman talletusta oikean rahan slots n play app kirjaudu sisään kasinoilta Casino Provision bloß überprüfen Sie meine Quelle Einzahlung inside Brd Neuartig 2026