Skip to content

Instantly share code, notes, and snippets.

@dcavins
Created April 10, 2016 13:15
Show Gist options
  • Save dcavins/30e13a7a770bdc7ddcd31081ba106924 to your computer and use it in GitHub Desktop.
Save dcavins/30e13a7a770bdc7ddcd31081ba106924 to your computer and use it in GitHub Desktop.
Checking that Doc folders are enabled and can run.
<?php
if ( bp_docs_enable_folders() ) {
echo PHP_EOL . "Folders are enabled generally.";
} else {
echo PHP_EOL . "Folders are disabled generally.";
}
if ( bp_docs_enable_folders_for_current_context() ) {
echo PHP_EOL . "Folders are enabled for current context.";
} else {
echo PHP_EOL . "Folders are disabled for current context.";
}
if ( current_user_can( 'bp_docs_manage_folders' ) ) {
echo PHP_EOL . "Current user can manage folders.";
} else {
echo PHP_EOL . "Current user cannot manage folders.";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment