本文整理汇总了PHP中Jetpack_Sync类的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack_Sync类的具体用法?PHP Jetpack_Sync怎么用?PHP Jetpack_Sync使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Jetpack_Sync类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: stats_load
function stats_load()
{
global $wp_roles;
Jetpack::enable_module_configurable(__FILE__);
Jetpack::module_configuration_load(__FILE__, 'stats_configuration_load');
Jetpack::module_configuration_head(__FILE__, 'stats_configuration_head');
Jetpack::module_configuration_screen(__FILE__, 'stats_configuration_screen');
// Tell HQ about changed posts
$post_stati = get_post_stati(array('public' => true));
// All public post stati
$post_stati[] = 'private';
// Content from private stati will be redacted
Jetpack_Sync::sync_posts(__FILE__, array('post_types' => get_post_types(array('public' => true)), 'post_stati' => $post_stati));
// Generate the tracking code after wp() has queried for posts.
add_action('template_redirect', 'stats_template_redirect', 1);
add_action('wp_head', 'stats_admin_bar_head', 100);
add_action('wp_head', 'stats_hide_smile_css');
add_action('jetpack_admin_menu', 'stats_admin_menu');
// Map stats caps
add_filter('map_meta_cap', 'stats_map_meta_caps', 10, 4);
if (isset($_GET['oldwidget'])) {
// Old one.
add_action('wp_dashboard_setup', 'stats_register_dashboard_widget');
} else {
add_action('admin_init', 'stats_merged_widget_admin_init');
}
add_filter('jetpack_xmlrpc_methods', 'stats_xmlrpc_methods');
add_filter('pre_option_db_version', 'stats_ignore_db_version');
}
开发者ID:jordankoschei,项目名称:jordankoschei-dot-com,代码行数:29,代码来源:stats.php
示例2: action_init
function action_init()
{
//syncing must wait until after init so
//post types that support comments
$filt_post_types = array();
$all_post_types = get_post_types();
foreach ($all_post_types as $post_type) {
if (post_type_supports($post_type, 'comments')) {
$filt_post_types[] = $post_type;
}
}
Jetpack_Sync::sync_posts(__FILE__, array('post_types' => $filt_post_types, 'post_stati' => array('publish')));
Jetpack_Sync::sync_comments(__FILE__, array('post_types' => $filt_post_types, 'post_stati' => array('publish'), 'comment_stati' => array('approve', 'approved', '1', 'hold', 'unapproved', 'unapprove', '0', 'spam', 'trash')));
if (defined('DOING_AJAX') && DOING_AJAX) {
return;
}
if (!has_filter('show_admin_bar', '__return_true') && !is_user_logged_in()) {
return;
}
if (!self::current_browser_is_supported()) {
return;
}
add_action('admin_bar_menu', array(&$this, 'admin_bar_menu'), 120);
add_action('wp_head', array(&$this, 'styles_and_scripts'), 120);
add_action('admin_head', array(&$this, 'styles_and_scripts'));
}
开发者ID:lcw07r,项目名称:productcampamsterdam.org,代码行数:26,代码来源:notes.php
示例3: __construct
function __construct()
{
global $publicize_ui;
$this->in_jetpack = class_exists('Jetpack') && method_exists('Jetpack', 'enable_module_configurable') ? true : false;
if ($this->in_jetpack && method_exists('Jetpack', 'module_configuration_load')) {
Jetpack::enable_module_configurable(__FILE__);
Jetpack::module_configuration_load(__FILE__, array($this, 'jetpack_configuration_load'));
Jetpack_Sync::sync_posts(__FILE__);
}
require_once dirname(__FILE__) . '/publicize/publicize.php';
if ($this->in_jetpack) {
require_once dirname(__FILE__) . '/publicize/publicize-jetpack.php';
} else {
require_once dirname(dirname(__FILE__)) . '/mu-plugins/keyring/keyring.php';
require_once dirname(__FILE__) . '/publicize/publicize-wpcom.php';
}
require_once dirname(__FILE__) . '/publicize/ui.php';
$publicize_ui = new Publicize_UI();
$publicize_ui->in_jetpack = $this->in_jetpack;
// Jetpack specific checks / hooks
if ($this->in_jetpack) {
add_action('jetpack_activate_module_publicize', array($this, 'module_state_toggle'));
add_action('jetpack_deactivate_module_publicize', array($this, 'module_state_toggle'));
// if sharedaddy isn't active, the sharing menu hasn't been added yet
$active = Jetpack::get_active_modules();
if (in_array('publicize', $active) && !in_array('sharedaddy', $active)) {
add_action('admin_menu', array(&$publicize_ui, 'sharing_menu'));
}
}
}
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:30,代码来源:publicize.php
示例4: jetpack_vaultpress_sync_options
function jetpack_vaultpress_sync_options()
{
if (!class_exists('VaultPress')) {
return;
}
$vaultpress = VaultPress::init();
Jetpack_Sync::sync_options(__FILE__, $vaultpress->auto_register_option, $vaultpress->option_name);
}
开发者ID:spielhoelle,项目名称:amnesty,代码行数:8,代码来源:vaultpress.php
示例5: __construct
function __construct() {
$this->in_jetpack = ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ? false : true;
add_action( 'init', array( &$this, 'action_init' ) );
add_action( 'admin_init', array( $this, 'admin_init' ) );
if ( $this->in_jetpack ) {
add_action( 'jetpack_activate_module_likes', array( $this, 'module_toggle' ) );
add_action( 'jetpack_deactivate_module_likes', array( $this, 'module_toggle' ) );
Jetpack::enable_module_configurable( __FILE__ );
Jetpack::module_configuration_load( __FILE__, array( $this, 'configuration_redirect' ) );
add_action('admin_print_scripts-settings_page_sharing', array( &$this, 'load_jp_css' ) );
add_filter( 'sharing_show_buttons_on_row_start', array( $this, 'configuration_target_area' ) );
$active = Jetpack::get_active_modules();
if ( ! in_array( 'sharedaddy', $active ) && ! in_array( 'publicize', $active ) ) {
add_action( 'admin_menu', array( $this, 'sharing_menu' ) ); // we don't have a sharing page yet
}
if ( in_array( 'publicize', $active ) && ! in_array( 'sharedaddy', $active ) ) {
add_action( 'pre_admin_screen_sharing', array( $this, 'sharing_block' ), 20 ); // we have a sharing page but not the global options area
add_action( 'pre_admin_screen_sharing', array( $this, 'updated_message' ), -10 );
}
if( ! in_array( 'sharedaddy', $active ) ) {
add_action( 'admin_init', array( $this, 'process_update_requests_if_sharedaddy_not_loaded' ) );
add_action( 'sharing_global_options', array( $this, 'admin_settings_showbuttonon_init' ), 19 );
add_action( 'sharing_admin_update', array( $this, 'admin_settings_showbuttonon_callback' ), 19 );
add_action( 'admin_init', array( $this, 'add_meta_box' ) );
} else {
add_filter( 'sharing_meta_box_title', array( $this, 'add_likes_to_sharing_meta_box_title' ) );
add_action( 'start_sharing_meta_box_content', array( $this, 'meta_box_content' ) );
}
Jetpack_Sync::sync_options( __FILE__, 'social_notifications_like' );
} else { // wpcom
add_action( 'admin_init', array( $this, 'add_meta_box' ) );
add_action( 'end_likes_meta_box_content', array( $this, 'sharing_meta_box_content' ) );
add_filter( 'likes_meta_box_title', array( $this, 'add_likes_to_sharing_meta_box_title' ) );
}
add_action( 'admin_init', array( $this, 'admin_discussion_likes_settings_init' ) ); // Likes notifications
add_action( 'admin_bar_menu', array( $this, 'admin_bar_likes' ), 60 );
add_action( 'save_post', array( $this, 'meta_box_save' ) );
add_action( 'sharing_global_options', array( $this, 'admin_settings_init' ), 20 );
add_action( 'sharing_admin_update', array( $this, 'admin_settings_callback' ), 20 );
}
开发者ID:pauEscarcia,项目名称:AIMM,代码行数:53,代码来源:LIKES.PHP
示例6: sync_posts_init
function sync_posts_init()
{
$post_types = array('post', 'page');
$all_post_types = get_post_types();
foreach ($all_post_types as $post_type) {
// sync Custom Post Types that support publicize
if (post_type_supports($post_type, 'publicize')) {
$post_types[] = $post_type;
}
}
Jetpack_Sync::sync_posts(__FILE__, array('post_types' => $post_types));
}
开发者ID:moushegh,项目名称:blog-source-configs,代码行数:12,代码来源:publicize.php
示例7: action_on_load
/**
* This action triggers if the module is in an active state, load related posts and options.
*
* @uses Jetpack_RelatedPosts::init, is_admin, Jetpack::enable_module_configurable, Jetpack::module_configuration_load, Jetpack_Sync::sync_posts
* @return null
*/
public function action_on_load()
{
require_once 'related-posts/jetpack-related-posts.php';
Jetpack_RelatedPosts::init();
if (is_admin()) {
// Enable "Configure" button on module card
Jetpack::enable_module_configurable(__FILE__);
Jetpack::module_configuration_load(__FILE__, array($this, 'module_configuration_load'));
// Sync new posts
Jetpack_Sync::sync_posts(__FILE__);
}
}
开发者ID:moushegh,项目名称:blog-source-configs,代码行数:18,代码来源:related-posts.php
示例8: Jetpack_Notifications
function Jetpack_Notifications()
{
$this->jetpack = Jetpack::init();
add_action('init', array(&$this, 'action_init'));
//post types that support comments
$filt_post_types = array();
foreach (get_post_types() as $post_type) {
if (post_type_supports($post_type, 'comments')) {
$filt_post_types[] = $post_type;
}
}
Jetpack_Sync::sync_posts(__FILE__, array('post_types' => $filt_post_types, 'post_stati' => array('publish')));
Jetpack_Sync::sync_comments(__FILE__, array('post_types' => $filt_post_types, 'post_stati' => array('publish'), 'comment_stati' => array('approve', 'approved', '1', 'hold', 'unapproved', 'unapprove', '0', 'spam', 'trash')));
}
开发者ID:moscarar,项目名称:cityhow,代码行数:14,代码来源:notes.php
示例9: test_backwards_compatibility_sync_options
public function test_backwards_compatibility_sync_options()
{
require_once JETPACK__PLUGIN_DIR . '3rd-party/polldaddy.php';
$this->setExpectedDeprecated('Jetpack_Sync::sync_options');
Jetpack_Sync::sync_options(__FILE__, 'foo_option', 'bar_option');
}
开发者ID:elliott-stocks,项目名称:jetpack,代码行数:6,代码来源:test_class.jetpack_sync_backward_compatibility.php
示例10: resolve_identity_crisis
public static function resolve_identity_crisis($key = null)
{
if ($key) {
$identity_options = array($key);
} else {
$identity_options = self::identity_crisis_options_to_check();
}
if (is_array($identity_options)) {
foreach ($identity_options as $identity_option) {
Jetpack_Sync::sync_options(__FILE__, $identity_option);
/**
* Fires when a shadow site option is updated.
* These options are updated via the Identity Crisis UI.
* $identity_option is the option that gets updated.
*
* @since 3.7.0
*/
do_action("update_option_{$identity_option}");
}
}
}
开发者ID:jordankoschei,项目名称:jordankoschei-dot-com,代码行数:21,代码来源:class.jetpack.php
示例11: admin_init
function admin_init()
{
add_filter('manage_posts_columns', array($this, 'add_like_count_column'));
add_filter('manage_pages_columns', array($this, 'add_like_count_column'));
add_action('manage_posts_custom_column', array($this, 'likes_edit_column'), 10, 2);
add_action('manage_pages_custom_column', array($this, 'likes_edit_column'), 10, 2);
add_action('admin_print_styles-edit.php', array($this, 'load_admin_css'));
add_action("admin_print_scripts-edit.php", array($this, 'enqueue_admin_scripts'));
if ($this->in_jetpack) {
$post_stati = get_post_stati(array('public' => true));
// All public post stati
$post_stati[] = 'private';
// Content from private stati will be redacted
Jetpack_Sync::sync_posts(__FILE__, array('post_types' => get_post_types(array('public' => true)), 'post_stati' => $post_stati));
}
}
开发者ID:CoderDojoTo,项目名称:CDWP-theme,代码行数:16,代码来源:likes.php
示例12: add_action
<?php
/**
* Module Name: Subscriptions
* Module Description: Allow users to subscribe to your posts and comments and receive notifications via email.
* Sort Order: 9
* First Introduced: 1.2
* Requires Connection: Yes
* Auto Activate: Yes
* Module Tags: Social
*/
add_action('jetpack_modules_loaded', 'jetpack_subscriptions_load');
Jetpack_Sync::sync_options(__FILE__, 'home', 'blogname', 'siteurl', 'page_on_front', 'permalink_structure', 'category_base', 'rss_use_excerpt', 'subscription_options', 'stb_enabled', 'stc_enabled', 'tag_base');
Jetpack_Sync::sync_posts(__FILE__);
Jetpack_Sync::sync_comments(__FILE__);
function jetpack_subscriptions_load()
{
Jetpack::enable_module_configurable(__FILE__);
Jetpack::module_configuration_load(__FILE__, 'jetpack_subscriptions_configuration_load');
}
function jetpack_subscriptions_configuration_load()
{
wp_safe_redirect(admin_url('options-discussion.php#jetpack-subscriptions-settings'));
exit;
}
class Jetpack_Subscriptions
{
var $jetpack = false;
public static $hash;
/**
* Singleton
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:31,代码来源:subscriptions.php
示例13: add_action
<?php
/**
* Module Name: Post by Email
* Module Description: Publish posts to your blog directly from your personal email account.
* First Introduced: 2.0
* Sort Order: 4
* Requires Connection: Yes
* Auto Activate: Yes
* Module Tags: Writing
*/
add_action('jetpack_modules_loaded', array('Jetpack_Post_By_Email', 'init'));
Jetpack_Sync::sync_options(__FILE__, 'large_size_w', 'large_size_h', 'thumbnail_size_w', 'thumbnail_size_h', 'medium_size_w', 'medium_size_h');
add_action('jetpack_activate_module_post-by-email', array('Jetpack_Post_By_Email', 'module_toggle'));
add_action('jetpack_deactivate_module_post-by-email', array('Jetpack_Post_By_Email', 'module_toggle'));
Jetpack::enable_module_configurable(__FILE__);
Jetpack::module_configuration_load(__FILE__, array('Jetpack_Post_By_Email', 'configuration_redirect'));
class Jetpack_Post_By_Email
{
public static function init()
{
static $instance = NULL;
if (!$instance) {
$instance = new Jetpack_Post_By_Email();
}
return $instance;
}
function __construct()
{
add_action('init', array(&$this, 'action_init'));
}
开发者ID:KurtMakesWeb,项目名称:CandG,代码行数:31,代码来源:post-by-email.php
示例14: dirname
<?php
/**
* Module Name: Site Icon
* Module Description: Add a site icon to your site.
* Sort Order: 22
* First Introduced: 3.2
* Requires Connection: No
* Auto Activate: No
* Module Tags: Other
* Additional Search Queries: favicon, icon, site icon
*/
include dirname(__FILE__) . '/site-icon/jetpack-site-icon.php';
include dirname(__FILE__) . '/site-icon/site-icon-functions.php';
Jetpack_Sync::sync_options(__FILE__, 'jetpack_site_icon_url');
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:15,代码来源:site-icon.php
示例15: dirname
* First Introduced: 1.4
* Sort Order: 2
* Requires Connection: Yes
* Auto Activate: No
*/
require dirname( __FILE__ ) . '/comments/comments.php';
if ( is_admin() ) {
require dirname( __FILE__ ) . '/comments/admin.php';
}
Jetpack_Sync::sync_options( __FILE__,
'comment_registration',
'require_name_email',
'show_avatars',
'avatar_default',
'highlander_comment_form_prompt',
'jetpack_comment_form_color_scheme'
);
function jetpack_comments_load() {
Jetpack::enable_module_configurable( __FILE__ );
Jetpack::module_configuration_load( __FILE__, 'jetpack_comments_configuration_load' );
}
function jetpack_comments_configuration_load() {
wp_safe_redirect( admin_url( 'options-discussion.php#jetpack-comments-settings' ) );
exit;
}
add_action( 'jetpack_modules_loaded', 'jetpack_comments_load' );
开发者ID:pauEscarcia,项目名称:AIMM,代码行数:32,代码来源:COMMENTS.PHP
示例16: resolve_identity_crisis
public static function resolve_identity_crisis($key = null)
{
if ($key) {
$identity_options = array($key);
} else {
$identity_options = self::identity_crisis_options_to_check();
}
if (is_array($identity_options)) {
foreach ($identity_options as $identity_option) {
Jetpack_Sync::sync_options(__FILE__, $identity_option);
// Fire off the sync manually
do_action("update_option_{$identity_option}");
}
}
}
开发者ID:annbransom,项目名称:techishowl_prod_backup,代码行数:15,代码来源:class.jetpack.php
示例17: admin_init
function admin_init()
{
add_filter('manage_posts_columns', array($this, 'add_like_count_column'));
add_filter('manage_pages_columns', array($this, 'add_like_count_column'));
add_action('manage_posts_custom_column', array($this, 'likes_edit_column'), 10, 2);
add_action('manage_pages_custom_column', array($this, 'likes_edit_column'), 10, 2);
add_action('admin_print_styles-edit.php', array($this, 'load_admin_css'));
add_action("admin_print_scripts-edit.php", array($this, 'enqueue_admin_scripts'));
if ($this->in_jetpack) {
Jetpack_Sync::sync_posts(__FILE__);
}
}
开发者ID:dtekcth,项目名称:datateknologer.se,代码行数:12,代码来源:likes.php
示例18: array
<?php
/**
* Module Name: Mobile Push Notifications
* Module Description: Receive notifications on your mobile device.
* Sort Order: 100
* First Introduced: 1.9
* Requires Connection: Yes
*/
Jetpack_Sync::sync_comments(__FILE__, array('comment_stati' => array('approved', 'unapproved')));
开发者ID:lcw07r,项目名称:productcampamsterdam.org,代码行数:10,代码来源:mobile-push.php
示例19: sync_all_registered_options
}
}
function sync_all_registered_options($options = array())
{
if ('jetpack_sync_all_registered_options' == current_filter()) {
$all_registered_options = array_unique(call_user_func_array('array_merge', $this->sync_options));
foreach ($all_registered_options as $option) {
$this->added_option_action($option);
}
} else {
wp_schedule_single_event(time(), 'jetpack_sync_all_registered_options', array($this->sync_options));
}
}
}
require_once dirname(__FILE__) . '/class.jetpack-options.php';
require_once dirname(__FILE__) . '/class.jetpack-user-agent.php';
require_once dirname(__FILE__) . '/class.jetpack-post-images.php';
require_once dirname(__FILE__) . '/class.photon.php';
require dirname(__FILE__) . '/functions.photon.php';
require dirname(__FILE__) . '/functions.compat.php';
require dirname(__FILE__) . '/functions.gallery.php';
class Jetpack_Error extends WP_Error
{
}
register_activation_hook(__FILE__, array('Jetpack', 'plugin_activation'));
register_deactivation_hook(__FILE__, array('Jetpack', 'plugin_deactivation'));
add_action('init', array('Jetpack', 'init'));
add_action('plugins_loaded', array('Jetpack', 'load_modules'), 100);
add_filter('jetpack_static_url', array('Jetpack', 'staticize_subdomain'));
Jetpack_Sync::sync_options(__FILE__, 'widget_twitter');
开发者ID:vsalx,项目名称:rattieinfo,代码行数:30,代码来源:jetpack.php
示例20: add_action
<?php
/**
* Module Name: JSON API
* Module Description: Allow applications to securely access your content through the cloud.
* Sort Order: 19
* First Introduced: 1.9
* Requires Connection: Yes
* Auto Activate: Public
* Module Tags: Writing, Developers
*/
add_action('jetpack_activate_module_json-api', array(Jetpack::init(), 'toggle_module_on_wpcom'));
add_action('jetpack_deactivate_module_json-api', array(Jetpack::init(), 'toggle_module_on_wpcom'));
add_action('jetpack_modules_loaded', 'jetpack_json_api_load_module');
$theme_slug = get_option('stylesheet');
Jetpack_Sync::sync_options(__FILE__, 'stylesheet', "theme_mods_{$theme_slug}");
function jetpack_json_api_load_module()
{
Jetpack::enable_module_configurable(__FILE__);
Jetpack::module_configuration_load(__FILE__, 'jetpack_json_api_configuration_load');
Jetpack::module_configuration_screen(__FILE__, 'jetpack_json_api_configuration_screen');
}
function jetpack_json_api_configuration_load()
{
if (isset($_POST['action']) && $_POST['action'] == 'save_options' && wp_verify_nonce($_POST['_wpnonce'], 'json-api')) {
Jetpack_Options::update_option('json_api_full_management', isset($_POST['json_api_full_management']));
Jetpack::state('message', 'module_configured');
wp_safe_redirect(Jetpack::module_configuration_url('json-api'));
exit;
}
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:31,代码来源:json-api.php
注:本文中的Jetpack_Sync类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论