Created
March 27, 2024 13:49
-
-
Save dcavins/cb7db0b02cdbbdaa2efda46a32e3ef4d to your computer and use it in GitHub Desktop.
Change the default access options for new BP Docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'bp_docs_get_default_access_options', 'my_change_docs_default_access_levels' ); | |
function my_change_docs_default_access_levels( $defaults ) { | |
/** | |
* Possible access capabilities are 'read', 'edit', 'read_comments', 'post_comments', | |
* 'view_history', or 'manage'. | |
* Possible access options are 'loggedin', 'creator', or 'anyone'. | |
* If BuddyPress groups are activated, then additional access options are available | |
* to docs that are associated with a group: | |
* 'group-members' and 'admins-mods'. | |
* The default 'read' setting for a new doc is 'anyone'; | |
* to change the default 'read' capability to 'loggedin', you'd do: | |
*/ | |
$defaults['read'] = 'loggedin'; | |
return $defaults; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment