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


PHP Jetpack_Sync::sync_comments方法代码示例

本文整理汇总了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'));
 }
开发者ID:lcw07r,项目名称:productcampamsterdam.org,代码行数:26,代码来源:notes.php

示例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')));
 }
开发者ID:moscarar,项目名称:cityhow,代码行数:14,代码来源:notes.php

示例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')));
开发者ID:lcw07r,项目名称:productcampamsterdam.org,代码行数:10,代码来源:mobile-push.php

示例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
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:31,代码来源:subscriptions.php


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