/**
* 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;
}
}
casinobest22061 – tejas-apartment.teson.xyz
Skip to content
欢迎来到GOD55 Casino GOD55 Casino是一个在全球范围内迅速崛起的在线博彩平台。通过提供各种博彩游戏,如老虎机、桌面游戏和体育博彩,GOD55 Casino确保每位玩家都能找到适合自己喜好的游戏。此外,平台还提供了全面的安全保障和卓越的客户服务,赢得了许多玩家的信任。考虑到在线赌球的安全性,您可以访问GOD55 Casino god55可靠吗了解更多信息。 丰富的游戏选择 在GOD55 Casino,玩家可以沉浸在多样化的游戏体验中。无论你是热爱经典老虎机,还是喜欢策略丰富的桌面游戏,GOD55都能满足你的需求。平台提供的游戏种类包括: 老虎机:多种主题和风格的老虎机游戏,用户可以享受快速的娱乐体验。 桌面游戏:包括赌场经典如扑克、二十一点和轮盘。 真人荷官游戏:让你体验到身临其境的赌场氛围。 体育博彩:让你在重要赛事中下注,增强观赛的乐趣。 安全可靠的博彩环境 安全性是GOD55 Casino的首要任务。平台采用先进的加密技术,确保玩家的个人信息和财务细节都得到有效保护。GOD55 Casino持有合法的博彩许可证,遵循相关法律法规,从而确保所有游戏的公平性和透明性。每位玩家都可以享受到一个安全、公正的博彩环境。 卓越的客户服务 GOD55 Casino不仅仅注重游戏体验,其客户服务团队同样卓越。平台提供24/7的客户支持,旨在解答游戏过程中的任何疑问。无论你是在注册、存款、提款还是遇到技术问题,专业的客服团队都会迅速帮助你解决困扰。此外,GOD55还在其官网上提供了详尽的常见问题解答,便于帮助用户自行解决常见问题。 多种支付选项 GOD55 Casino提供多种便利的支付方式,让玩家可以轻松存款和提款。支持的付款方式包括信用卡、借记卡、电子钱包和银行转账等。平台致力于付款极速和安全,确保每一位玩家都能顺利进行交易。此外,提款也很迅速,通常在几个小时内即可到账。 优惠活动与奖励 GOD55 Casino定期推出各种优惠活动,吸引新用户并奖励忠实玩家。通过注册,玩家可以获得丰厚的欢迎奖金,而日常、周末或节假日的特别活动也让玩家可以赢取额外的奖金和奖励。这些优惠不仅增加了游戏的乐趣,还提升了玩家的整体博彩体验。 移动博彩的便利性 随着移动设备的普及,GOD55 Casino也特别优化了移动平台。无论你身处何地,玩家都可以通过手机或平板随时访问网站,享受随时随地的博彩体验。移动平台涵盖了几乎所有桌面游戏,为玩家提供与电脑端相同的游戏体验。 社区与社交博彩 GOD55 Casino不仅仅是一个个人博彩平台,它还努力构建一个玩家社区。在这里,玩家可以分享游戏经验、交流技巧和参与社区活动。社交博彩也逐渐兴起,玩家可以通过与朋友分享链接或邀请加入,来增加奖金和奖励。这种社交元素使得博彩体验更加丰富多彩。 结论 GOD55 Casino凭借其多样的游戏选择、安全的博彩环境和卓越的客户服务,正在成为在线博彩行业的佼佼者。无论你是新手玩家还是经验丰富的老手,GOD55 Casino都能为你提供优质的博彩体验。探索这里的游戏,享受安全的娱乐,并体验独特的社交博彩乐趣,立即加入GOD55 Casino,开启你的博彩之旅吧!
GOD55 Casino:探索终极在线博彩体验 Read More »
Selamat datang ke dunia 12play sports 12play login sukan yang mendebarkan! Di sini, kami akan meneroka pelbagai aspek dunia pertaruhan sukan dalam talian dan bagaimana anda boleh menjadi pemain yang berjaya di 12play Sports. Pengenalan kepada 12play Sports 12play Sports adalah salah satu platform pertaruhan sukan yang paling popular di Asia Tenggara. Dikenali kerana antaramuka
12play Sports Menjadi Pemain Terbaik di Dunia Sukan dalam Talian Read More »