PluginProbe
bbPress / 2.0-beta-1
bbPress v2.0-beta-1
2.6.17 trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 2.2 2.2.1 All 72 releases
bbpress / bbp-includes / bbp-core-options.php

bbp-core-options.php in bbPress 2.0-beta-1, at bbp-includes/bbp-core-options.php

161 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * bbPress Options
5 *
6 * @package bbPress
7 * @subpackage Options
8 */
9
10 // Redirect if accessed directly
11 if ( !defined( 'ABSPATH' ) ) exit;
12
13 /**
14 * Add default options
15 *
16 * Hooked to bbp_activate, it is only called once when bbPress is activated.
17 * This is non-destructive, so existing settings will not be overridden.
18 *
19 * @uses add_option() Adds default options
20 * @uses do_action() Calls 'bbp_add_options'
21 */
22 function bbp_add_options() {
23
24 // Default options
25 $options = array (
26
27 /** Database **********************************************************/
28
29 // DB version
30 '_bbp_db_version' => '110',
31
32 /** Settings **********************************************************/
33
34 // Lock post editing after 5 minutes
35 '_bbp_edit_lock' => '5',
36
37 // Throttle post time to 10 seconds
38 '_bbp_throttle_time' => '10',
39
40 // Favorites
41 '_bbp_enable_favorites' => true,
42
43 // Subscriptions
44 '_bbp_enable_subscriptions' => true,
45
46 // Allow anonymous posting
47 '_bbp_allow_anonymous' => false,
48
49 // Topics per page
50 '_bbp_topics_per_page' => '15',
51
52 // Replies per page
53 '_bbp_replies_per_page' => '15',
54
55 // Forums per page
56 '_bbp_forums_per_page' => '50',
57
58 // Topics per RSS page
59 '_bbp_topics_per_rss_page' => '25',
60
61 // Replies per RSS page
62 '_bbp_replies_per_rss_page' => '25',
63
64 /** Slugs *************************************************************/
65
66 // Root slug
67 '_bbp_root_slug' => 'forums',
68
69 // Use root before slugs
70 '_bbp_include_root' => true,
71
72 // Forum slug
73 '_bbp_forum_slug' => 'forum',
74
75 // Forum archive slug
76 '_bbp_forum_archive_slug' => 'forums',
77
78 // Topic slug
79 '_bbp_topic_slug' => 'topic',
80
81 // Topic archive slug
82 '_bbp_topic_archive_slug' => 'topics',
83
84 // Reply slug
85 '_bbp_reply_slug' => 'reply',
86
87 // Reply archive slug
88 '_bbp_reply_archive_slug' => 'replies',
89
90 // Topic tag slug
91 '_bbp_topic_tag_slug' => 'tag',
92
93 // User profile slug
94 '_bbp_user_slug' => 'users',
95
96 // View slug
97 '_bbp_view_slug' => 'view',
98
99 /** Topics ************************************************************/
100
101 // Super stickies
102 '_bbp_super_sticky_topics' => '',
103
104 /** Forums ************************************************************/
105
106 // Private forums
107 '_bbp_private_forums' => '',
108
109 // Hidden forums
110 '_bbp_hidden_forums' => '',
111 );
112
113 // Add default options
114 foreach ( $options as $key => $value )
115 add_option( $key, $value );
116
117 // Allow previously activated plugins to append their own options.
118 // This is an extremely rare use-case.
119 do_action( 'bbp_add_options' );
120 }
121
122 /** Active? *******************************************************************/
123
124 /**
125 * Checks if favorites feature is enabled.
126 *
127 * @since bbPress (r2658)
128 *
129 * @uses get_option() To get the favorites option
130 * @return bool Is favorites enabled or not
131 */
132 function bbp_is_favorites_active() {
133 return apply_filters( 'bbp_is_favorites_active', (bool) get_option( '_bbp_enable_favorites', true ) );
134 }
135
136 /**
137 * Checks if subscription feature is enabled.
138 *
139 * @since bbPress (r2658)
140 *
141 * @uses get_option() To get the subscriptions option
142 * @return bool Is subscription enabled or not
143 */
144 function bbp_is_subscriptions_active() {
145 return apply_filters( 'bbp_is_subscriptions_active', (bool) get_option( '_bbp_enable_subscriptions' ) );
146 }
147
148 /**
149 * Is the anonymous posting allowed?
150 *
151 * @since bbPress (r2659)
152 *
153 * @uses get_option() To get the allow anonymous option
154 * @return bool Is anonymous posting allowed?
155 */
156 function bbp_allow_anonymous() {
157 return apply_filters( 'bbp_allow_anonymous', get_option( '_bbp_allow_anonymous', false ) );
158 }
159
160 ?>
161