Jetpack_RelatedPosts::init PHP Method

init() public static method

Creates and returns a static instance of Jetpack_RelatedPosts.
public static init ( ) : Jetpack_RelatedPosts
return Jetpack_RelatedPosts
    public static function init()
    {
        static $instance = NULL;
        if (!$instance) {
            if (class_exists('WPCOM_RelatedPosts') && method_exists('WPCOM_RelatedPosts', 'init')) {
                $instance = WPCOM_RelatedPosts::init();
            } else {
                $instance = new Jetpack_RelatedPosts(get_current_blog_id(), Jetpack_Options::get_option('id'));
            }
        }
        return $instance;
    }

Usage Example

Exemplo n.º 1
0
function wptouch_remove_jetpack_related()
{
    if (class_exists('Jetpack_RelatedPosts')) {
        $jprp = Jetpack_RelatedPosts::init();
        remove_filter('the_content', array($jprp, 'filter_add_target_to_dom'), 40);
    }
}
All Usage Examples Of Jetpack_RelatedPosts::init