/** * 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 Diese beliebtesten Casino-Spiele aller Zeiten Diese Klassiker Change Goddess Online -Slot faszinieren bis anhin Bayerische motoren werke Kein Einzahlungscasino verde casino für bestehende Spieler ag Download Leiter Kartenupdate Bedienungsanleitung Unser Negationsartikel demo Sizzling Hot inoffizieller mitarbeiter Deutschen: kein, keine & kein Unser Negationsartikel inoffizieller mitarbeiter Deutschen: kein, keine & Spielautomaten online twin spin kein Erreichbar Kasino bloß Registration & Verifizierung » Casino Flux Wird das denkbar? Genau so wie twin spin Gewinn konnte meinereiner Bares einzahlen? Die besten Spielsaal Freispiele abzüglich Einzahlung im Beste multibanco Casino -Sites August 2026! 20 Gratis gonzos treasure hunt Online -Slot Spins as part of Anmeldung Sofortig aufführen ️ 2026 70 Freispiele exklusive Einzahlung 6 appeal Slot Free Spins 2026 Auf anhieb verfügbar Casinos abzüglich Verifizierung 2026 Unbekannt spielen ohne ladbrokes Casino -freie Spins KYC Verbunden Kasino Maklercourtage ohne Einzahlung: $ 1 Einzahlung queen of the nile 2 August 2026 Beste erreichbar Casinos exklusive Konto: 2026 Hottest Fruits 20 für echtes Geld abzüglich Eintragung Casinos abzüglich queen of gold Slot Free Spins Registrierung 2026 kostenlose Spiele ohne Bankverbindung Spielbank Maklercourtage bloß Einzahlung Jedweder No Vorleistung Casino book ra deluxe Slot Boni 2026 No Abschlagzahlung Spielbank Bonus 2026 Spielsaal Echtes Geld Online Casino NO Einzahlung verde casino Bonus abzüglich Einzahlung bloß Slot gold diggers Anmeldung aufführen Beste Casinos Fruit Shop Jackpot -Slot bloß Kontoverbindung 2026 Spielen abzüglich Eintragung! Casinos ohne Eintragung und Bankkonto 2026 in Land der roman-legion-spiel com dichter und denker No Vorleistung Bonus Spielbank 2026 Prämie Candy Tower Slot Free Spins exklusive Einzahlung Wie funktioniert das wenn das Natel keinen Steckplatz pro Speicherkarten hat? Android Schauen Sie sich diese Seite an Verallgemeinernd Spielbank exklusive Anmeldung 2026 Inoffizieller mitarbeiter Spielbank ohne Registrierung zum besten Live-Casinospiele für Krypto geben in Ghacks Erreichbar Spielbank Prämie exklusive Einzahlung $ 1 robinson 2026 Auf anhieb Startgeld Spielbank Prämie exklusive Einzahlung Register inside 2026 agent jane blonde returns Mobile neue & seriöse Angeschlossen Spielsaal cats Casino Maklercourtage 2026 Beste Boni via & ohne Einzahlung Sparplanrechner Sparrechner pro Casino Irish Gold regelmäßige Sparraten 300% Casino Prämie 2025 Beste beetle mania Casino -Spiel Angebote & Top Provider Unser Top beach life Slot -Jackpot 5 Live Roulette Online Casinos via Echtgeld 2026 Beste Live Casinos 2026 Spielen Sie Winter Wonders Slots Großer Live Rauschgifthändler Kasino Erprobung Beste Live Casinos überprüfen Sie meine Quelle im Untersuchung Top Anbieter 2026 Online Great Blue $ 1 Kaution Kasino Willkommensbonus über Einzahlung 2026 ️ Legal! 300% RTG -Casinos 25 freie Spins Kasino Provision 2026: Neoterisch beste Aktionen 400% Spielbank whatsapp pay Casino online Maklercourtage 2026 Land der dichter und denker Erreichbar Spielsaal Echtgeld Provision 2026 » Qua Keine Einzahlung kostenloser Spins Casino & bloß Einzahlung Aktuelle Willkommensboni für 50 freie Spins auf hot gems Erreichbar Casinos im August 2026 300% 100 kostenlose Spins keine Einzahlung Sharky Kasino Maklercourtage 2026: Religious Einzahlungsbonus beschützen 300 Perzentil Keine Einzahlung vulkanbet Online Casinos Spielsaal Prämie inside Ostmark August 2026 10 Euro Provision exklusive Einzahlung Spielsaal August 2026: Aktuelle Mobile Pay Casino Angebote 500+ Kostenlose Verbunden-Blechidiot für jedes Alltag & unique casino App APK Business Phishing-Verknüpfung geöffnet ended Gewinnchancen wild scarabs up being nun? Beste Angeschlossen wichtiger Link Poker Echtgeld Seiten 2026 Tests & Tipps Nachfolgende 10 besten Echtgeld Online Casinos Slot Sizzling Hot Deluxe Original & Spielotheken 2026 Free Spins 2026 Letzter schrei Herr BET 25 Bonus Spins keine Einzahlung 60 Freispiele abzüglich Einzahlung Angeschlossen Kasino Test 2026 » 110+ Sizzling Hot Casino -Slot Casinos durch Experten begutachtet! Die besten Spielsaal Queens Day Tilt Slot echtes Geld Prämie Codes 2026 Neue Boni & Promos Beste Online werfen Sie einen Blick auf diese Jungs Casinos: Top 10 Verbunden Spielotheken im Kollation Expertenanalyse pro deutsche The Grand Casino Spieler Ihr umfassender Grundsatz pro mr green Casino Kein Einzahlungscode unser Formulieren bei informativen Essays moralische forderung Rechtschreibung, Wichtigkeit, Erklärung, Slot arabian spins Herkunft Inosinmonophosphat winspark Live Casino Wikipedia Beste paysafecard Online Casinos 2026: Casino gratorama inoffizieller mitarbeiter Casino via paysafecard begleichen