当前位置: 首页>>代码示例>>PHP>>正文


PHP Jetpack::xmlrpc_api_url方法代码示例

本文整理汇总了PHP中Jetpack::xmlrpc_api_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack::xmlrpc_api_url方法的具体用法?PHP Jetpack::xmlrpc_api_url怎么用?PHP Jetpack::xmlrpc_api_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Jetpack的用法示例。


在下文中一共展示了Jetpack::xmlrpc_api_url方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct($args = array(), $path = false, $port = 80, $timeout = 15)
 {
     $defaults = array('url' => Jetpack::xmlrpc_api_url(), 'user_id' => 0);
     $args = wp_parse_args($args, $defaults);
     $this->jetpack_args = $args;
     $this->IXR_Client($args['url'], $path, $port, $timeout);
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:7,代码来源:class.jetpack-ixr-client.php

示例2: send_data

 static function send_data($data)
 {
     Jetpack::load_xml_rpc_client();
     // add an extra parameter to the URL so we can tell it's a sync action
     $url = add_query_arg('sync', '1', Jetpack::xmlrpc_api_url());
     $rpc = new Jetpack_IXR_Client(array('url' => $url, 'user_id' => get_current_user_id(), 'timeout' => 30));
     $result = $rpc->query('jetpack.syncActions', $data);
     if (!$result) {
         return $rpc->get_jetpack_error();
     }
     return $rpc->getResponse();
 }
开发者ID:elliott-stocks,项目名称:jetpack,代码行数:12,代码来源:class.jetpack-sync-actions.php

示例3: send_data

 static function send_data($data, $codec_name, $sent_timestamp, $queue_id)
 {
     Jetpack::load_xml_rpc_client();
     $url = add_query_arg(array('sync' => '1', 'codec' => $codec_name, 'timestamp' => $sent_timestamp, 'queue' => $queue_id), Jetpack::xmlrpc_api_url());
     $rpc = new Jetpack_IXR_Client(array('url' => $url, 'user_id' => JETPACK_MASTER_USER, 'timeout' => 30));
     $result = $rpc->query('jetpack.syncActions', $data);
     if (!$result) {
         return $rpc->get_jetpack_error();
     }
     return $rpc->getResponse();
 }
开发者ID:kanei,项目名称:vantuch.cz,代码行数:11,代码来源:class.jetpack-sync-actions.php

示例4: send_data

 static function send_data($data, $codec_name, $sent_timestamp, $queue_id)
 {
     Jetpack::load_xml_rpc_client();
     $query_args = array('sync' => '1', 'codec' => $codec_name, 'timestamp' => $sent_timestamp, 'queue' => $queue_id);
     if (Jetpack::sync_idc_optin()) {
         $query_args['home'] = get_home_url();
         // Send home url option to check for Identity Crisis server-side
         $query_args['siteurl'] = get_site_url();
         // Send home url option to check for Identity Crisis server-side
     }
     $url = add_query_arg($query_args, Jetpack::xmlrpc_api_url());
     $rpc = new Jetpack_IXR_Client(array('url' => $url, 'user_id' => JETPACK_MASTER_USER, 'timeout' => 30));
     $result = $rpc->query('jetpack.syncActions', $data);
     if (!$result) {
         return $rpc->get_jetpack_error();
     }
     return $rpc->getResponse();
 }
开发者ID:pacificano,项目名称:pacificano,代码行数:18,代码来源:class.jetpack-sync-actions.php

示例5: send_data

 static function send_data($data, $codec_name, $sent_timestamp, $queue_id)
 {
     Jetpack::load_xml_rpc_client();
     $query_args = array('sync' => '1', 'codec' => $codec_name, 'timestamp' => $sent_timestamp, 'queue' => $queue_id, 'home' => get_home_url(), 'siteurl' => get_site_url());
     // Has the site opted in to IDC mitigation?
     if (Jetpack::sync_idc_optin()) {
         $query_args['idc'] = true;
     }
     if (Jetpack_Options::get_option('migrate_for_idc', false)) {
         $query_args['migrate_for_idc'] = true;
     }
     $query_args['timeout'] = Jetpack_Sync_Settings::is_doing_cron() ? 30 : 15;
     $url = add_query_arg($query_args, Jetpack::xmlrpc_api_url());
     $rpc = new Jetpack_IXR_Client(array('url' => $url, 'user_id' => JETPACK_MASTER_USER, 'timeout' => $query_args['timeout']));
     $result = $rpc->query('jetpack.syncActions', $data);
     if (!$result) {
         return $rpc->get_jetpack_error();
     }
     $response = $rpc->getResponse();
     // Check if WordPress.com IDC mitigation blocked the sync request
     if (is_array($response) && isset($response['error_code'])) {
         $error_code = $response['error_code'];
         $allowed_idc_error_codes = array('jetpack_url_mismatch', 'jetpack_home_url_mismatch', 'jetpack_site_url_mismatch');
         if (in_array($error_code, $allowed_idc_error_codes)) {
             Jetpack_Options::update_option('sync_error_idc', Jetpack::get_sync_error_idc_option($response));
         }
         return new WP_Error('sync_error_idc', esc_html__('Sync has been blocked from WordPress.com because it would cause an identity crisis', 'jetpack'));
     }
     return $response;
 }
开发者ID:netmagik,项目名称:netmagik,代码行数:30,代码来源:class.jetpack-sync-actions.php

示例6: send_data

 static function send_data($data, $codec_name, $sent_timestamp, $queue_id)
 {
     Jetpack::load_xml_rpc_client();
     $query_args = array('sync' => '1', 'codec' => $codec_name, 'timestamp' => $sent_timestamp, 'queue' => $queue_id, 'home' => get_home_url(), 'siteurl' => get_site_url());
     // Has the site opted in to IDC mitigation?
     if (Jetpack::sync_idc_optin()) {
         $query_args['idc'] = true;
     }
     $url = add_query_arg($query_args, Jetpack::xmlrpc_api_url());
     $rpc = new Jetpack_IXR_Client(array('url' => $url, 'user_id' => JETPACK_MASTER_USER, 'timeout' => 30));
     $result = $rpc->query('jetpack.syncActions', $data);
     if (!$result) {
         $error = $rpc->get_jetpack_error();
         if ('jetpack_url_mismatch' === $error->get_error_code()) {
             Jetpack_Options::update_option('sync_error_idc', Jetpack::get_sync_error_idc_option());
         }
         return $error;
     }
     return $rpc->getResponse();
 }
开发者ID:iamtakashi,项目名称:jetpack,代码行数:20,代码来源:class.jetpack-sync-actions.php


注:本文中的Jetpack::xmlrpc_api_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。