Skip to:
Content

BuddyPress.org

Changeset 6436 for trunk/bp-loader.php


Ignore:
Timestamp:
10/22/2012 05:24:36 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Theme Compat:

  • Put back 'bp_register_theme_directory' sub action, hooked to 'bp_loaded'
  • Move register_theme_directory() back into BuddyPress root class method.
  • Introduces old_themes_dir variable, which will get deprecated when we remove bp-default from core.
  • Create 'bp-templates' root folder, for theme-compat templates to live in, and not conflict with 'bp-themes'.
  • Fixes issue where 'bp-legacy' would show up as "Broken" in Appearance > Themes.
  • Brute-force switch from bp-default to WP_DEFAULT_THEME on deactivation, and update theme roots, to fix issue when deactivating BuddyPress while theme stack relies on bp-default.
  • See #3741
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r6416 r6436  
    332332
    333333                // BuddyPress root directory
    334                 $this->file       = __FILE__;
    335                 $this->basename   = plugin_basename( $this->file );
    336                 $this->plugin_dir = BP_PLUGIN_DIR;
    337                 $this->plugin_url = BP_PLUGIN_URL;
    338 
    339                 // Themes
    340                 $this->themes_dir = $this->plugin_dir . 'bp-themes';
    341                 $this->themes_url = $this->plugin_url . 'bp-themes';
     334                $this->file           = __FILE__;
     335                $this->basename       = plugin_basename( $this->file );
     336                $this->plugin_dir     = BP_PLUGIN_DIR;
     337                $this->plugin_url     = BP_PLUGIN_URL;
    342338
    343339                // Languages
    344                 $this->lang_dir   = $this->plugin_dir . 'bp-languages';
     340                $this->lang_dir       = $this->plugin_dir . 'bp-languages';
     341
     342                // Templates (theme compatability)
     343                $this->themes_dir     = $this->plugin_dir . 'bp-templates';
     344                $this->themes_url     = $this->plugin_url . 'bp-templates';
     345
     346                // Themes (for bp-default)
     347                $this->old_themes_dir = $this->plugin_dir . 'bp-themes';
     348                $this->old_themes_url = $this->plugin_url . 'bp-themes';
    345349
    346350                /** Theme Compat ******************************************************/
     
    351355                /** Users *************************************************************/
    352356
    353                 $this->current_user       = new stdClass();
    354                 $this->displayed_user     = new stdClass();
     357                $this->current_user   = new stdClass();
     358                $this->displayed_user = new stdClass();
    355359        }
    356360
     
    498502                        add_action( 'bp_' . $class_action, array( $this, $class_action ), 5 );
    499503
    500                 // Setup the BuddyPress theme directory
    501                 // @todo Move bp-default to wordpress.org/extend/themes and remove this
    502                 register_theme_directory( $this->themes_dir );
     504                // All BuddyPress actions are setup (includes bbp-core-hooks.php)
     505                do_action_ref_array( 'bp_after_setup_actions', array( &$this ) );
    503506        }
    504507
    505508        /** Public Methods ********************************************************/
     509
     510        /**
     511         * Setup the BuddyPress theme directory
     512         *
     513         * @since BuddyPress (1.5)
     514         * @todo Move bp-default to wordpress.org/extend/themes and remove this
     515         */
     516        public function register_theme_directory() {
     517                register_theme_directory( $this->old_themes_dir );
     518        }
    506519
    507520        /**
Note: See TracChangeset for help on using the changeset viewer.