Problem with Add Photo

This topic contains 7 replies, has 4 voices, and was last updated by  Giri 7 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #313776

    Marina Orlando
    Expired Member
    Post count: 22

    Hi, I’m using Whoop theme with Buddypress Integration and, surprisingly, I noticed that if a registered user gets to a detail record page to post a review, he can also add an image not only to his review, which would be OK, but to the listing as well and that would definitely cause a lot of problems with the author. Is there a way to disable the ‘Add Photo’ button for non-authors? The attachment shows what I mean. Thank you.

    #314222

    Kor
    Moderator
    Post count: 16516

    Hi Marina,

    Could you please share the URL in question so that I could check on it and see if it’s achievable using custom CSS?

    Thanks

    #314323

    Marina Orlando
    Expired Member
    Post count: 22
    This reply has been marked as private.
    #314756

    Paolo
    Site Admin
    Post count: 31206

    HI,

    that’s how Yelp works and Whoop has been built to be as close as possible to Yelp.

    It should be easy to hide it with CSS, but I asked to the developers to let us know if there is a better way.

    They’ll let us know asap.

    Thanks

    #314994

    Marina Orlando
    Expired Member
    Post count: 22
    This reply has been marked as private.
    #315331

    Giri
    Expired Member
    Post count: 3155

    Hi Marina,

    Try placing this code in your child theme’s functions.php file.

    
    
    
    add_filter('whoop_big_header_show_add_photo_btn', '__return_false');

    That would disable the “Add Photo” button

    Thanks

    #315498

    Marina Orlando
    Expired Member
    Post count: 22

    Thank you for your precious help. I post this in public because it might help someone else. The function

    add_filter('whoop_big_header_show_add_photo_btn', '__return_false');

    takes the ‘Add Photo’ button away for everyone, so, since my intent was to let admin and the post author to see it and nobody else, I changed it to:

    
    
    global $current_user;
    	get_currentuserinfo(); 
    	if (is_user_logged_in() && $current_user->ID == $post->post_author || current_user_can('administrator') ) {		
    	}
    	else {
    add_filter('whoop_big_header_show_add_photo_btn', '__return_false');
    	}

    …and it’s working like a charm. Thank you again Kor, Paolo and Giri.

    #315577

    Giri
    Expired Member
    Post count: 3155

    You are welcome Marina and thanks for the code.

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket