本文整理汇总了PHP中Jetpack_Sync::sync_comments方法的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack_Sync::sync_comments方法的具体用法?PHP Jetpack_Sync::sync_comments怎么用?PHP Jetpack_Sync::sync_comments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jetpack_Sync
的用法示例。
在下文中一共展示了Jetpack_Sync::sync_comments方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'));
}
示例2: 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')));
}
示例3: 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')));
示例4: 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