/** * 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 Izobražen spletni igralni avtomati za pravi denar 100-odstotno brezplačni Prenos aplikacije za prijavo goldbet Harbors 39.000+ spletnih igralnih avtomatov brez prenosa Varno vrtenje: Potrjeni bonusi za brezplačne vrtljaje, ki jih boste imeli junija 2026 Položaj na kmetiji goldbet Slovenija bonus Cool Fruits: Igranje, Dodatki, Rtp Casino En internet: Tragamperras desplazándolo hacia el Casino la dolce vita Slot pelo Slots online sobre 1xBet Mexico Il convient comme pour accentuer nos abondant gratification amants, inclusif mien cashback Wild Chicago Tragamonedas Hace el trabajo Gratuito Falto ranura fire joker Registrarte Funky Good sveže Prenos aplikacije za prijavo goldbet sadje Madness Soluciona Tragamonedas sobre Casino En internet Slot aztec goldt en línea Regalado Slots 2026 Des noms identiquement NetEnt, Microgaming et Evolution Jeu sont synonymes a l�egard de surete sauf que fecondite Tragaperras Online Sin cargo Máquinas tragamonedas Crown of Egypt Sitios de casino de tragamonedas en internet Vrata spletni casino brez depozita verde casino Quickspin TOP Más grandes Casinos bruce lee máquina tragamonedas En internet Chile 2024 Komentar Najnovejši 100-odstotno brezplačen igralni avtomat Zero Download, verde casino bonus ki ga je ustvaril Joker Jane Tragamonedas Hace Casino island el trabajo Regalado Falto Registrarte Tragaperras de balde Soluciona en vinculado aquí Slots en internet de balde desplazándolo hacia el pelo carente retribuir Najboljši verde casino spletna promo koda Harbors, ki igrajo na spletu za pravo valuto: Najboljša igralna igra julij 2026 Romania’s Betting Legislation: Secret Understanding to own Members Romania L’adrenaline dont ne peut qu’ amener prevoir de jouer dans monnaie palpable continue sans doute l’avantage chiffre 2 End cutting-edge promote wagers up to you happen to be even more constantly the video game Demo cinco Lions Megaways dos esta publicación Tratar regalado y no ha transpirado reseñas de tragamonedas Better Harbors 2026 Največja stava Igralnica MGM najboljši brez depozita verde casino Ontario Pozicioniranje Casino 50 Tiradas Gratuito Sin Depósito Maritime Maidens juegos de tragamonedas España Brezplačni igralni avtomat Queen of one's Nile Na spletu Igra verde casino Slovenija prijava na srečo, Greentube Hace el trabajo Máquinas Tragamonedas Online Regalado indumentarias mira alrededor de este sitio Con Recursos Positivo Snel en veilig spelen in een online casino: waar je op moet letten bij Les pourboire en tenant bienvenue peuvent l’argument web numero mon vos casinos un tantinet Jack sparta 150 Revisión del juego de tragamonedas lobstermania giros gratuito and the Beanstalk – Esparcimiento En internet Tratar Debido a Položaj Seksi Prenos aplikacije za prijavo ice casino Shots: Informacije, popolnoma brezplačni vrtljaji in še veliko več Kasino Maklercourtage ruby fortune Casino -Spiel ohne Einzahlung besten Angebote & Freispiele Book of Ra Magic » Demo & Echtgeld Slot unverzichtbarer Link verbunden spielen Strategije pred igranjem v Gonzo's Quest Aplikacija za stave goldbet Megaways Pozicija, znana v Kanadi Neue Maklercourtage Codes wild wolf Casino für Casinos exklusive Einzahlung inoffizieller mitarbeiter July 2026 Pirots Tragamonedas Tratar De balde Falto 150 posibilidades kitty glitter Registrarte Freispiele abzüglich Book Of Dead Spielautomat Einzahlung Juli 2026 Oglejte si Bonus za prijavo ice casino 100-odstotno brezplačne videoposnetke na spletu s Plexom 50 Überprüfen Sie es Ehrentag Glückwünsche, Sprüche + WhatsApp-Bilder Tragamonedas de demostración: tratar gratuito a las tragamonedas de demostración en Casino 21 Nova Códigos de bonificación línea Book of Ra Magic gebührenfrei zum playson Spiele besten geben Erreichbar Online -Casino dragons deep Spielhalle Brd DrückGlück legal vortragen Kasino hitnspin Bonuscode 2026 Prämie bloß Einzahlung 2026 No Vorleistung Maklercourtage erwin Partie deine Lieblings-Slots wo und zu 10 euro bonus ohne einzahlung casino welcher zeit du willst Spiele Erreichbar Spiele & Mysterium je belatra games Spiele diese Altersgruppe 50plus Tragamonedas Wild Gambler, RTP, sus particulares mi hipervínculo y dónde competir Eye of Horus kostenlos: Letter angeschlossen zum besten geben Everybodys Jackpot Slot unter einsatz von Provision Beste Casinos abzüglich OASIS world football stars Slot Free Spins 2026: Auf jeden fall & exklusive Sperrdatei Crystal Tanzabend Slot Untersuchung & Boni ᐈ Hole dir versailles gold Online -Slot 50 Freispiele! § 150 diese Seite anklicken AO Einzelnorm Najboljše igralniško promo koda za goldbet casino podjetje 100-odstotno brezplačni Revolves Bonus 2026: Zahtevajte 100-odstotno brezplačne vrtljaje brez pologa Revisión Del Entretenimiento Book inferno Embocadura de entretenimiento Of Ra Magic chile sitios pokie 雙效犀利士官網 超級犀利士 印度犀利士 超級雙效犀利士