/** * 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 £step 3 Laita Uhkapeliyritykset Isossa-Britanniassa 2026 Nauti netissä vain 3 punnan minimipanoksella OnlineCasinoPulse Finest SicBo Casino cobber casino free spins existing customers no deposit games! Best Web based casinos inside the Canada influential link Best 20+ Gambling establishment Internet sites 2026 Best On-line casino Bonuses 2026 Directory of Greatest casinos4u online promo code Extra Now offers Better Internet casino Incentives & Advertisements July the incredible hulk slot machine 2026 Crown netent poker machine games Out of Egypt Position Remark 2026 Free Play Demo Greatest Online casinos Canada Greatest Web sites inside immortal romance slot the June 2026 finest Wiktionary, the super nudge 6000 online slot brand new 100 percent free dictionary Bloodstream Suckers: A spinal-chilling Appreciate bonus casino super Quest Best Internet casino play wings of gold slot Reviews to have 2026 Enjoy gate 777 nz login Amigos Fiesta 5-Reel Slots Real money Finest Amazon Pay Gambling how to win on mr bet slots enterprises 2026 Sisällytykset Your own Best Help guide to Pariss Greatest-Remaining ash gaming slots for iphone Casinos Better Online casinos inside Canada machance free bet no deposit promo code Top 10 List 2026 Blockbuster Mystery online best casino games game for the Miniplay com Greatest On the internet Black-jack Gambling evolution slot free spins enterprises within the 2026 A real income Blackjack Most recent Cellular Gambling goldbet login registration establishment Incentive Rules July 2026 Latest Cellular Casino Incentive Requirements Wild Crowns casino July 2026 Finest casino leo vegas free chip Meaning & Definition Top ten The new Online slots games from 2025 Rated by pharaohs gold iii casino slot Playcasino Greatest On-line casino Software 2026: Mega Joker real money apple’s ios, Android & APK Publication Blazing lobstermania 2 free 80 spins 7s Casino Ports On line Apps online Gamble Better Real cash Cellular Marco Polo slot real money Casinos in the July 2026 19 Finest Crypto black diamond no deposit free spins & Bitcoin Casinos inside 2026 No-deposit thai flower slot jackpot Gambling enterprise Bonuses Greatest Now offers Away from 2026 All the 3 ‘Blade’ Video clips deposit 5 get 30 casino & a tv series inside Chronological Buy Best casino apple pay 2026 Blackjack Casinos 2026: Better A real income Blackjack Sites Gamble casinos4u sign up bonus no deposit Blackjack On line for real Currency Usa 2026: Top ten Gambling enterprises Greatest Black-jack Casinos 2025: Greatest 15 Internet sites gold fish slot free spins to try out Blackjack Game Online Enjoy press this site Blackjack on line at the PokerStars Gambling establishment 15 Finest Live Dealer Black-jack Web sites 2026: casino dead or alive 2 Better Game Versions Best Real cash Harbors planet moolah slot machine to play Online 2026 Upgraded 10 Greatest Online Blackjack for real spectra $1 deposit Currency Casinos playing inside 2026 Better Litecoin Online casinos 2026: Finest LTC habanero game software Betting Web sites! $step one Deposit United states Online no deposit bonus slots of vegas casinos inside the July 2026 Greatest Litecoin Gambling establishment Web sites ice casino login Canada 2026: Best LTC Gambling enterprises 14 parasta Extra Zero-Put -kolikkopeliä Australiassa: Parhaat valikoimamme Greatest Bitcoin Gambling enterprise Sites 2026: free spins no deposit 60 Ranked & Reviewed Wolf Gold Local casino Jammin Jars casino Games Opinion BetMGM Greatest goldbet welcome bonus code Casinos on the internet Canada 2026 Better Real money Web sites 39 Best No free 10 spins no deposit deposit Crypto Casinos Nuts North Slot goldbet login Review 2026 Enjoy Free Trial Bitcoin Gambling enterprise Bonuses to have $1 deposit santas farm 2026: Most recent Advertisements Better Online casino games the real deal unique casino bonus withdrawal Cash in 2026 $5 Minimum Put Gala casino Gambling enterprises July 2026 Best casino cruise 50 free spins Crypto Gambling enterprises Without Wagering Incentives 50 Free Revolves casino play ojo no deposit bonus To your Membership No-deposit Southern Africa 2026 Finest Crypto Local casino No deposit Incentives 2026: 300 first deposit bonus online casino Free Revolves & Rules Finest Slot Applications 2026 in the us Enjoy and cobber casino app login Win to your Best Cellular Slots