Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/03/2011 09:03:41 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Add bp-pages admin interface for all components. Rename bp-pages related functions to match existing nomenclature. Introduce 'has_directory' variable in BP_Component class to assist in pairing page slugs to component directories. Set 'path' variable in components that were missing them. Clean up white space where tabs were used instead of spaces. See #3428. Props boonebgorges.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-component.php

    r4912 r4920  
    3434     */
    3535    var $slug;
     36   
     37    /**
     38     * @var bool Does this component need a top-level directory?
     39     */
     40    var $has_directory;
    3641
    3742    /**
     
    108113            'slug'                  => '',
    109114            'root_slug'             => '',
     115            'has_directory'         => false,
    110116            'notification_callback' => '',
    111117            'search_string'         => '',
     
    114120        $r = wp_parse_args( $args, $defaults );
    115121
    116         // Slug used for permalinks
     122        // Slug used for permalink URI chunk after root
    117123        $this->slug          = apply_filters( 'bp_' . $this->id . '_slug',          $r['slug']          );
    118124
    119125        // Slug used for root directory
    120126        $this->root_slug     = apply_filters( 'bp_' . $this->id . '_root_slug',     $r['root_slug']     );
     127
     128        // Does this component have a top-level directory?
     129        $this->has_directory = apply_filters( 'bp_' . $this->id . '_has_directory', $r['has_directory'] );
    121130
    122131        // Search string
     
    133142        /** BuddyPress ********************************************************/
    134143
    135         // Register this component in the active components array
     144        // Register this component in the loaded components array
    136145        $bp->loaded_components[$this->slug] = $this->id;
    137146
     
    183192     */
    184193    function setup_actions() {
    185         // Register post types
    186         add_action( 'bp_setup_globals',            array ( $this, 'setup_globals'            ), 10 );
    187 
    188         // Include required files. Called early to ensure that BP core components are
    189         // loaded before plugins that hook their loader functions to bp_include with
    190         // the default priority of 10. This is for backwards compatibility; henceforth,
    191         // plugins should register themselves by extending this base class.
    192         add_action( 'bp_include',                  array ( $this, 'includes'                 ), 8 );
    193 
    194         // Register post types
    195         add_action( 'bp_setup_nav',                array ( $this, 'setup_nav'                ), 10 );
    196 
    197         // Register post types
    198         add_action( 'bp_setup_admin_bar',          array ( $this, 'setup_admin_bar'          ), 10 );
    199 
    200         // Register post types
    201         add_action( 'bp_setup_title',              array ( $this, 'setup_title'              ), 10 );
    202 
    203         // Register post types
    204         add_action( 'bp_register_post_types',      array ( $this, 'register_post_types'      ), 10 );
     194
     195        // Register post types
     196        add_action( 'bp_setup_globals',          array ( $this, 'setup_globals'          ), 10 );
     197
     198        // Include required files. Called early to ensure that BP core
     199        // components are loaded before plugins that hook their loader functions
     200        // to bp_include with the default priority of 10. This is for backwards
     201        // compatibility; henceforth, plugins should register themselves by
     202        // extending this base class.
     203        add_action( 'bp_include',                array ( $this, 'includes'               ), 8 );
     204
     205        // Register post types
     206        add_action( 'bp_setup_nav',              array ( $this, 'setup_nav'              ), 10 );
     207
     208        // Register post types
     209        add_action( 'bp_setup_admin_bar',        array ( $this, 'setup_admin_bar'        ), 10 );
     210
     211        // Register post types
     212        add_action( 'bp_setup_title',            array ( $this, 'setup_title'            ), 10 );
     213
     214        // Register post types
     215        add_action( 'bp_register_post_types',    array ( $this, 'register_post_types'    ), 10 );
    205216
    206217        // Register taxonomies
    207         add_action( 'bp_register_taxonomies',      array ( $this, 'register_taxonomies'      ), 10 );
     218        add_action( 'bp_register_taxonomies',    array ( $this, 'register_taxonomies'    ), 10 );
    208219
    209220        // Add the rewrite tags
    210         add_action( 'bp_add_rewrite_tags',         array ( $this, 'add_rewrite_tags'         ), 10 );
     221        add_action( 'bp_add_rewrite_tags',       array ( $this, 'add_rewrite_tags'       ), 10 );
    211222
    212223        // Generate rewrite rules
    213         add_action( 'bp_generate_rewrite_rules',   array ( $this, 'generate_rewrite_rules'  ), 10 );
     224        add_action( 'bp_generate_rewrite_rules', array ( $this, 'generate_rewrite_rules' ), 10 );
    214225
    215226        // Additional actions can be attached here
Note: See TracChangeset for help on using the changeset viewer.