/** * 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; } } Public – Page 4 – tejas-apartment.teson.xyz

Public

Sterren aan de goktafel wie zijn de meest opvallende bekende spelers

Sterren aan de goktafel wie zijn de meest opvallende bekende spelers De aantrekkingskracht van bekende spelers De wereld van het gokken is altijd omringd geweest door een aura van glamour en opwinding, vooral wanneer bekende spelers in beeld komen. Deze sterren, vaak afkomstig uit de entertainmentindustrie of de sportwereld, brengen een unieke dynamiek naar de […]

Sterren aan de goktafel wie zijn de meest opvallende bekende spelers Read More »

Navigating legal regulations in the casino industry A comprehensive overview

Navigating legal regulations in the casino industry A comprehensive overview The Evolution of Casino Regulations The landscape of casino regulations has evolved significantly over the decades, reflecting changes in societal attitudes toward gambling. Initially, many forms of gambling were illegal or highly restricted, primarily due to moral concerns. However, as public perception shifted, states began

Navigating legal regulations in the casino industry A comprehensive overview Read More »

Stay safe online Essential personal cybersecurity tips for everyone

Stay safe online Essential personal cybersecurity tips for everyone Understanding Cybersecurity Basics In an increasingly digital world, understanding the fundamentals of cybersecurity is essential for everyone. Cybersecurity involves the protection of internet-connected systems from cyber threats. Personal cybersecurity is about taking steps to safeguard your personal information and devices from unauthorized access and attacks. Familiarizing

Stay safe online Essential personal cybersecurity tips for everyone Read More »

Miti e verità sui casinò cosa dovresti sapere per giocare consapevolmente

Miti e verità sui casinò cosa dovresti sapere per giocare consapevolmente I miti comuni sui casinò Quando si parla di casinò, molti miti e leggende circolano tra i giocatori. Uno dei più diffusi è che i casinò siano sempre a favore della casa. Sebbene sia vero che le probabilità siano progettate per garantire un profitto

Miti e verità sui casinò cosa dovresti sapere per giocare consapevolmente Read More »

Understanding the Complex World of Casinos A Comprehensive Overview

Understanding the Complex World of Casinos A Comprehensive Overview The Evolution of Casinos Casinos have a rich and diverse history, evolving from simple games of chance to sophisticated entertainment hubs. The roots of gambling can be traced back thousands of years to ancient civilizations, where rudimentary games laid the groundwork for modern casino culture. As

Understanding the Complex World of Casinos A Comprehensive Overview Read More »

Jugar en línea o en un casino ¿Cuál es la mejor experiencia

Jugar en línea o en un casino ¿Cuál es la mejor experiencia La emoción del casino físico Visitar un casino físico es una experiencia que despierta todos los sentidos. Desde el sonido de las máquinas tragamonedas hasta el bullicio de la gente, el ambiente es electrizante. En un casino, los jugadores pueden disfrutar de una

Jugar en línea o en un casino ¿Cuál es la mejor experiencia Read More »

Historias de éxito de jugadores profesionales en los casinos lecciones valiosas

Historias de éxito de jugadores profesionales en los casinos lecciones valiosas El camino hacia el éxito en los casinos Las historias de éxito en los casinos a menudo comienzan con un sueño y una estrategia bien definida. Muchos jugadores profesionales han dedicado años a perfeccionar sus habilidades en diferentes juegos de azar, desde el póker

Historias de éxito de jugadores profesionales en los casinos lecciones valiosas Read More »

Understanding the psychological triggers that lead to gambling addiction

Understanding the psychological triggers that lead to gambling addiction The Nature of Gambling Addiction Gambling addiction, often classified as a behavioral addiction, manifests when individuals develop an uncontrollable urge to gamble despite the negative consequences. This addiction can lead to significant financial, emotional, and relational distress. Understanding the nature of this addiction is crucial, as

Understanding the psychological triggers that lead to gambling addiction Read More »

Regulacije kockanja u Hrvatskoj Što trebate znati

Regulacije kockanja u Hrvatskoj Što trebate znati Povijest kockanja u Hrvatskoj Kockanje u Hrvatskoj ima dugu i složenu povijest koja seže unatrag stoljećima. U prošlosti su tradicionalne igre na sreću bile popularne u društvenim krugovima, dok su zakonski okviri bili slabo definirani. S krajem 20. stoljeća i pojavom privatizacije, došlo je do značajnih promjena u

Regulacije kockanja u Hrvatskoj Što trebate znati Read More »

Strategien zur effektiven Verwaltung deines Spielbudgets im Casino

Strategien zur effektiven Verwaltung deines Spielbudgets im Casino Die Bedeutung eines klaren Budgets Ein klar definiertes Budget ist der erste Schritt zu einer verantwortungsvollen Spielstrategie. Bevor du dich in die Welt der Casinos begibst, solltest du dir überlegen, wie viel Geld du bereit bist, auszugeben, ohne dabei deine finanziellen Verpflichtungen zu gefährden. Diese Summe sollte

Strategien zur effektiven Verwaltung deines Spielbudgets im Casino Read More »