Skip to:
Content

bbPress.org

Changeset 2594


Ignore:
Timestamp:
11/15/2010 02:02:09 AM (16 years ago)
Author:
johnjamesjacoby
Message:

Move bbp_loader.php into includes. Rename run-file to bbpress.php. Remove references to 1.2 version and replace with 'plugin'

Location:
branches/plugin
Files:
1 added
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/bbp-settings.php

    r2582 r2594  
    11<?php
    22
     3
     4class BBP_Admin_Settings {
     5
     6        function bbp_admin_settings () {
     7                // Register settings
     8                add_action( 'admin_init', array( $this, 'register_settings' ) );
     9
     10                // Create the settings page
     11                add_action( 'admin_menu', array( $this, 'settings_page' ) );
     12
     13        }
     14}
     15
    316?>
  • branches/plugin/bbp-includes/bbp-admin.php

    r2593 r2594  
    99 * @package bbPress
    1010 * @subpackage Admin
    11  * @since bbPress (1.2-r2464)
     11 * @since bbPress (r2464)
    1212 */
    1313class BBP_Admin {
    … …  
    568568 * @package bbPress
    569569 * @subpackage Template Tags
    570  * @since bbPress (1.2-r2464)
     570 * @since bbPress (r2464)
    571571 *
    572572 * @todo A better job at rearranging and separating top level menus
    … …  
    588588 * @package bbPress
    589589 * @subpackage Template Tags
    590  * @since bbPress (1.2-r2464)
     590 * @since bbPress (r2464)
    591591 *
    592592 * @todo Alot ;)
    … …  
    629629 * @package bbPress
    630630 * @subpackage Template Tags
    631  * @since bbPress (1.2-r2464)
     631 * @since bbPress (r2464)
    632632 *
    633633 * @todo Alot ;)
    … …  
    665665 * @package bbPress
    666666 * @subpackage Template Tags
    667  * @since bbPress (1.2-r2464)
     667 * @since bbPress (r2464)
    668668 *
    669669 * @param string $title
  • branches/plugin/bbp-includes/bbp-classes.php

    r2593 r2594  
    11<?php
    2 
    3 if ( !class_exists( 'BBP_Main' ) ) :
    4 /**
    5  * BBP_Main
    6  *
    7  * The main bbPress container class
    8  *
    9  * @package bbPress
    10  * @subpackage Loader
    11  * @since bbPress (1.2-r2464)
    12  *
    13  * @todo Alot ;)
    14  */
    15 class BBP_Main {
    16 
    17         function bbp_main () {
    18                 // Setup globals
    19                 add_action ( 'bbp_setup_globals', array( $this, 'setup_globals' ) );
    20 
    21                 // wp_head
    22                 add_action ( 'bbp_head',          array( $this, 'enqueue_scripts' ) );
    23         }
    24 
    25         /**
    26          * setup_globals ()
    27          *
    28          * Setup all plugin global
    29          *
    30          * @global object $wpdb
    31          */
    32         function setup_globals () {
    33                 global $wpdb;
    34 
    35                 // For internal identification
    36                 $this->id        = BBP_FORUM_POST_TYPE_ID;
    37                 $this->slug      = BBP_SLUG;
    38                 $this->settings  = BBP_Main::settings();
    39 
    40                 // Register this in the active components array
    41                 $this->active_components[$this->slug] = $this->id;
    42         }
    43 
    44         /**
    45          * settings ()
    46          *
    47          * Loads up any saved settings and filters each default value
    48          *
    49          * @return array
    50          */
    51         function settings () {
    52 
    53                 // @todo site|network wide forum option? Don't see why not both?
    54                 $settings = get_site_option( 'bbp_settings', false );
    55 
    56                 // Set default values and allow them to be filtered
    57                 $defaults = array (
    58                         // the cake is a lie
    59                 );
    60 
    61                 // Allow settings array to be filtered and return
    62                 return apply_filters( 'bbp_settings', wp_parse_args( $settings, $defaults ) );
    63         }
    64 
    65         /**
    66          * enqueue_scripts ()
    67          *
    68          * Hooks into wp_head ()
    69          *
    70          * @return Only return if no data to display
    71          */
    72         function enqueue_scripts () {
    73                 // Load up the JS
    74                 wp_enqueue_script( 'jquery' );
    75 
    76                 do_action( 'bbp_enqueue_scripts' );
    77         }
    78 }
    79 endif; // class_exists check
    80 
    81 class BBP_Forum {
    82         function bbp_forum() {
    83 
    84         }
    85 }
    86 
    87 class BBP_Topic {
    88         function bbp_topic() {
    89 
    90         }
    91 }
    92 
    93 class BBP_Post {
    94         function bbp_post() {
    95 
    96         }
    97 }
    98 
    99 class BBP_User {
    100         function bbp_user() {
    101 
    102         }
    103 }
    104 
    1052
    1063if ( class_exists( 'Walker' ) ) :
    … …  
    1096 *
    1107 * @package bbPress
    111  * @since 1.2-r2514
     8 * @since r2514
    1129 * @uses Walker
    11310 */
    … …  
    11512        /**
    11613         * @see Walker::$tree_type
    117          * @since 1.2-r2514
     14         * @since r2514
    11815         * @var string
    11916         */
    … …  
    12219        /**
    12320         * @see Walker::$db_fields
    124          * @since 1.2-r2514
     21         * @since r2514
    12522         * @var array
    12623         */
    … …  
    13027         * @see Walker::start_lvl()
    13128         *
    132          * @since 1.2-r2514
     29         * @since r2514
    13330         *
    13431         * @param string $output Passed by reference. Used to append additional content.
    … …  
    14340         * @see Walker::end_lvl()
    14441         *
    145          * @since 1.2-r2514
     42         * @since r2514
    14643         *
    14744         * @param string $output Passed by reference. Used to append additional content.
    … …  
    15653         * @see Walker::start_el()
    15754         *
    158          * @since 1.2-r2514
     55         * @since r2514
    15956         *
    16057         * @param string $output Passed by reference. Used to append additional content.
    … …  
    204101         * @see Walker::end_el()
    205102         *
    206          * @since 1.2-r2514
     103         * @since r2514
    207104         *
    208105         * @param string $output Passed by reference. Used to append additional content.
  • branches/plugin/bbp-includes/bbp-functions.php

    r2593 r2594  
    88 * @package bbPress
    99 * @subpackage Functions
    10  * @since bbPress (1.2-r2464)
     10 * @since bbPress (r2464)
    1111 *
    1212 * @uses is_super_admin ()
    … …  
    3333 * @package bbPress
    3434 * @subpackage Functions
    35  * @since bbPress (1.2-r2485)
     35 * @since bbPress (r2485)
    3636 *
    3737 * @param string $number Number to format
    … …  
    5454 * @package bbPress
    5555 * @subpackage Functions
    56  * @since bbPress (1.2-r2455)
     56 * @since bbPress (r2455)
    5757 *
    5858 * @param int|object $post Optional, default is global post object. A post_id or post object
    … …  
    8383 * @package bbPress
    8484 * @subpackage Functions
    85  * @since bbPress (1.2-r2454)
     85 * @since bbPress (r2454)
    8686 *
    8787 * @param $time
    … …  
    9797         * @package bbPress
    9898         * @subpackage Functions
    99          * @since bbPress (1.2-r2454)
     99         * @since bbPress (r2454)
    100100         *
    101101         * @param $time
    … …  
    264264 * Return sticky topics from forum
    265265 *
    266  * @since bbPress (1.2-r2592)
     266 * @since bbPress (r2592)
    267267 * @param int $forum_id
    268268 * @return array Post ID's of sticky topics
    … …  
    287287 * Return topics stuck to front page of forums
    288288 *
    289  * @since bbPress (1.2-r2592)
     289 * @since bbPress (r2592)
    290290 * @return array Post ID's of super sticky topics
    291291 */
  • branches/plugin/bbp-includes/bbp-loader.php

    r2593 r2594  
    11<?php
    2 /*
    3 Plugin Name: bbPress
    4 Plugin URI: http://bbpress.org
    5 Description: bbPress is forum software with a twist from the creators of WordPress.
    6 Author: The bbPress Community
    7 Version: 1.2-bleeding
    8 */
    9 
    10 /**
    11  * Set the version early so other plugins have an inexpensive
    12  * way to check if bbPress is already loaded.
    13  *
    14  * Note: Loaded does NOT mean initialized
    15  */
    16 define( 'BBP_VERSION', '1.2-bleeding' );
    17 
    18 /** And now for something so unbelievable it's.... UNBELIEVABLE! */
    192
    203if ( !class_exists( 'BBP_Loader' ) ) :
    … …  
    269 * @package bbPress
    2710 * @subpackage Loader
    28  * @since bbPress (1.2-r2464)
     11 * @since bbPress (r2464)
    2912 *
    3013 */
    … …  
    5437
    5538                // Attach post type registration to bbp_init.
    56                 add_action( 'bbp_init',        array ( $this, 'register_post_types' ) );
     39                add_action( 'bbp_init',        array ( $this, 'register_content_types' ) );
    5740
    5841                // Attach topic tag registration bbp_init.
    … …  
    7255         */
    7356        function constants () {
    74 
    75                 // Let plugins sneak in and predefine constants
    76                 do_action( 'bbp_constants_pre' );
    77 
    78                 // Turn debugging on/off
    79                 if ( !defined( 'BBP_DEBUG' ) )
    80                         define( 'BBP_DEBUG', WP_DEBUG );
    81 
    82                 // The default forum post type ID
    83                 if ( !defined( 'BBP_FORUM_POST_TYPE_ID' ) )
    84                         define( 'BBP_FORUM_POST_TYPE_ID', apply_filters( 'bbp_forum_post_type_id', 'bbp_forum' ) );
    85 
    86                 // The default topic post type ID
    87                 if ( !defined( 'BBP_TOPIC_POST_TYPE_ID' ) )
    88                         define( 'BBP_TOPIC_POST_TYPE_ID', apply_filters( 'bbp_topic_post_type_id', 'bbp_topic' ) );
    89 
    90                 // The default reply post type ID
    91                 if ( !defined( 'BBP_REPLY_POST_TYPE_ID' ) )
    92                         define( 'BBP_REPLY_POST_TYPE_ID', apply_filters( 'bbp_reply_post_type_id', 'bbp_reply' ) );
    93 
    94                 // The default topic taxonomy ID
    95                 if ( !defined( 'BBP_TOPIC_TAG_ID' ) )
    96                         define( 'BBP_TOPIC_TAG_ID', apply_filters( 'bbp_topic_tag_id', 'bbp_topic_tag' ) );
    97 
    98                 // Default slug for root component
    99                 if ( !defined( 'BBP_ROOT_SLUG' ) )
    100                         define( 'BBP_ROOT_SLUG', apply_filters( 'bbp_root_slug', 'forums' ) );
    101 
    102                 // Default slug for topics post type
    103                 if ( !defined( 'BBP_FORUM_SLUG' ) )
    104                         define( 'BBP_FORUM_SLUG', apply_filters( 'bbp_forum_slug', 'forum' ) );
    105 
    106                 // Default slug for topics post type
    107                 if ( !defined( 'BBP_TOPIC_SLUG' ) )
    108                         define( 'BBP_TOPIC_SLUG', apply_filters( 'bbp_topic_slug', 'topic' ) );
    109 
    110                 // Default slug for topic reply post type
    111                 if ( !defined( 'BBP_REPLY_SLUG' ) )
    112                         define( 'BBP_REPLY_SLUG', apply_filters( 'bbp_reply_slug', 'reply' ) );
    113 
    114                 // Default slug for topic tag taxonomy
    115                 if ( !defined( 'BBP_TOPIC_TAG_SLUG' ) )
    116                         define( 'BBP_TOPIC_TAG_SLUG', apply_filters( 'bbp_topic_tag_slug', 'topic-tag' ) );
    117 
    118                 // bbPress root directory
    119                 define( 'BBP_DIR', plugin_dir_path( __FILE__ ) );
    120                 define( 'BBP_URL', plugin_dir_url( __FILE__ ) );
    121 
    122                 // Images URL
    123                 define( 'BBP_IMAGES_URL', BBP_URL . '/bbp-images' );
    124 
    125                 // Themes directory and url
    126                 define( 'BBP_THEMES_DIR', BBP_DIR . '/bbp-themes' );
    127                 define( 'BBP_THEMES_URL', BBP_URL . '/bbp-themes' );
    128 
    129                 /**
    130                  * Constants have been defined
    131                  */
    13257                do_action( 'bbp_constants' );
    13358        }
    … …  
    14166         */
    14267        function includes () {
    143 
    144                 // Let plugins sneak in and include code ahead of bbPress
    145                 do_action( 'bbp_includes_pre' );
    146 
    147                 // Load the files
    148                 require_once ( BBP_DIR . '/bbp-includes/bbp-caps.php' );
    149                 require_once ( BBP_DIR . '/bbp-includes/bbp-filters.php' );
    150                 require_once ( BBP_DIR . '/bbp-includes/bbp-classes.php' );
    151                 require_once ( BBP_DIR . '/bbp-includes/bbp-functions.php' );
    152                 require_once ( BBP_DIR . '/bbp-includes/bbp-templatetags.php' );
    153 
    154                 // Are we going back to 1985 to fight Biff?
    155                 if ( defined( 'BBP_LOAD_LEGACY' ) )
    156                         require_once ( BBP_DIR . '/bbp-includes/bbp-legacy.php' );
    157 
    158                 // Quick admin check and load if needed
    159                 if ( is_admin() )
    160                         require_once ( BBP_DIR . '/bbp-includes/bbp-admin.php' );
    161 
    162                 /**
    163                  * Everything has been included
    164                  */
    16568                do_action( 'bbp_includes' );
    16669        }
    … …  
    19699         */
    197100        function textdomain () {
    198                 $locale = apply_filters( 'bbp_textdomain', get_locale() );
    199 
    200                 $mofile = BBP_DIR . "/bbp-languages/bbpress-{$locale}.mo";
    201 
    202                 load_textdomain( 'bbpress', $mofile );
    203 
    204                 /**
    205                  * Text domain has been loaded
    206                  */
    207101                do_action( 'bbp_load_textdomain' );
    208102        }
    … …  
    213107         * Sets up the bbPress theme directory to use in WordPress
    214108         *
    215          * @since bbPress (1.2-r2507)
     109         * @since bbPress (r2507)
    216110         * @uses register_theme_directory
    217111         */
    218112        function register_theme_directory () {
    219                 register_theme_directory( BBP_THEMES_DIR );
    220 
    221                 /**
    222                  * Theme directory has been registered
    223                  */
    224113                do_action( 'bbp_register_theme_directory' );
    225114        }
    226115
    227116        /**
    228          * register_post_types ()
     117         * register_content_types ()
    229118         *
    230119         * Setup the post types and taxonomy for forums
    … …  
    232121         * @todo Finish up the post type admin area with messages, columns, etc...*
    233122         */
    234         function register_post_types () {
    235 
    236                 // Forum labels
    237                 $forum_labels = array (
    238                         'name'                  => __( 'Forums', 'bbpress' ),
    239                         'singular_name'         => __( 'Forum', 'bbpress' ),
    240                         'add_new'               => __( 'New Forum', 'bbpress' ),
    241                         'add_new_item'          => __( 'Create New Forum', 'bbpress' ),
    242                         'edit'                  => __( 'Edit', 'bbpress' ),
    243                         'edit_item'             => __( 'Edit Forum', 'bbpress' ),
    244                         'new_item'              => __( 'New Forum', 'bbpress' ),
    245                         'view'                  => __( 'View Forum', 'bbpress' ),
    246                         'view_item'             => __( 'View Forum', 'bbpress' ),
    247                         'search_items'          => __( 'Search Forums', 'bbpress' ),
    248                         'not_found'             => __( 'No forums found', 'bbpress' ),
    249                         'not_found_in_trash'    => __( 'No forums found in Trash', 'bbpress' ),
    250                         'parent_item_colon'     => __( 'Parent Forum:', 'bbpress' )
    251                 );
    252 
    253                 // Forum rewrite
    254                 $forum_rewrite = array (
    255                         'slug'              => BBP_FORUM_SLUG,
    256                         'with_front'        => false
    257                 );
    258 
    259                 // Forum supports
    260                 $forum_supports = array (
    261                         'title',
    262                         'editor',
    263                         'thumbnail',
    264                         'excerpt',
    265                         'page-attributes'
    266                 );
    267 
    268                 // Register Forum post type
    269                 register_post_type (
    270                         BBP_FORUM_POST_TYPE_ID,
    271                         apply_filters( 'bbp_register_forum_post_type',
    272                                 array (
    273                                         'labels'            => $forum_labels,
    274                                         'rewrite'           => $forum_rewrite,
    275                                         'supports'          => $forum_supports,
    276                                         'capabilities'      => bbp_get_forum_caps(),
    277                                         'capability_type'   => 'forum',
    278                                         'menu_position'     => '100',
    279                                         'public'            => true,
    280                                         'show_ui'           => true,
    281                                         'can_export'        => true,
    282                                         'hierarchical'      => true,
    283                                         'query_var'         => true,
    284                                         'menu_icon'         => ''
    285                                 )
    286                         )
    287                 );
    288 
    289                 // Topic labels
    290                 $topic_labels = array (
    291                         'name'                  => __( 'Topics', 'bbpress' ),
    292                         'singular_name'         => __( 'Topic', 'bbpress' ),
    293                         'add_new'               => __( 'New Topic', 'bbpress' ),
    294                         'add_new_item'          => __( 'Create New Topic', 'bbpress' ),
    295                         'edit'                  => __( 'Edit', 'bbpress' ),
    296                         'edit_item'             => __( 'Edit Topic', 'bbpress' ),
    297                         'new_item'              => __( 'New Topic', 'bbpress' ),
    298                         'view'                  => __( 'View Topic', 'bbpress' ),
    299                         'view_item'             => __( 'View Topic', 'bbpress' ),
    300                         'search_items'          => __( 'Search Topics', 'bbpress' ),
    301                         'not_found'             => __( 'No topics found', 'bbpress' ),
    302                         'not_found_in_trash'    => __( 'No topics found in Trash', 'bbpress' ),
    303                         'parent_item_colon'     => __( 'Forum:', 'bbpress' )
    304                 );
    305 
    306                 // Topic rewrite
    307                 $topic_rewrite = array (
    308                         'slug'          => BBP_TOPIC_SLUG,
    309                         'with_front'    => false
    310                 );
    311 
    312                 // Topic supports
    313                 $topic_supports = array (
    314                         'title',
    315                         'editor',
    316                         'thumbnail',
    317                         'excerpt'
    318                 );
    319 
    320                 // Register topic post type
    321                 register_post_type (
    322                         BBP_TOPIC_POST_TYPE_ID,
    323                         apply_filters( 'bbp_register_topic_post_type',
    324                                 array (
    325                                         'labels'            => $topic_labels,
    326                                         'rewrite'           => $topic_rewrite,
    327                                         'supports'          => $topic_supports,
    328                                         'capabilities'      => bbp_get_topic_caps(),
    329                                         'capability_type'   => 'topic',
    330                                         'menu_position'     => '100',
    331                                         'public'            => true,
    332                                         'show_ui'           => true,
    333                                         'can_export'        => true,
    334                                         'hierarchical'      => false,
    335                                         'query_var'         => true,
    336                                         'menu_icon'         => ''
    337                                 )
    338                         )
    339                 );
    340 
    341                 // Reply labels
    342                 $reply_labels = array (
    343                         'name'                  => __( 'Replies', 'bbpress' ),
    344                         'singular_name'         => __( 'Reply', 'bbpress' ),
    345                         'add_new'               => __( 'New Reply', 'bbpress' ),
    346                         'add_new_item'          => __( 'Create New Reply', 'bbpress' ),
    347                         'edit'                  => __( 'Edit', 'bbpress' ),
    348                         'edit_item'             => __( 'Edit Reply', 'bbpress' ),
    349                         'new_item'              => __( 'New Reply', 'bbpress' ),
    350                         'view'                  => __( 'View Reply', 'bbpress' ),
    351                         'view_item'             => __( 'View Reply', 'bbpress' ),
    352                         'search_items'          => __( 'Search Replies', 'bbpress' ),
    353                         'not_found'             => __( 'No replies found', 'bbpress' ),
    354                         'not_found_in_trash'    => __( 'No replies found in Trash', 'bbpress' ),
    355                         'parent_item_colon'     => __( 'Topic:', 'bbpress' )
    356                 );
    357 
    358                 // Reply rewrite
    359                 $reply_rewrite = array (
    360                         'slug'        => BBP_REPLY_SLUG,
    361                         'with_front'  => false
    362                 );
    363 
    364                 // Reply supports
    365                 $reply_supports = array (
    366                         'title',
    367                         'editor',
    368                         'thumbnail',
    369                         'excerpt'
    370                 );
    371 
    372                 // Register topic reply post type
    373                 register_post_type (
    374                         BBP_REPLY_POST_TYPE_ID,
    375                         apply_filters( 'bbp_register_topic_reply_post_type',
    376                                 array (
    377                                         'labels'            => $reply_labels,
    378                                         'rewrite'           => $reply_rewrite,
    379                                         'supports'          => $reply_supports,
    380                                         'capabilities'      => bbp_get_reply_caps(),
    381                                         'capability_type'   => 'reply',
    382                                         'menu_position'     => '100',
    383                                         'public'            => true,
    384                                         'show_ui'           => true,
    385                                         'can_export'        => true,
    386                                         'hierarchical'      => false,
    387                                         'query_var'         => true,
    388                                         'menu_icon'         => ''
    389                                 )
    390                         )
    391                 );
    392 
    393                 /**
    394                  * Post types have been registered
    395                  */
    396                 do_action ( 'bbp_register_post_types' );
     123        function register_content_types () {
     124                do_action ( 'bbp_register_content_types' );
    397125        }
    398126
    … …  
    402130         * Register the built in bbPress taxonomies
    403131         *
    404          * @since bbPress (1.2-r2464)
     132         * @since bbPress (r2464)
    405133         *
    406134         * @uses register_taxonomy()
    … …  
    408136         */
    409137        function register_taxonomies () {
    410 
    411                 // Topic tag labels
    412                 $topic_tag_labels = array (
    413                         'name'              => __( 'Topic Tags', 'bbpress' ),
    414                         'singular_name'     => __( 'Topic Tag', 'bbpress' ),
    415                         'search_items'      => __( 'Search Tags', 'bbpress' ),
    416                         'popular_items'     => __( 'Popular Tags', 'bbpress' ),
    417                         'all_items'         => __( 'All Tags', 'bbpress' ),
    418                         'edit_item'         => __( 'Edit Tag', 'bbpress' ),
    419                         'update_item'       => __( 'Update Tag', 'bbpress' ),
    420                         'add_new_item'      => __( 'Add New Tag', 'bbpress' ),
    421                         'new_item_name'     => __( 'New Tag Name', 'bbpress' )
    422                 );
    423 
    424                 // Topic tag rewrite
    425                 $topic_tag_rewrite = array (
    426                         'slug'       => BBP_TOPIC_TAG_SLUG,
    427                         'with_front' => false
    428                 );
    429 
    430                 // Register the topic tag taxonomy
    431                 register_taxonomy (
    432                         BBP_TOPIC_TAG_ID,               // The topic tag ID
    433                         BBP_TOPIC_POST_TYPE_ID,         // The topic post type ID
    434                         apply_filters( 'bbp_register_topic_tag',
    435                                 array (
    436                                         'labels'                => $topic_tag_labels,
    437                                         'rewrite'               => $topic_tag_rewrite,
    438                                         'capabilities'          => bbp_get_topic_tag_caps(),
    439                                         'update_count_callback' => '_update_post_term_count',
    440                                         'query_var'             => true,
    441                                         'show_tagcloud'         => true,
    442                                         'hierarchical'          => false,
    443                                         'public'                => true,
    444                                         'show_ui'               => true
    445                                 )
    446                         )
    447                 );
    448 
    449                 /**
    450                  * Topic taxonomies have been registered
    451                  */
    452138                do_action ( 'bbp_register_taxonomies' );
    453139        }
    … …  
    458144         * Runs on bbPress activation
    459145         *
    460          * @since bbPress (1.2-r2509)
     146         * @since bbPress (r2509)
    461147         */
    462148        function activation () {
    463                 register_uninstall_hook( __FILE__, array( $this, 'uninstall' ) );
    464 
    465                 // Add caps to admin role
    466                 if ( $admin =& get_role( 'administrator' ) ) {
    467 
    468                         // Forum caps
    469                         $admin->add_cap( 'publish_forums' );
    470                         $admin->add_cap( 'edit_forums' );
    471                         $admin->add_cap( 'edit_others_forums' );
    472                         $admin->add_cap( 'delete_forums' );
    473                         $admin->add_cap( 'delete_others_forums' );
    474                         $admin->add_cap( 'read_private_forums' );
    475 
    476                         // Topic caps
    477                         $admin->add_cap( 'publish_topics' );
    478                         $admin->add_cap( 'edit_topics' );
    479                         $admin->add_cap( 'edit_others_topics' );
    480                         $admin->add_cap( 'delete_topics' );
    481                         $admin->add_cap( 'delete_others_topics' );
    482                         $admin->add_cap( 'read_private_topics' );
    483 
    484                         // Reply caps
    485                         $admin->add_cap( 'publish_replies' );
    486                         $admin->add_cap( 'edit_replies' );
    487                         $admin->add_cap( 'edit_others_replies' );
    488                         $admin->add_cap( 'delete_replies' );
    489                         $admin->add_cap( 'delete_others_replies' );
    490                         $admin->add_cap( 'read_private_replies' );
    491 
    492                         // Topic tag caps
    493                         $admin->add_cap( 'manage_topic_tags' );
    494                         $admin->add_cap( 'edit_topic_tags' );
    495                         $admin->add_cap( 'delete_topic_tags' );
    496                         $admin->add_cap( 'assign_topic_tags' );
    497                 }
    498 
    499                 // And caps to default role
    500                 if ( $default =& get_role( get_option( 'default_role' ) ) ) {
    501 
    502                         // Topic caps
    503                         $default->add_cap( 'publish_topics' );
    504                         $default->add_cap( 'edit_topics' );
    505 
    506                         // Reply caps
    507                         $default->add_cap( 'publish_replies' );
    508                         $default->add_cap( 'edit_replies' );
    509 
    510                         // Topic tag caps
    511                         $default->add_cap( 'assign_topic_tags' );
    512                 }
    513 
    514                 /**
    515                  * bbPress has been activated
    516                  */
    517149                do_action( 'bbp_activation' );
    518150        }
    … …  
    523155         * Runs on bbPress deactivation
    524156         *
    525          * @since bbPress (1.2-r2509)
     157         * @since bbPress (r2509)
    526158         */
    527159        function deactivation () {
    528                 // Add caps to admin role
    529                 if ( $admin =& get_role( 'administrator' ) ) {
    530 
    531                         // Forum caps
    532                         $admin->remove_cap( 'publish_forums' );
    533                         $admin->remove_cap( 'edit_forums' );
    534                         $admin->remove_cap( 'edit_others_forums' );
    535                         $admin->remove_cap( 'delete_forums' );
    536                         $admin->remove_cap( 'delete_others_forums' );
    537                         $admin->remove_cap( 'read_private_forums' );
    538 
    539                         // Topic caps
    540                         $admin->remove_cap( 'publish_topics' );
    541                         $admin->remove_cap( 'edit_topics' );
    542                         $admin->remove_cap( 'edit_others_topics' );
    543                         $admin->remove_cap( 'delete_topics' );
    544                         $admin->remove_cap( 'delete_others_topics' );
    545                         $admin->remove_cap( 'read_private_topics' );
    546 
    547                         // Reply caps
    548                         $admin->remove_cap( 'publish_replies' );
    549                         $admin->remove_cap( 'edit_replies' );
    550                         $admin->remove_cap( 'edit_others_replies' );
    551                         $admin->remove_cap( 'delete_replies' );
    552                         $admin->remove_cap( 'delete_others_replies' );
    553                         $admin->remove_cap( 'read_private_replies' );
    554 
    555                         // Topic tag caps
    556                         $admin->remove_cap( 'manage_topic_tags' );
    557                         $admin->remove_cap( 'edit_topic_tags' );
    558                         $admin->remove_cap( 'delete_topic_tags' );
    559                         $admin->remove_cap( 'assign_topic_tags' );
    560                 }
    561 
    562                 // And caps to default role
    563                 if ( $default =& get_role( get_option( 'default_role' ) ) ) {
    564 
    565                         // Topic caps
    566                         $default->remove_cap( 'publish_topics' );
    567                         $default->remove_cap( 'edit_topics' );
    568 
    569                         // Reply caps
    570                         $default->remove_cap( 'publish_replies' );
    571                         $default->remove_cap( 'edit_replies' );
    572 
    573                         // Topic tag caps
    574                         $default->remove_cap( 'assign_topic_tags' );
    575                 }
    576 
    577                 /**
    578                  * bbPress has been deactivated
    579                  */
    580160                do_action( 'bbp_deactivation' );
    581161        }
    … …  
    586166         * Runs when uninstalling bbPress
    587167         *
    588          * @since bbPress (1.2-r2509)
     168         * @since bbPress (r2509)
    589169         */
    590170        function uninstall () {
    591                 /**
    592                  * Uninstall bbPress
    593                  */
    594171                do_action( 'bbp_uninstall' );
    595172        }
  • branches/plugin/bbp-includes/bbp-templatetags.php

    r2593 r2594  
    1010 * @package bbPress
    1111 * @subpackage Template Tags
    12  * @since bbPress (1.2-r2464)
     12 * @since bbPress (r2464)
    1313*/
    1414function bbp_head () {
    … …  
    2424 * @package bbPress
    2525 * @subpackage Template Tags
    26  * @since bbPress (1.2-r2464)
     26 * @since bbPress (r2464)
    2727 */
    2828function bbp_footer () {
    … …  
    4242 * @package bbPress
    4343 * @subpackage Template Tags
    44  * @since bbPress (1.2-r2464)
     44 * @since bbPress (r2464)
    4545 *
    4646 * @global WP_Query $bbp_forums_template
    … …  
    7777 * @package bbPress
    7878 * @subpackage Template Tags
    79  * @since bbPress (1.2-r2464)
     79 * @since bbPress (r2464)
    8080 *
    8181 * @global WP_Query $bbp_forums_template
    … …  
    9494 * @package bbPress
    9595 * @subpackage Template Tags
    96  * @since bbPress (1.2-r2464)
     96 * @since bbPress (r2464)
    9797 *
    9898 * @global WP_Query $bbp_forums_template
    … …  
    111111 * @package bbPress
    112112 * @subpackage Template Tags
    113  * @since bbPress (1.2-r2464)
     113 * @since bbPress (r2464)
    114114 *
    115115 * @uses bbp_get_forum_id()
    … …  
    125125         * @package bbPress
    126126         * @subpackage Template Tags
    127          * @since bbPress (1.2-r2464)
     127         * @since bbPress (r2464)
    128128         *
    129129         * @global object $forums_template
    … …  
    160160 * @package bbPress
    161161 * @subpackage Template Tags
    162  * @since bbPress (1.2-r2464)
     162 * @since bbPress (r2464)
    163163 *
    164164 * @param int $forum_id optional
    … …  
    175175         * @package bbPress
    176176         * @subpackage Template Tags
    177          * @since bbPress (1.2-r2464)
     177         * @since bbPress (r2464)
    178178         *
    179179         * @param int $forum_id optional
    … …  
    196196 * @package bbPress
    197197 * @subpackage Template Tags
    198  * @since bbPress (1.2-r2464)
     198 * @since bbPress (r2464)
    199199 *
    200200 * @param int $forum_id optional
    … …  
    211211         * @package bbPress
    212212         * @subpackage Template Tags
    213          * @since bbPress (1.2-r2464)
     213         * @since bbPress (r2464)
    214214         *
    215215         * @param int $forum_id optional
    … …  
    233233 * @package bbPress
    234234 * @subpackage Template Tags
    235  * @since bbPress (1.2-r2464)
     235 * @since bbPress (r2464)
    236236 *
    237237 * @uses bbp_get_forum_last_active()
    … …  
    248248         * @package bbPress
    249249         * @subpackage Template Tags
    250          * @since bbPress (1.2-r2464)
     250         * @since bbPress (r2464)
    251251         *
    252252         * @return string
    … …  
    267267 * @package bbPress
    268268 * @subpackage Template Tags
    269  * @since bbPress (1.2-r2464)
     269 * @since bbPress (r2464)
    270270 *
    271271 * @uses bbp_get_forum_topic_count()
    … …  
    282282         * @package bbPress
    283283         * @subpackage Template Tags
    284          * @since bbPress (1.2-r2464)
     284         * @since bbPress (r2464)
    285285         *
    286286         * @todo stash and cache (see commented out code)
    … …  
    310310 * @package bbPress
    311311 * @subpackage Template Tags
    312  * @since bbPress (1.2-r2464)
     312 * @since bbPress (r2464)
    313313 *
    314314 * @todo make this not suck
    … …  
    332332 * @package bbPress
    333333 * @subpackage Template Tags
    334  * @since bbPress (1.2-r2464)
     334 * @since bbPress (r2464)
    335335 *
    336336 * @uses bbp_get_forum_topic_reply_count()
    … …  
    347347         * @package bbPress
    348348         * @subpackage Template Tags
    349          * @since bbPress (1.2-r2464)
     349         * @since bbPress (r2464)
    350350         *
    351351         * @todo stash and cache (see commented out code)
    … …  
    375375 * @package bbPress
    376376 * @subpackage Template Tags
    377  * @since bbPress (1.2-r2464)
     377 * @since bbPress (r2464)
    378378 *
    379379 * @todo make this not suck
    … …  
    405405 * @package bbPress
    406406 * @subpackage Template Tags
    407  * @since bbPress (1.2-r2485)
     407 * @since bbPress (r2485)
    408408 *
    409409 * @global WP_Query $bbp_topics_template
    … …  
    477477 * @package bbPress
    478478 * @subpackage Template Tags
    479  * @since bbPress (1.2-r2485)
     479 * @since bbPress (r2485)
    480480 *
    481481 * @global WP_Query $bbp_topics_template
    … …  
    494494 * @package bbPress
    495495 * @subpackage Template Tags
    496  * @since bbPress (1.2-r2485)
     496 * @since bbPress (r2485)
    497497 *
    498498 * @global WP_Query $bbp_topics_template
    … …  
    511511 * @package bbPress
    512512 * @subpackage Template Tags
    513  * @since bbPress (1.2-r2485)
     513 * @since bbPress (r2485)
    514514 *
    515515 * @uses bbp_get_topic_id()
    … …  
    525525         * @package bbPress
    526526         * @subpackage Template Tags
    527          * @since bbPress (1.2-r2485)
     527         * @since bbPress (r2485)
    528528         *
    529529         * @global object $topics_template
    … …  
    560560 * @package bbPress
    561561 * @subpackage Template Tags
    562  * @since bbPress (1.2-r2485)
     562 * @since bbPress (r2485)
    563563 *
    564564 * @uses bbp_get_topic_permalink()
    … …  
    575575         * @package bbPress
    576576         * @subpackage Template Tags
    577          * @since bbPress (1.2-r2485)
     577         * @since bbPress (r2485)
    578578         *
    579579         * @uses apply_filters
    … …  
    597597 * @package bbPress
    598598 * @subpackage Template Tags
    599  * @since bbPress (1.2-r2485)
     599 * @since bbPress (r2485)
    600600 * @param int $topic_id optional
    601601 *
    … …  
    612612         * @package bbPress
    613613         * @subpackage Template Tags
    614          * @since bbPress (1.2-r2485)
     614         * @since bbPress (r2485)
    615615         *
    616616         * @uses apply_filters
    … …  
    634634 * @package bbPress
    635635 * @subpackage Template Tags
    636  * @since bbPress (1.2-r2590)
     636 * @since bbPress (r2590)
    637637 * @param int $topic_id optional
    638638 *
    … …  
    649649         * @package bbPress
    650650         * @subpackage Template Tags
    651          * @since bbPress (1.2-r2590)
     651         * @since bbPress (r2590)
    652652         *
    653653         * @uses apply_filters
    … …  
    670670 * @package bbPress
    671671 * @subpackage Template Tags
    672  * @since bbPress (1.2-r2590)
     672 * @since bbPress (r2590)
    673673 * @param int $topic_id optional
    674674 *
    … …  
    685685         * @package bbPress
    686686         * @subpackage Template Tags
    687          * @since bbPress (1.2-r2590)
     687         * @since bbPress (r2590)
    688688         *
    689689         * @uses apply_filters
    … …  
    706706 * @package bbPress
    707707 * @subpackage Template Tags
    708  * @since bbPress (1.2-r2590)
     708 * @since bbPress (r2590)
    709709 * @param int $topic_id optional
    710710 *
    … …  
    721721         * @package bbPress
    722722         * @subpackage Template Tags
    723          * @since bbPress (1.2-r2485)
     723         * @since bbPress (r2485)
    724724         *
    725725         * @uses apply_filters
    … …  
    742742 * @package bbPress
    743743 * @subpackage Template Tags
    744  * @since bbPress (1.2-r2590)
     744 * @since bbPress (r2590)
    745745 * @param int $topic_id optional
    746746 *
    … …  
    757757         * @package bbPress
    758758         * @subpackage Template Tags
    759          * @since bbPress (1.2-r2590)
     759         * @since bbPress (r2590)
    760760         *
    761761         * @uses apply_filters
    … …  
    778778 * @package bbPress
    779779 * @subpackage Template Tags
    780  * @since bbPress (1.2-r2590)
     780 * @since bbPress (r2590)
    781781 * @param int $topic_id optional
    782782 *
    … …  
    793793         * @package bbPress
    794794         * @subpackage Template Tags
    795          * @since bbPress (1.2-r2590)
     795         * @since bbPress (r2590)
    796796         *
    797797         * @uses apply_filters
    … …  
    812812 * Output the topic author information
    813813 *
    814  * @since bbPress (1.2-r2590)
     814 * @since bbPress (r2590)
    815815 * @param int $topic_id
    816816 */
    … …  
    823823         * Return the topic author information
    824824         *
    825          * @since bbPress (1.2-r2590)
     825         * @since bbPress (r2590)
    826826         * @param int $topic_id
    827827         * @return string
    … …  
    847847 * @package bbPress
    848848 * @subpackage Template Tags
    849  * @since bbPress (1.2-r2485)
     849 * @since bbPress (r2485)
    850850 *
    851851 * @param int $topic_id optional
    … …  
    863863         * @package bbPress
    864864         * @subpackage Template Tags
    865          * @since bbPress (1.2-r2485)
     865         * @since bbPress (r2485)
    866866         *
    867867         * @param int $topic_id optional
    … …  
    885885         * @package bbPress
    886886         * @subpackage Template Tags
    887          * @since bbPress (1.2-r2491)
     887         * @since bbPress (r2491)
    888888         *
    889889         * @param int $topic_id optional
    … …  
    901901                 * @package bbPress
    902902                 * @subpackage Template Tags
    903                  * @since bbPress (1.2-r2491)
     903                 * @since bbPress (r2491)
    904904                 *
    905905                 * @param int $topic_id optional
    … …  
    923923 * @package bbPress
    924924 * @subpackage Template Tags
    925  * @since bbPress (1.2-r2485)
     925 * @since bbPress (r2485)
    926926 *
    927927 * @param int $topic_id optional
    … …  
    939939         * @package bbPress
    940940         * @subpackage Template Tags
    941          * @since bbPress (1.2-r2485)
     941         * @since bbPress (r2485)
    942942         *
    943943         * @param int $topic_id optional
    … …  
    959959 * @package bbPress
    960960 * @subpackage Template Tags
    961  * @since bbPress (1.2-r2485)
     961 * @since bbPress (r2485)
    962962 *
    963963 * @uses bbp_get_topic_reply_count()
    … …  
    974974         * @package bbPress
    975975         * @subpackage Template Tags
    976          * @since bbPress (1.2-r2485)
     976         * @since bbPress (r2485)
    977977         *
    978978         * @todo stash and cache (see commented out code)
    … …  
    10021002 * @package bbPress
    10031003 * @subpackage Template Tags
    1004  * @since bbPress (1.2-r2467)
     1004 * @since bbPress (r2467)
    10051005 *
    10061006 * @todo make this not suck
    … …  
    10281028 * @package bbPress
    10291029 * @subpackage Template Tags
    1030  * @since bbPress (1.2-r2567)
     1030 * @since bbPress (r2567)
    10311031 *
    10321032 * @uses bbp_get_topic_voice_count()
    … …  
    10451045         * @package bbPress
    10461046         * @subpackage Template Tags
    1047          * @since bbPress (1.2-r2567)
     1047         * @since bbPress (r2567)
    10481048         *
    10491049         * @uses bbp_get_topic_id()
    … …  
    10721072 * @package bbPress
    10731073 * @subpackage Template Tags
    1074  * @since bbPress (1.2-r2567)
     1074 * @since bbPress (r2567)
    10751075 *
    10761076 * @uses bbp_get_topic_id()
    … …  
    11901190 * @package bbPress
    11911191 * @subpackage Template Tags
    1192  * @since bbPress (1.2-r2519)
     1192 * @since bbPress (r2519)
    11931193 *
    11941194 * @global WP_Query $bbp_topics_template
    … …  
    12041204         * @package bbPress
    12051205         * @subpackage Template Tags
    1206          * @since bbPress (1.2-r2519)
     1206         * @since bbPress (r2519)
    12071207         *
    12081208         * @global WP_Query $bbp_topics_template
    … …  
    12381238 * @package bbPress
    12391239 * @subpackage Template Tags
    1240  * @since bbPress (1.2-r2519)
     1240 * @since bbPress (r2519)
    12411241 */
    12421242function bbp_forum_pagination_links () {
    … …  
    12501250         * @package bbPress
    12511251         * @subpackage Template Tags
    1252          * @since bbPress (1.2-r2519)
     1252         * @since bbPress (r2519)
    12531253         *
    12541254         * @global WP_Query $bbp_topics_template
    … …  
    12751275 * @package bbPress
    12761276 * @subpackage Template Tags
    1277  * @since bbPress (1.2-r2553)
     1277 * @since bbPress (r2553)
    12781278 *
    12791279 * @global WP_Query $bbp_replies_template
    … …  
    13471347 * @package bbPress
    13481348 * @subpackage Template Tags
    1349  * @since bbPress (1.2-r2553)
     1349 * @since bbPress (r2553)
    13501350 *
    13511351 * @global WP_Query $bbp_replies_template
    … …  
    13641364 * @package bbPress
    13651365 * @subpackage Template Tags
    1366  * @since bbPress (1.2-r2553)
     1366 * @since bbPress (r2553)
    13671367 *
    13681368 * @global WP_Query $bbp_replies_template
    … …  
    13811381 * @package bbPress
    13821382 * @subpackage Template Tags
    1383  * @since bbPress (1.2-r2553)
     1383 * @since bbPress (r2553)
    13841384 *
    13851385 * @uses bbp_get_reply_id()
    … …  
    13951395         * @package bbPress
    13961396         * @subpackage Template Tags
    1397          * @since bbPress (1.2-r2553)
     1397         * @since bbPress (r2553)
    13981398         *
    13991399         * @global object $bbp_replies_template
    … …  
    14261426 * @package bbPress
    14271427 * @subpackage Template Tags
    1428  * @since bbPress (1.2-r2553)
     1428 * @since bbPress (r2553)
    14291429 *
    14301430 * @uses bbp_get_reply_permalink()
    … …  
    14411441         * @package bbPress
    14421442         * @subpackage Template Tags
    1443          * @since bbPress (1.2-r2553)
     1443         * @since bbPress (r2553)
    14441444         *
    14451445         * @uses apply_filters
    … …  
    14601460 * @package bbPress
    14611461 * @subpackage Template Tags
    1462  * @since bbPress (1.2-r2553)
     1462 * @since bbPress (r2553)
    14631463 * @param int $reply_id optional
    14641464 *
    … …  
    14761476         * @package bbPress
    14771477         * @subpackage Template Tags
    1478          * @since bbPress (1.2-r2553)
     1478         * @since bbPress (r2553)
    14791479         *
    14801480         * @uses apply_filters
    … …  
    14951495 * @package bbPress
    14961496 * @subpackage Template Tags
    1497  * @since bbPress (1.2-r2553)
     1497 * @since bbPress (r2553)
    14981498 *
    14991499 * @todo Have a parameter reply_id
    … …  
    15111511         * @package bbPress
    15121512         * @subpackage Template Tags
    1513          * @since bbPress (1.2-r2553)
     1513         * @since bbPress (r2553)
    15141514         *
    15151515         * @uses apply_filters
    … …  
    15291529 * @package bbPress
    15301530 * @subpackage Template Tags
    1531  * @since bbPress (1.2-r2553)
     1531 * @since bbPress (r2553)
    15321532 *
    15331533 * @param int $reply_id optional
    … …  
    15451545         * @package bbPress
    15461546         * @subpackage Template Tags
    1547          * @since bbPress (1.2-r2553)
     1547         * @since bbPress (r2553)
    15481548         *
    15491549         * @param int $reply_id optional
    … …  
    15671567 * @package bbPress
    15681568 * @subpackage Template Tags
    1569  * @since bbPress (1.2-r2553)
     1569 * @since bbPress (r2553)
    15701570 *
    15711571 * @param int $reply_id optional
    … …  
    15831583         * @package bbPress
    15841584         * @subpackage Template Tags
    1585          * @since bbPress (1.2-r2553)
     1585         * @since bbPress (r2553)
    15861586         *
    15871587         * @param int $reply_id optional
    … …  
    16101610 * @package bbPress
    16111611 * @subpackage Template Tags
    1612  * @since bbPress (1.2-r2519)
     1612 * @since bbPress (r2519)
    16131613 *
    16141614 * @global WP_Query $bbp_topics_template
    … …  
    16241624         * @package bbPress
    16251625         * @subpackage Template Tags
    1626          * @since bbPress (1.2-r2519)
     1626         * @since bbPress (r2519)
    16271627         *
    16281628         * @global WP_Query $bbp_replies_template
    … …  
    16571657 * @package bbPress
    16581658 * @subpackage Template Tags
    1659  * @since bbPress (1.2-r2519)
     1659 * @since bbPress (r2519)
    16601660 */
    16611661function bbp_topic_pagination_links () {
    … …  
    16691669         * @package bbPress
    16701670         * @subpackage Template Tags
    1671          * @since bbPress (1.2-r2519)
     1671         * @since bbPress (r2519)
    16721672         *
    16731673         * @global WP_Query $bbp_replies_template
    … …  
    16921692 * Check if current page is a bbPress forum
    16931693 *
    1694  * @since bbPress (1.2-r2549)
     1694 * @since bbPress (r2549)
    16951695 *
    16961696 * @global object $wp_query
    … …  
    17141714 * Check if current page is a bbPress topic
    17151715 *
    1716  * @since bbPress (1.2-r2549)
     1716 * @since bbPress (r2549)
    17171717 *
    17181718 * @global object $wp_query
    … …  
    17361736 * Check if current page is a bbPress topic reply
    17371737 *
    1738  * @since bbPress (1.2-r2549)
     1738 * @since bbPress (r2549)
    17391739 *
    17401740 * @global object $wp_query
Note: See TracChangeset for help on using the changeset viewer.