Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/04/2011 02:07:08 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Introduce _has_directory() functions for forums, groups, members, and activity components. This replaces the need for enabling/disabling the forum directory, since if it is not set it does not exist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums/bp-forums-functions.php

    r4400 r4596  
    1212
    1313/**
    14  * Convenience function to determine if the forum directory has been disabled
    15  * by the site admin.
     14 * Checks $bp pages global and looks for directory page
     15 *
     16 * @since 1.3
    1617 *
    1718 * @global object $bp Global BuddyPress settings object
    18  * @return bool True if forum is disabled
    19  * @since 1.3
     19 * @return bool True if set, False if empty
    2020 */
    21 function bp_forum_directory_is_disabled() {
    22     global $bp;
    23 
    24     return !empty( $bp->site_options['bp-disable-forum-directory'] );
     21function bp_forums_has_directory() {
     22    global $bp;
     23
     24    return (bool) !empty( $bp->pages->forums->id );
    2525}
    2626
Note: See TracChangeset for help on using the changeset viewer.