bp_do_register_theme_directory

Determine whether BuddyPress should register the bp-themes directory.

Description

bp_do_register_theme_directory(); 

Usage

  1. if ( !function_exists( 'bp_do_register_theme_directory' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_do_register_theme_directory(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-functions.php  
  1. function bp_do_register_theme_directory() { 
  2. // If bp-default exists in another theme directory, bail. 
  3. // This ensures that the version of bp-default in the regular themes 
  4. // directory will always take precedence, as part of a migration away 
  5. // from the version packaged with BuddyPress. 
  6. foreach ( array_values( (array) $GLOBALS['wp_theme_directories'] ) as $directory ) { 
  7. if ( is_dir( $directory . '/bp-default' ) ) { 
  8. return false; 
  9.  
  10. // If the current theme is bp-default (or a bp-default child), BP 
  11. // should register its directory. 
  12. $register = 'bp-default' === get_stylesheet() || 'bp-default' === get_template(); 
  13.  
  14. // Legacy sites continue to have the theme registered. 
  15. if ( empty( $register ) && ( 1 == get_site_option( '_bp_retain_bp_default' ) ) ) { 
  16. $register = true; 
  17.  
  18. /** 
  19. * Filters whether BuddyPress should register the bp-themes directory. 
  20. * @since 1.9.0 
  21. * @param bool $register If bp-themes should be registered. 
  22. */