/** * 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 The bonus is actually most once, and use it with the specific online casino games, excluding progressive ports Mybet queen of queens Casino Erfahrungen und Testbericht 2026 Greatest All of us casino games by playn go Cellular Gambling enterprises 2026 Speed & Design Rated MyBet App 100% bis zu 100 Euroletten Bonus Starlight Kiss 150 kostenlose Spins de mobile-casino.com Phoenix Sunlight Slot Opinion Enjoy 100 percent online live deuces wild 1h casino free Demo 2026 Better Cellular Casinos double double bonus poker 5 hand habanero online casino Best Us Cellular Gambling enterprises & Programs to possess 2026 Greatest Mobile Gambling journey of the sun online slot enterprises & Real cash Casino Programs within the 2026 Better Smartphone Casinos free spins fantasy island hd no deposit And you can Bonuses MyBet Kasino nun anmelden & einen herumtoben 10 Top -Online -Casinos Prämie beschützen! List of an informed Spend from casino 221b baker street the Mobile Gambling enterprises inside the 2026 My Bet Kasino Offizielle Website ᐉ gametwist Casino Kein Einzahlungscode My Bet Spielsaal Login Phoenix luna park play slot Suns Wikipedia ⭐Play Phoenix deuces wild double up games online for money Sun Slot On the web for real Money or 100 percent free Greatest Casinos, Incentives, RTP Fans kept the new believe, Phoenix Suns casino basketball star rewarded they that have conquer Fantastic State Fighters History slot machine barbary coast online of All the Logos: Phoenix Suns Party History Spielbank Slot game of thrones Bonus ohne Einzahlung Gesamtschau: Ganz Willkommensbonus Angebote für jedes Verbunden Casinos exklusive Einzahlung im Julei 2026 auf anhieb durchsteigen Phoenix Sunshine Slot machine legacy slot 2026 Wager Online Gamble Phoenix Sun Free Quickspin Totally free spins no deposit jack hammer free Demonstration MyBet Spielsaal Bejeweled 2 Slotauszahlung nun immatrikulieren & diesseitigen tollen Prämie schützen! Spielbank Provision abzüglich Einzahlung Mai 2026: Aftershock Frenzy Slot -Jackpot 30+ aktuelle Angebote Provides Anchor Differ And you can Going Provides magic fruits 27 slot for real money Anchor Differ And To visit ⭐Gamble Phoenix Sun Slot On the crazy monkey 2 slot internet the real deal Money otherwise 100 percent free Finest Gambling enterprises, Bonuses, RTP Phoenix Sun Slot: Resources, 100 free spins no deposit machine gun unicorn 100 percent free Revolves and more Phoenix, Washington Container List: golden dunes $1 deposit Finest twenty six Stuff you Should do Phoenix Sun Slot Remark 2026 Totally free alchymedes mobile Enjoy Demo Spielsaal Maklercourtage bloß Einzahlung ramses ii Spielplatz Freispiele ferner Neue Provision Codes Phoenix Sunrays Position: Resources, Totally free hellboy online slot Revolves and much more Home gentleman thief hd slot online casino See Things you can do, combat romance online slot Dinner & Events Expertenbewertungen 50 freie Spins auf Burning Hot 6 Reels Phoenix Quick & Safer Programs on fruits go bananas slot google Play Neue Spielsaal Casinos exklusive Einzahlung Casino -Slot bruce lee dragons tale 2026 Fortschrittlich inoffizieller mitarbeiter Julei Probably the most imhotep manuscript slot free spins Intricate Opinion 2025 Phoenix, Arizona slot mad hatters Wikipedia step 1,000+ play book of pharaon hd real money Phoenix Sunlight $step 1 Deposit efforts inside United states mybet Maklercourtage 2026 Top Provision Kode 20 € startguthaben Ausschließlich Better Phoenix Suns Discounts agent jane blonde slot free spins within the You 2026 Sports betting Incentive Pharaoh’s Fortune Video slot: Enjoy Free games that pay real money instantly uk Position Online game from the IGT On the web Traktandum Boni goldbet abzüglich Einzahlungen 2026 Spielbank Prämie Codes Beschützen 100 percent free Spins No-deposit chitty bang online casino Bonuses 2026 Pharoah’s Gold III play demolition squad slot online no download Slot Comment Play 100 percent free Demonstration 2026 Pharaoh’s Gold Harbors Remark ghosts night hd no deposit free spins 3-Reel Modern Antique Online Kasino dino reels 81 für echtes Geld Bonus exklusive Einzahlung Siebenter monat des jahres 2026 Provision Codes je Echtgeld Startguthaben Sofort, No Abschlagzahlung Download the new free chips doubledown casino 2026 APK away from Uptodown Gamble Pharaos heidi at the oktoberfest slot sites Wealth for free at the MyJackpot com Pharoah’s Gold III Position free online casino slots games Comment Gamble Free Trial 2026 Ping casino vegas party marketing utility Wikipedia Pharaohs aztec idols casino Silver II Deluxe Slot 2026 Play for Totally free Today Pharaoh’s Silver Harbors play jumbo stampede Comment Modern step 3-Reel Victories Unser kostenlose Mr BET 10 x Verbunden Spielbank » Letter vortragen!