• Resolved Andreas

    (@lacproduction)


    Hello,
    thanks for this great plugin and for the last update for last BP version.
    Found it on github before.

    I have a hidden community and want to remove the privacy option “Anyone”.
    Do you have a solution without change the code? Maybe in the function.php?

    Best regards

    Andreas

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author David Cavins

    (@dcavins)

    Hi Andreas,

    Yes, you can filter the access settings using the bp_docs_get_access_options filter. The following code removes the “anyone” option from the array of possible options:

    
    add_filter( 'bp_docs_get_access_options', 'my_bpdocs_no_anyone_access_setting' );
    function my_bpdocs_no_anyone_access_setting( $options ) {
        // The 'anyone' setting has an index of 10.
        if ( isset( $options[10] ) ) {
            unset( $options[10] );
        }
        return $options;
    }
    

    I put this code in my wp-content/bp-custom.php file, but it could just as well be added to a functions.php file, if that makes more sense to you.

    • This reply was modified 8 years ago by David Cavins. Reason: Added location to add code
    • This reply was modified 8 years ago by David Cavins.
    • This reply was modified 8 years ago by David Cavins.
    Carl Alberto

    (@carl-alberto)

    Thanks for this David! I just want to point this one out-

    I put this code in my wp-content/bp-custom.php file, but it could just as well be added to a functions.php file, if that makes more sense to you.

    I guess you’re referring to wp-content/plugins/bp-custom.php

    Thread Starter Andreas

    (@lacproduction)

    Hi David!
    Thank you very much!

    Keep up the good work.

    Regards
    Andreas

    Plugin Author David Cavins

    (@dcavins)

    @carl-alberto: You are correct, the BP custom file should exist at wp-content/plugins/bp-custom.php.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove anyone in privacy option’ is closed to new replies.