init() public static method

public static init ( )
Example #1
0
 function init()
 {
     if (wallow_is_mobile()) {
         return;
     }
     //Infinite Scroll
     add_theme_support('infinite-scroll', array('type' => 'click', 'container' => 'content', 'render' => array($this, 'infinite_scroll_render'), 'wrapper' => false));
     if (class_exists('The_Neverending_Home_Page')) {
         add_filter('infinite_scroll_results', array($this, 'infinite_scroll_encode'), 11, 1);
     }
     //Sharedaddy
     if (function_exists('sharing_display')) {
         remove_filter('the_content', 'sharing_display', 19);
         remove_filter('the_excerpt', 'sharing_display', 19);
         remove_action('wallow_hook_entry_before', 'wallow_I_like_it');
         add_action('wallow_hook_entry_bottom', array($this, 'sharedaddy'));
     }
     //Carousel
     if (class_exists('Jetpack_Carousel')) {
         remove_filter('post_gallery', 'wallow_gallery_shortcode', 10, 2);
         add_filter('wallow_option_wallow_thickbox', '__return_false');
     }
     //Likes
     if (class_exists('Jetpack_Likes')) {
         add_action('wallow_hook_entry_bottom', array($this, 'likes'));
         remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
         add_filter('wallow_filter_likes', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
     }
 }
Example #2
0
 function init()
 {
     if (fastfood_is_mobile()) {
         return;
     }
     //Infinite Scroll
     if (Jetpack::is_module_active('infinite-scroll')) {
         //nop
     }
     //Sharedaddy
     if (Jetpack::is_module_active('sharedaddy')) {
         remove_filter('the_content', 'sharing_display', 19);
         remove_filter('the_excerpt', 'sharing_display', 19);
         add_action('fastfood_hook_entry_bottom', array($this, 'sharedaddy'));
     }
     //Carousel
     if (Jetpack::is_module_active('carousel')) {
         //nop
     }
     //Likes
     if (Jetpack::is_module_active('likes')) {
         add_action('fastfood_hook_entry_bottom', array($this, 'likes'));
         remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
         add_filter('fastfood_filter_likes', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
     }
 }
Example #3
0
function aaron_move_share()
{
    remove_filter('the_content', 'sharing_display', 19);
    remove_filter('the_excerpt', 'sharing_display', 19);
    if (class_exists('Jetpack_Likes')) {
        remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
    }
}
Example #4
0
/**
 * Remove ratings from excerpts that are used as intro on blog index, single, and archive pages.
 */
function twentysixteen_remove_share()
{
    if (is_single() || is_archive() || is_home()) {
        remove_filter('the_excerpt', 'sharing_display', 19);
        if (class_exists('Jetpack_Likes')) {
            remove_filter('the_excerpt', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
        }
    }
}
function jptweak_remove_share()
{
    if (is_le_page() || defined('OP_LIVEEDITOR')) {
        remove_filter('the_content', 'sharing_display', 19);
        remove_filter('the_excerpt', 'sharing_display', 19);
        if (class_exists('Jetpack_Likes')) {
            remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
        }
    }
}
Example #6
0
function listable_jetpack_remove_share_from_listings()
{
    if (is_post_type_archive('job_listing') || get_query_var('post_type') == 'job_listing') {
        remove_filter('the_content', 'sharing_display', 19);
        remove_filter('the_excerpt', 'sharing_display', 19);
        if (class_exists('Jetpack_Likes')) {
            remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
        }
    }
}
Example #7
0
function jptweak_remove_share()
{
    if (has_action('sharing_display')) {
        remove_filter('the_content', 'sharing_display', 19);
        remove_filter('the_excerpt', 'sharing_display', 19);
    }
    if (class_exists('Jetpack_Likes')) {
        remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
    }
}
 public function loop_start()
 {
     if (!is_singular('job_listing')) {
         return;
     }
     remove_filter('the_content', 'sharing_display', 19);
     remove_filter('the_excerpt', 'sharing_display', 19);
     if (class_exists('Jetpack_Likes')) {
         remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
     }
 }
Example #9
0
     *
     * @return bool
     */
    function is_single_post_enabled()
    {
        $options = $this->get_options();
        return (bool) apply_filters('wpl_is_single_post_disabled', (bool) in_array('post', $options['show']));
    }
    /**
     * Are Post Likes enabled on single pages?
     *
     * @return bool
     */
    function is_single_page_enabled()
    {
        $options = $this->get_options();
        return (bool) apply_filters('wpl_is_single_page_disabled', (bool) in_array('page', $options['show']));
    }
    /**
     * Are Media Likes enabled on single pages?
     *
     * @return bool
     */
    function is_attachment_enabled()
    {
        $options = $this->get_options();
        return (bool) apply_filters('wpl_is_attachment_disabled', (bool) in_array('attachment', $options['show']));
    }
}
Jetpack_Likes::init();
 function test_remove_likes_from_filtered_content()
 {
     // initial sync sets the screen to 'sync', then `is_admin` returns `true`
     set_current_screen('front');
     // force likes to be appended to the_content
     add_filter('wpl_is_likes_visible', '__return_true');
     require_once JETPACK__PLUGIN_DIR . 'modules/likes.php';
     $jpl = Jetpack_Likes::init();
     $jpl->action_init();
     $this->post->post_content = 'The new post content';
     wp_update_post($this->post);
     $this->assertContains('div class=\'sharedaddy', apply_filters('the_content', $this->post->post_content));
     $this->sender->do_sync();
     $synced_post = $this->server_replica_storage->get_post($this->post->ID);
     $this->assertEquals('<p>' . $synced_post->post_content . "</p>\n", $synced_post->post_content_filtered);
 }
    function white_div_end()
    {
        if (function_exists('sharing_display')) {
            echo sharing_display();
        } else {
            $this->fallback_sharing();
        }
        if (class_exists('Jetpack_Likes') && is_callable(array('Jetpack_Likes', 'init'))) {
            $likes = Jetpack_Likes::init();
            echo $likes->post_likes('');
        }
        ?>
		</div><!-- .white_box -->
		<?php 
    }
Example #12
0
 /**
  * Remove the sharing from below the content on single accommodation.
  */
 public static function remove_jetpack_sharing()
 {
     remove_filter('the_excerpt', 'sharing_display', 19);
     if (class_exists('Jetpack_Likes')) {
         remove_filter('the_excerpt', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
     }
     remove_filter('the_content', 'sharing_display', 19);
     if (class_exists('Jetpack_Likes')) {
         remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
     }
 }
Example #13
0
/**
 * Remove the sharing from below the content on single portfolio pages.
 *
 * @package lsx
 * @subpackage jetpack
 * @category portfolio
 */
function lsx_portfolio_remove_share()
{
    if (is_single() && 'jetpack-portfolio' == get_post_type() || is_page_template('page-templates/template-portfolio.php')) {
        remove_filter('the_content', 'sharing_display', 19);
        remove_filter('the_excerpt', 'sharing_display', 19);
        if (class_exists('Jetpack_Likes')) {
            remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
        }
    }
}