/**
* 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;
}
}
gembet1061 – tejas-apartment.teson.xyz
Skip to content
Gembet Betting: Panduan Lengkap untuk Pemain Malaysia Dalam dunia perjudian dalam talian, Gembet Betting muncul sebagai salah satu platform yang menarik perhatian ramai. Dengan pelbagai jenis permainan dan peluang untuk memenangi hadiah yang besar, Gembet Betting Gembet Malaysia menawarkan pengalaman yang tidak terlupakan untuk semua peminat taruhan. Dalam artikel ini, kita akan membincangkan pelbagai aspek […]
Gembet Betting Panduan Lengkap untuk Pemain Malaysia -773025183 Read More »
Gembet Casino:探索线上赌博的魅力 Gembet Casino是一个在全球范围内备受欢迎的线上赌场,Gembet Casino gembet link提供多种游戏和绝佳的用户体验,让每位玩家都能找到适合自己的娱乐方式。无论你是新手玩家还是经验丰富的赌徒,Gembet Casino都为你准备了令人兴奋的机会和丰厚的奖励。在这篇文章中,我们将深入探讨Gembet Casino的各个方面,包括游戏种类、奖金和促销活动、支付方式以及客户支持等。 丰富的游戏选择 在Gembet Casino,玩家可以享受到各种各样的游戏,涵盖从经典的老虎机到众多桌面游戏,甚至还有实时赌场体验。我们的老虎机种类繁多,包含了多款热门游戏,每一种都有其独特的主题和玩法。这些游戏不仅具有高质量的图形和音效,还提供了令人兴奋的奖金特性,确保每位玩家都能享受到刺激的游戏体验。 对于爱好桌面游戏的玩家,Gembet Casino同样提供了多种选择。经典的扑克、轮盘和二十一点等游戏,都可以让你在家中也能感受到现场赌场的热情。此外,我们还提供了实时赌场游戏,由专业的荷官进行直播,让你能够与其他玩家和荷官进行互动,提升了游戏的乐趣和社交性。 丰厚的奖金和促销活动 Gembet Casino非常注重回馈玩家,提供多种奖金和促销活动。新注册的玩家将享受到丰厚的欢迎奖金,这通常包括存款匹配和免费旋转等优惠,使你在初次充值后能够获得更多的游戏资金。此外,我们定期推出各种促销活动,如节日庆祝活动、忠诚计划和会员专属优惠,保证玩家们在每次游戏时都有新的惊喜。 每周和每月的奖金活动也会为会员提供额外的机会,比如重载奖金和现金返还,玩家可以在游戏中获得更大的收益。这些促销活动不仅使游戏更具吸引力,还增强了用户的粘性,鼓励玩家们频繁回到Gembet Casino体验更多乐趣。 安全的支付方式 在现代博彩环境中,安全性是每一位玩家关注的重点。Gembet Casino采用了先进的加密技术,确保用户的个人信息和财务数据安全无忧。我们支持多种支付方式,包括信用卡、借记卡、电子钱包和银行转账等。这些选项方便玩家根据自己的需求选择适合的支付方式。 取款过程同样简单快捷。Gembet Casino确保玩家在申请提款时能够及时处理,大多数情况下,提款会在24小时内完成,使玩家能够尽快享受到他们的 winnings。我们也确保所有的交易都是透明的,玩家可以随时查看自己的账户历史,保证公平交易。 卓越的客户支持 在Gembet Casino,我们了解每位玩家可能会有问题或疑虑,因此我们建立了专业的客户支持团队,随时准备提供帮助。客户支持团队通过多种渠道提供服务,包括电子邮件、电话和在线聊天,使你能以最便捷的方式获得帮助。不论你在游戏中遇到任何技术问题,或是对账户和支付有疑问,我们的客服都会第一时间答复你。 此外,我们的FAQ部分同样提供了丰富的信息,涵盖了常见的问题和解决方案,帮助玩家快速找到所需的信息,让你的游戏体验更加顺畅。 结论 Gembet Casino凭借其丰富的游戏选择、丰厚的奖金、便利的支付方式和卓越的客户支持,成为了线上博彩市场中的佼佼者。无论你是想要追求刺激的老虎机游戏、享受桌面经典游戏,还是体验真实的赌场氛围,Gembet Casino都是你的最佳选择。立即注册,体验这场线上博彩的精彩旅程吧!
Gembet Casino:探索线上赌博的魅力 Read More »