Changeset 2789 for branches/plugin/bbpress.php
- Timestamp:
- 01/09/2011 10:06:53 PM (15 years ago)
- File:
-
- 1 edited
-
branches/plugin/bbpress.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbpress.php
r2786 r2789 1 1 <?php 2 /** 3 * The bbPress Plugin 4 * 5 * bbPress is forum software with a twist from the creators of WordPress. 6 * 7 * @package bbPress 8 * @subpackage Main 9 */ 10 2 11 /** 3 12 * Plugin Name: bbPress … … 10 19 11 20 /** 12 * The bbPress Plugin13 *14 * bbPress is forum software with a twist from the creators of WordPress.15 *16 * @package bbPress17 * @subpackage Main18 */19 /**20 21 * bbPress vesion 21 22 * … … 103 104 var $user_slug; 104 105 106 /** 107 * @var string View slug 108 */ 109 var $view_slug; 110 105 111 // Absolute Paths 106 112 … … 191 197 */ 192 198 var $errors; 199 200 // Views 201 202 /** 203 * @var array An array of registered bbPress views 204 */ 205 var $views; 193 206 194 207 /** … … 222 235 223 236 // bbPress root directory 224 $this->file = __FILE__;225 $this->plugin_dir = plugin_dir_path( $this->file );226 $this->plugin_url = plugin_dir_url ( $this->file );237 $this->file = __FILE__; 238 $this->plugin_dir = plugin_dir_path( $this->file ); 239 $this->plugin_url = plugin_dir_url ( $this->file ); 227 240 228 241 // Images 229 $this->images_url = $this->plugin_url . 'bbp-images';242 $this->images_url = $this->plugin_url . 'bbp-images'; 230 243 231 244 // Themes 232 $this->themes_dir = WP_PLUGIN_DIR . '/' . basename( dirname( __FILE__ ) ) . '/bbp-themes';233 $this->themes_url = $this->plugin_url . 'bbp-themes';245 $this->themes_dir = WP_PLUGIN_DIR . '/' . basename( dirname( __FILE__ ) ) . '/bbp-themes'; 246 $this->themes_url = $this->plugin_url . 'bbp-themes'; 234 247 235 248 /** Identifiers ***********************************************/ 236 249 237 250 // Post type identifiers 238 $this->forum_id = apply_filters( 'bbp_forum_post_type', 'bbp_forum' );239 $this->topic_id = apply_filters( 'bbp_topic_post_type', 'bbp_topic' );240 $this->reply_id = apply_filters( 'bbp_reply_post_type', 'bbp_reply' );241 $this->topic_tag_id = apply_filters( 'bbp_topic_tag_id', 'bbp_topic_tag' );251 $this->forum_id = apply_filters( 'bbp_forum_post_type', 'bbp_forum' ); 252 $this->topic_id = apply_filters( 'bbp_topic_post_type', 'bbp_topic' ); 253 $this->reply_id = apply_filters( 'bbp_reply_post_type', 'bbp_reply' ); 254 $this->topic_tag_id = apply_filters( 'bbp_topic_tag_id', 'bbp_topic_tag' ); 242 255 243 256 // Status identifiers … … 249 262 250 263 // Root forum slug 251 $this->root_slug = apply_filters( 'bbp_root_slug', get_option( '_bbp_root_slug', 'forums' ) );264 $this->root_slug = apply_filters( 'bbp_root_slug', get_option( '_bbp_root_slug', 'forums' ) ); 252 265 253 266 // Should we include the root slug in front of component slugs … … 255 268 256 269 // Component slugs 257 $this->user_slug = apply_filters( 'bbp_user_slug', get_option( '_bbp_user_slug', $prefix . 'user' ) ); 258 $this->forum_slug = apply_filters( 'bbp_forum_slug', get_option( '_bbp_forum_slug', $prefix . 'forum' ) ); 259 $this->topic_slug = apply_filters( 'bbp_topic_slug', get_option( '_bbp_topic_slug', $prefix . 'topic' ) ); 260 $this->reply_slug = apply_filters( 'bbp_reply_slug', get_option( '_bbp_reply_slug', $prefix . 'reply' ) ); 261 $this->topic_tag_slug = apply_filters( 'bbp_topic_tag_slug', get_option( '_bbp_topic_tag_slug', $prefix . 'tag' ) ); 270 $this->user_slug = apply_filters( 'bbp_user_slug', $prefix . get_option( '_bbp_user_slug', 'user' ) ); 271 $this->view_slug = apply_filters( 'bbp_view_slug', $prefix . get_option( '_bbp_view_slug', 'view' ) ); 272 $this->forum_slug = apply_filters( 'bbp_forum_slug', $prefix . get_option( '_bbp_forum_slug', 'forum' ) ); 273 $this->topic_slug = apply_filters( 'bbp_topic_slug', $prefix . get_option( '_bbp_topic_slug', 'topic' ) ); 274 $this->reply_slug = apply_filters( 'bbp_reply_slug', $prefix . get_option( '_bbp_reply_slug', 'reply' ) ); 275 $this->topic_tag_slug = apply_filters( 'bbp_topic_tag_slug', $prefix . get_option( '_bbp_topic_tag_slug', 'tag' ) ); 262 276 263 277 /** Misc ******************************************************/ … … 265 279 // Errors 266 280 $this->errors = new WP_Error(); 281 282 // Views 283 $this->views = array(); 267 284 } 268 285 … … 326 343 add_action( 'bbp_register_taxonomies', array( $this, 'register_taxonomies' ), 10, 2 ); 327 344 328 // Register theme directory 345 // Register the views 346 add_action( 'bbp_register_views', array( $this, 'register_views' ), 10, 2 ); 347 348 // Register the theme directory 329 349 add_action( 'bbp_register_theme_directory', array( $this, 'register_theme_directory' ), 10, 2 ); 330 350 … … 651 671 652 672 /** 673 * Register the bbPress views 674 * 675 * @since bbPress (r2789) 676 * 677 * @uses bbp_register_view() To register the views 678 */ 679 function register_views() { 680 681 // Topics with no replies 682 $no_replies = apply_filters( 'bbp_register_view_no_replies', array( 683 'meta_key' => '_bbp_topic_reply_count', 684 'meta_value' => 1, 685 'meta_compare' => '<', 686 'orderby' => '' 687 ) ); 688 689 bbp_register_view( 'no-replies', __( 'Topics with no replies', 'bbpress' ), $no_replies ); 690 691 } 692 693 /** 653 694 * Setup the currently logged-in user 654 695 * … … 679 720 // User Profile tag 680 721 add_rewrite_tag( '%bbp_user%', '([^/]+)' ); 722 723 // View Page tag 724 add_rewrite_tag( '%bbp_view%', '([^/]+)' ); 681 725 682 726 // Edit Page tag … … 705 749 // Profile Page 706 750 $this->user_slug . '/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?bbp_user=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ), 707 $this->user_slug . '/([^/]+)/?$' => 'index.php?bbp_user=' . $wp_rewrite->preg_index( 1 ) 751 $this->user_slug . '/([^/]+)/?$' => 'index.php?bbp_user=' . $wp_rewrite->preg_index( 1 ), 752 753 // @todo - view feeds 754 //$this->view_slug . '/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?bbp_view=' . $wp_rewrite->preg_index( 1 ) . '&feed=' . $wp_rewrite->preg_index( 2 ), 755 756 // View Page 757 $this->view_slug . '/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?bbp_view=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ), 758 $this->view_slug . '/([^/]+)/?$' => 'index.php?bbp_view=' . $wp_rewrite->preg_index( 1 ) 708 759 ); 709 760
Note: See TracChangeset
for help on using the changeset viewer.