/**
* 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;
}
}
Gembet Betting 体验最优质的在线投注平台 – tejas-apartment.teson.xyz
Skip to content
Gembet Betting:您的最佳在线投注选择
在现代互联网时代,在线投注已经成为一种流行的娱乐方式。无论是热爱体育的玩家还是追求刺激的赌徒,Gembet Betting Gembet 足球投注都能为您提供无与伦比的投注体验。Gembet Betting是一家领先的在线博彩公司,为全世界的用户提供多样化的投注选择和优质的服务。在这篇文章中,我们将探讨Gembet Betting的优势、功能及如何参与投注。
Gembet Betting的优势
Gembet Betting平台以其众多的优点吸引了成千上万的玩家。以下是其主要优势:
- 多样的投注选择:Gembet提供广泛的体育项目和赛事,包括足球、篮球、网球、电竞等,让玩家根据兴趣选择自己喜欢的投注项目。
- 用户友好的界面:该平台设计简洁明了,用户可以轻松找到各类信息和服务,快速进行投注。
- 即时更新的赔率:Gembet Betting实时更新赔率,确保玩家获得最新的信息和最佳的下注时机。
- 安全可靠的支付方式:为了保护用户的资金安全,Gembet支持多种支付方式,包括信用卡、电子钱包以及加密货币等,确保交易快捷安全。
如何在Gembet Betting上进行投注
参与Gembet Betting的过程简单明了。以下是基本步骤:
- 注册账户:访问Gembet Betting网站,点击注册链接,填写所需信息,完成注册。
- 账户验证:根据平台要求完成身份验证,以确保账户的安全性。
- 充值资金:通过选定的支付方式为您的投注账户充值,确保您的账户内有足够的资金进行投注。
- 选择赛事和投注类型:浏览即将进行的赛事,选择您感兴趣的比赛和相应的投注类型,比如胜负、让分等。
- 确认投注:仔细检查您的投注信息,确认无误后提交您的投注。
Gembet Betting的额外功能
除了基本的投注功能,Gembet Betting还提供了一些额外的功能,这些功能进一步增强了用户体验:
- 直播投注:支持实时下注,玩家可以根据比赛进程即时调整投注,增加无法预测的赛况带来的乐趣。
- 移动投注:Gembet Betting平台支持移动设备,玩家可以随时随地进行投注,无需拘泥于计算机。
- 丰富的奖励和促销活动:新用户可以享受丰厚的欢迎奖金,同时,老用户也将定期收到各种促销活动的通知,福利多多。
- 全天候客户支持:提供24/7的客户服务,无论遇到什么问题,玩家都可以随时联系在线客服获得帮助。
负责任的博彩
在享受Gembet Betting带来的乐趣时,负责任的博彩理念同样重要。Gembet Betting鼓励玩家在娱乐的同时保持理性,避免沉迷。平台提供一些工具,帮助玩家管理他们的投注行为,比如自我排除选项和投注限额设置。
总结
Gembet Betting凭借丰富的赛事选择、友好的用户界面和安全可靠的运营,成为众多玩家的首选在线投注平台。在这里,玩家不仅能够体验到投注的乐趣,还能够享受到专业的客户服务和安全的交易保障。无论您是新手还是经验丰富的玩家,Gembet Betting都能满足您的需求。注册账户,开始您的在线投注之旅吧!