Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How to remove "Favorite" from blog posts entries in stream?

  • @rosyteddy

    Participant

    Is it possible to remove “Favorite” from blog posts ( favorite button below the name and excerpt of a blog post) selectively in the Activity stream ?

    Thanks for any clue or actual code snippet.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @aymanomar85

    Participant

    can you try to add in css
    .button.fav.bp-secondary-action {
    display: none;
    }

    @danbp

    Participant

    @aymanomar85 your CSS trick only hides the button, it doesn’t remove it.


    @rosyteddy
    , this snippet removes the button:

    function bpfr_activity_cannot_favorite( $retval = true ) {
         $activity_type = bp_get_activity_type();
    
         if ( ! empty( $activity_type ) && 'new_blog_post' == $activity_type ) {
             $retval = false;
        }
    
       return $retval;
    }
    add_filter( 'bp_activity_can_favorite', 'bpfr_activity_cannot_favorite', 10, 1 ); 

    Add to bp-custom.php

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] How to remove "Favorite" from blog posts entries in stream?’ is closed to new replies.
Skip to toolbar