Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/15/2010 04:56:01 AM (16 years ago)
Author:
johnjamesjacoby
Message:

Move loader functions out of needless class, and whitespace fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-loader.php

    r2597 r2599  
    11<?php
    2 
    3 if ( !class_exists( 'BBP_Loader' ) ) :
    42/**
    5  * BBP_Loader
     3 * bbp-loader.php
    64 *
    7  * tap tap tap... Is this thing on?
     5 * The main bbPress loader. Action priorities included for the sake of human
     6 * readability and clarification.
    87 *
    98 * @package bbPress
    … …  
    1211 *
    1312 */
    14 class BBP_Loader {
    1513
    16         /**
    17          * The main bbPress loader. Action priorities included within this function
    18          * are for the sake of human readability and clarification.
    19          */
    20         function BBP_Loader () {
    21                 // Attach to WordPress actions
    22                 add_action( 'plugins_loaded', array ( $this, 'loaded'                   ), 10 );
    23                 add_action( 'init',           array ( $this, 'init'                     ), 10 );
     14// Attach to WordPress actions
     15add_action( 'plugins_loaded', 'bbp_loaded'                   , 10 );
     16add_action( 'init',           'bbp_init'                     , 10 );
    2417
    25                 // Attach to bbp_loaded.
    26                 add_action( 'bbp_loaded',     array ( $this, 'constants'                ), 2  );
    27                 add_action( 'bbp_loaded',     array ( $this, 'boot_strap_globals'       ), 4  );
    28                 add_action( 'bbp_loaded',     array ( $this, 'includes'                 ), 6  );
    29                 add_action( 'bbp_loaded',     array ( $this, 'setup_globals'            ), 8  );
    30                 add_action( 'bbp_loaded',     array ( $this, 'register_theme_directory' ), 10 );
     18// Attach to bbp_loaded.
     19add_action( 'bbp_loaded',     'bbp_constants'                , 2  );
     20add_action( 'bbp_loaded',     'bbp_boot_strap_globals'       , 4  );
     21add_action( 'bbp_loaded',     'bbp_includes'                 , 6  );
     22add_action( 'bbp_loaded',     'bbp_setup_globals'            , 8  );
     23add_action( 'bbp_loaded',     'bbp_register_theme_directory' , 10 );
    3124
    32                 // Attach to bbp_init.
    33                 add_action( 'bbp_init',       array ( $this, 'register_post_types'      ), 6  );
    34                 add_action( 'bbp_init',       array ( $this, 'register_taxonomies'      ), 8  );
    35                 add_action( 'bbp_init',       array ( $this, 'register_textdomain',     ), 10 );
     25// Attach to bbp_init.
     26add_action( 'bbp_init',       'bbp_register_post_types'      , 6  );
     27add_action( 'bbp_init',       'bbp_register_taxonomies'      , 8  );
     28add_action( 'bbp_init',       'bbp_register_textdomain'      , 10 );
    3629
    37                 // Register bbPress activation/deactivation sequences
    38                 register_activation_hook  ( __FILE__, array ( $this, 'activation'       ), 10 );
    39                 register_deactivation_hook( __FILE__, array ( $this, 'deactivation'     ), 10 );
    40         }
     30// Register bbPress activation/deactivation sequences
     31register_activation_hook  ( __FILE__, 'bbp_activation'       , 10 );
     32register_deactivation_hook( __FILE__, 'bbp_deactivation'     , 10 );
    4133
    42         /**
    43          * constants ()
    44          *
    45          * Setup constants
    46          */
    47         function constants () {
    48                 do_action( 'bbp_constants' );
    49         }
    50 
    51         /**
    52          * boot_strap_globals ()
    53          *
    54          * Setup globals BEFORE includes
    55          */
    56         function boot_strap_globals () {
    57                 do_action( 'bbp_boot_strap_globals' );
    58         }
    59 
    60         /**
    61          * includes ()
    62          *
    63          * Include files
    64          */
    65         function includes () {
    66                 do_action( 'bbp_includes' );
    67         }
    68 
    69         /**
    70          * setup_globals ()
    71          *
    72          * Setup globals AFTER includes
    73          */
    74         function setup_globals () {
    75                 do_action( 'bbp_setup_globals' );
    76         }
    77 
    78         /**
    79          * loaded ()
    80          *
    81          * Main action responsible for constants, globals, and includes
    82          */
    83         function loaded () {
    84                 do_action( 'bbp_loaded' );
    85         }
    86 
    87         /**
    88          * init ()
    89          *
    90          * Initialize any code after everything has been loaded
    91          */
    92         function init () {
    93                 do_action ( 'bbp_init' );
    94         }
    95 
    96         /**
    97          * register_textdomain ()
    98          *
    99          * Load translations for current language
    100          */
    101         function register_textdomain () {
    102                 do_action( 'bbp_load_textdomain' );
    103         }
    104 
    105         /**
    106          * register_theme_directory ()
    107          *
    108          * Sets up the theme directory
    109          *
    110          * @since bbPress (r2507)
    111          */
    112         function register_theme_directory () {
    113                 do_action( 'bbp_register_theme_directory' );
    114         }
    115 
    116         /**
    117          * register_post_types ()
    118          *
    119          * Setup the post types
    120          *
    121          * @since bbPress (r2464)
    122          */
    123         function register_post_types () {
    124                 do_action ( 'bbp_register_post_types' );
    125         }
    126 
    127         /**
    128          * register_taxonomies ()
    129          *
    130          * Register the built in bbPress taxonomies
    131          *
    132          * @since bbPress (r2464)
    133          */
    134         function register_taxonomies () {
    135                 do_action ( 'bbp_register_taxonomies' );
    136         }
    137 
    138         /**
    139          * activation ()
    140          *
    141          * Runs on bbPress activation
    142          *
    143          * @since bbPress (r2509)
    144          */
    145         function activation () {
    146                 do_action( 'bbp_activation' );
    147         }
    148 
    149         /**
    150          * deactivation ()
    151          *
    152          * Runs on bbPress deactivation
    153          *
    154          * @since bbPress (r2509)
    155          */
    156         function deactivation () {
    157                 do_action( 'bbp_deactivation' );
    158         }
    159 
    160         /**
    161          * uninstall ()
    162          *
    163          * Runs when uninstalling bbPress
    164          *
    165          * @since bbPress (r2509)
    166          */
    167         function uninstall () {
    168                 do_action( 'bbp_uninstall' );
    169         }
     34/**
     35 * bbp_bbp_constants ()
     36 *
     37 * Setup constants
     38 */
     39function bbp_constants () {
     40        do_action( 'bbp_constants' );
    17041}
    17142
    172 $bbp->loader = new BBP_Loader();
     43/**
     44 * boot_strap_globals ()
     45 *
     46 * Setup globals BEFORE includes
     47 */
     48function bbp_boot_strap_globals () {
     49        do_action( 'bbp_boot_strap_globals' );
     50}
    17351
    174 endif; // class_exists check
     52/**
     53 * bbp_includes ()
     54 *
     55 * Include files
     56 */
     57function bbp_includes () {
     58        do_action( 'bbp_includes' );
     59}
     60
     61/**
     62 * bbp_setup_globals ()
     63 *
     64 * Setup globals AFTER includes
     65 */
     66function bbp_setup_globals () {
     67        do_action( 'bbp_setup_globals' );
     68}
     69
     70/**
     71 * bbp_loaded ()
     72 *
     73 * Main action responsible for constants, globals, and includes
     74 */
     75function bbp_loaded () {
     76        do_action( 'bbp_loaded' );
     77}
     78
     79/**
     80 * bbp_init ()
     81 *
     82 * Initialize any code after everything has been loaded
     83 */
     84function bbp_init () {
     85        do_action ( 'bbp_init' );
     86}
     87
     88/**
     89 * register_textdomain ()
     90 *
     91 * Load translations for current language
     92 */
     93function bbp_register_textdomain () {
     94        do_action( 'bbp_load_textdomain' );
     95}
     96
     97/**
     98 * bbp_register_theme_directory ()
     99 *
     100 * Sets up the theme directory
     101 *
     102 * @since bbPress (r2507)
     103 */
     104function bbp_register_theme_directory () {
     105        do_action( 'bbp_register_theme_directory' );
     106}
     107
     108/**
     109 * bbp_register_post_types ()
     110 *
     111 * Setup the post types
     112 *
     113 * @since bbPress (r2464)
     114 */
     115function bbp_register_post_types () {
     116        do_action ( 'bbp_register_post_types' );
     117}
     118
     119/**
     120 * bbp_register_taxonomies ()
     121 *
     122 * Register the built in bbPress taxonomies
     123 *
     124 * @since bbPress (r2464)
     125 */
     126function bbp_register_taxonomies () {
     127        do_action ( 'bbp_register_taxonomies' );
     128}
     129
     130/**
     131 * bbp_activation ()
     132 *
     133 * Runs on bbPress activation
     134 *
     135 * @since bbPress (r2509)
     136 */
     137function bbp_activation () {
     138        do_action( 'bbp_activation' );
     139}
     140
     141/**
     142 * bbp_deactivation ()
     143 *
     144 * Runs on bbPress deactivation
     145 *
     146 * @since bbPress (r2509)
     147 */
     148function bbp_deactivation () {
     149        do_action( 'bbp_deactivation' );
     150}
     151
     152/**
     153 * bbp_uninstall ()
     154 *
     155 * Runs when uninstalling bbPress
     156 *
     157 * @since bbPress (r2509)
     158 */
     159function bbp_uninstall () {
     160        do_action( 'bbp_uninstall' );
     161}
    175162
    176163?>
Note: See TracChangeset for help on using the changeset viewer.