WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
Remove Google+ Profile from "the_content" and output later (6 posts)

  1. mikegulline
    Member
    Posted 8 months ago #

    i would like to remove the Google+ Profile filter from "the_content" and output it in a different section of my site.

    i was able to remove the sharedaddy "Likes" and "Share" with this

    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 );
    }

    and output them with this

    $get_jet = '';
    if ( function_exists( 'sharing_display' ) ) {
    $get_jet = sharing_display();
    }
    if ( class_exists( 'Jetpack_Likes' ) ) {
    $custom_likes = new Jetpack_Likes;
    $get_jet .= $custom_likes->post_likes( '' );
    }
    if($get_jet){
    echo '<div class="wrapper share">';
    echo $get_je;
    echo '</div>';
    }

    the filter i need to override is declared here on line 24 https://github.com/wp-plugins/jetpack/blob/master/modules/gplus-authorship.php

    add_filter( 'the_content', array( $this, 'post_output_wrapper' ), 22, 1 );

    i need to remove that, then call "post_output_wrapper" later

    i am not having any success.

    thank you for your help

    http://wordpress.org/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 8 months ago #

    You should be able to use remove_filter to remove post_output_wrapper from the_content and hook it somewhere else instead, much like you've done for the sharing buttons and the Likes.

    I hope this helps.

  3. mikegulline
    Member
    Posted 8 months ago #

    when i print out "the_content" filter functions. it shows that the "post_output_wrapper" function receives a unique namespace like this -> "000000007b3b977e000000009e350c0cpost_output_wrapper"

    how can i target that function name?

    [22] => Array
    (
    [000000007b3b977e000000009e350c0cpost_output_wrapper] => Array
    (
    [function] => Array
    (
    [0] => GPlus_Authorship Object
    (
    [in_jetpack] => 1
    )
    [1] => post_output_wrapper
    )
    [accepted_args] => 1
    )
    )

  4. mikegulline
    Member
    Posted 8 months ago #

    ok, i was able to remove it with this.

    if ( class_exists( 'GPlus_Authorship' ) && isset($wp_filter['the_content'][22])) {
    		remove_filter( 'the_content', array_shift(array_keys($wp_filter['the_content'][22])), 22, 1 );
    	}

    now i need to call it.

  5. mikegulline
    Member
    Posted 8 months ago #

    almost there. i just need help calling "post_output_wrapper"

    i tried this

    if ( class_exists( 'GPlus_Authorship' ) ) {
        $custom_gp = new GPlus_Authorship;
        $get_jet .= $custom_gp->post_output_wrapper();
    }

    but got this error

    Fatal error: Cannot redeclare jetpack_init_gplus_authorship_admin() (previously declared in /mysite/framework/wp-content/plugins/jetpack/modules/gplus-authorship/admin/ui.php:3) in /mysite/framework/wp-content/plugins/jetpack/modules/gplus-authorship/admin/ui.php on line 5

    any suggestions?

  6. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 8 months ago #

    hm. I'll ask the developer who worked on that module to take a look. I'll let you know as soon as I have some news!

Reply

You must log in to post.

About this Plugin

About this Topic