BuddyDev

Search

MediaPress only enable Wall Photo Gallery

  • Participant
    Level: Master
    Posts: 392
    Daniel on #34858

    Hi,

    I would like to set MediaPress in a way that only the Wall Photo Gallery is saved and I would like to disable that the user can create additional photo galleries.

    Is there a way to do that?

    Thanks for your input.

    Regards
    Daniel

  • Participant
    Level: Master
    Posts: 392
    Daniel on #34859

    Hi again,

    the same for Audio and Video, that only the Wall Video and Audio will be stored in Media Gallery and disable the user to create additional galleries.

    I tried to do it in WP Dashboard/Settings/Members Gallery/Enable Media Gallery Types and I unticked all but then the TAB on front end: Create Gallery does not disappear

    Could you please help me to make disappear the TAB on frontend: “Create Gallery” please?

    Thank you.

    Regards
    Daniel

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2459
    Ravi on #34873

    Hello Daniel,

    Thank you for posting. Try the following code it will not allows members to create gallery.

    
    
    add_filter( 'mpp_user_can_create_gallery', function ( $can, $component ) {
    
    	if ( ! $can || 'members' !== $component ) {
    		return $can;
    	}
    
    	// Only allow wall gallery.
    	if ( isset( $_POST['context'] ) && 'activity' === $_POST['context'] ) {
    		return true;
    	}
    
    	return false;
    }, 10, 2 );
    
    

    Please check and let me know if it works or not.

    Regards
    Ravi

You must be logged in to reply to this topic.

This topic is: not resolved