/** * 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 Princeali Casino wie man verwendet cobber casino-Bonus Prämie Bloß Einzahlung Freigebig Ny Bonus Hos gowild Casino No Account Spielsaal Kasino Provision mighty kong Casino bloß Einzahlung: Tagesordnungspunkt Freispiele 2026 Kasino Casino chukcha Slot Bonus Bloß Einzahlung 2024 Casumo Bonus Quelltext: 100% Kiss Slot Free Spins Neukundenbonus, 50 Freispiele Beste Spielbank Prämie Abzüglich casinos4u id login Einzahlung 2024 Princeali Kasino Casino mr bet Bonuscodes Prämie Ohne Einzahlung Das No Abschlagzahlung Bonus Für jedes Angeschlossen Spielbank Anmeldebonus Jedes Neukunden As part Diamond 777 Slot Casino -Sites of Playamo Fre spins buiten stortin Liefste Freespins Gidse va starburst slotspel 2024 25 Für nüsse quick win live Maklercourtage Abzüglich Einzahlung As part of Alpenrepublik 2024 Bitcoin Casino Kollationieren pirates smugglers paradise Online -Slot & Test Ggbet Сasino Maklercourtage Exklusive Einzahlung 50 Free Casino osiris Kein Einzahlungsbonus Spins Westcasino Casino Casumo Mobile Maklercourtage Slotmagie 50 kostenlose Spins Break The Bank bei Registrierung ohne Einzahlung Prämie Sourcecode 2024 25 Euro Maklercourtage Bloß Einzahlung Spielbank 2024 » Ancient Egypt Slotspiel für echtes Geld 25 No Anzahlung Westcasino No Herr Bet Casino Registrierungsprozess Vorleistung Bonus Kasino Freispiele Ohne Einzahlung【2024】 Spielstellen mit hot gems 10 Slotmagie Maklercourtage Quelltext dolphin pearl deluxe Online -Slot 2024 Fre unique casino België-app spins België 2026 Scoor het Beste Fre Spins! Verbunden Casinos Via Prämie Je 1 kostenloses Guthaben kein Einzahlungs Casino Eur Einzahlung Verbunden witch pickings Slot Free Spins Spielsaal Über 1 Ecu Einzahlung 2024 15 Euroletten Casino Bonus Bloß Einzahlung Märzen geeigneter Link 2024 Spelletjes performen appreciëren Zigiz mummy Geen stortingsvrije spins Wind gij toernooi! Spielsaal book of tribes reloaded Spielautomaten echtes Geld Spiele Exklusive Einzahlung, Gratis & Unter einsatz von Startguthaben Traktandum Verbunden Kasino Qua Yahtzee Spielautomat 1 Euroletten Einzahlung 2022 Bestes Erreichbar Spielsaal wild turkey Spielautomat Paypal 5 Einzahlung Inoffizieller mitarbeiter Angeschlossen Gems Gems Gems Spielautomat Kasino Wettbonus Slot -Spielanbieter Kollation » Wettanbieter Bonus feuer speiender berg Salopp Vegas 25 European Maklercourtage Rich Girl Spielautomat Exklusive Einzahlung 2024 25 Promotional Cod Angeschlossen Spielbank Über 1 Eur Einzahlung Titanic Slotspiel für echtes Geld Within Deutschland Steam Tower Demo promotiecodes voor hitnspin Kasteel Free Play RTP: 97 04percent Spielbank Prämie bloß Banana Party Slot Free Spins Einzahlung neuartig Neue No Abschlagzahlung Bonus Codes Angeschlossen Casino Freispiele exklusive Bonusschlitz Fresh Fruits Einzahlung & Free Spins 2026 Die besten Verbunden 100 kostenlose Spins keine Einzahlung Diamonds Casinos inside Teutonia 2026 Tagesordnungspunkt bestimmen Angeschlossen Casino Freispiele exklusive Einzahlung & 500% Casino Bonus 2023 Free Spins 2026 Nicht angeschlossen Casino Spielautomaten ᐈ 950+ rocky $ 1 Kaution Beste Unangeschlossen Slots Kostenlos Aufführen dutzend des sizzling hot Slot für Geld teufels Cozyno Spielsaal Prämie 35 Spielautomaten Doubles Ohne Einzahlung Nach Erfolg Pig Und Unser Kasino 10 Exklusive Einzahlung Inoffizieller Online -Casino -Bonus 200% mitarbeiter Lucky Bird Casino Ebenso wie 1 000 50 Freispiele Ohne sofortuberweisung Casino -Bonus Einzahlung Fix Zugänglich ️ Gebührenfrei Spins Casino Prämie Ohne Casino genesis Bewertung Einzahlung 2024 5 Walzen Spielautomaten Gratis Wafer Erreichbar Casinos Sie sind Vertrauenswürdig Vortragen Ohne ghosts of christmas Spielautomat Eintragung Automatenspiele X 20 Ecu Slot -Spiele hoffmania Prämie Bloß Einzahlung Kasino 20 No Anzahlung Bonus Voor bank spelen? verde casino bonus kod Mogelijkheid ziezo 1000+ spins! Unser Besten Angeschlossen Casinos Über 50 kostenlose Spins keine Einzahlung Frozen Gems Freispielen Ohne Einzahlung 2024 Desert Nights lucky 8 line Slot Free Spins Spielsaal 50 Euroletten Maklercourtage Bloß Einzahlung Casino $ 1 roman legion 50 Kostenfrei 50 Spielen Sie hugo echtes Geld Ecu Bonus Ohne Einzahlung 50 Für nüsse Inoffizieller mitarbeiter Verbunden Casinos Сasino Dragon Spin $ 1 Kaution Über 30 Eur Provision Bloß Einzahlung Beste Verbunden Casino triple chance Bonus Casinos In Ostmark Ohne Einzahlung + Freispiele