/includes/core/options.php

  1. <?php 
  2.  
  3. /** 
  4. * bbPress Options 
  5. * 
  6. * @package bbPress 
  7. * @subpackage Options 
  8. */ 
  9.  
  10. // Exit if accessed directly 
  11. if ( !defined( 'ABSPATH' ) ) exit; 
  12.  
  13. /** 
  14. * Get the default site options and their values. 
  15. *  
  16. * These option 
  17. * 
  18. * @since bbPress (r3421) 
  19. * @return array Filtered option names and values 
  20. */ 
  21. function bbp_get_default_options() { 
  22.  
  23. // Default options 
  24. return apply_filters( 'bbp_get_default_options', array( 
  25.  
  26. /** DB Version ********************************************************/ 
  27.  
  28. '_bbp_db_version' => bbpress()->db_version,  
  29.  
  30. /** Settings **********************************************************/ 
  31.  
  32. '_bbp_edit_lock' => 5, // Lock post editing after 5 minutes 
  33. '_bbp_throttle_time' => 10, // Throttle post time to 10 seconds 
  34. '_bbp_enable_favorites' => 1, // Favorites 
  35. '_bbp_enable_subscriptions' => 1, // Subscriptions 
  36. '_bbp_allow_anonymous' => 0, // Allow anonymous posting 
  37. '_bbp_allow_global_access' => 1, // Users from all sites can post 
  38. '_bbp_allow_revisions' => 1, // Allow revisions 
  39. '_bbp_allow_topic_tags' => 1, // Allow topic tagging 
  40. '_bbp_allow_threaded_replies' => 0, // Allow threaded replies 
  41. '_bbp_allow_search' => 1, // Allow forum-wide search 
  42. '_bbp_thread_replies_depth' => 2, // Thread replies depth 
  43. '_bbp_use_wp_editor' => 1, // Use the WordPress editor if available 
  44. '_bbp_use_autoembed' => 0, // Allow oEmbed in topics and replies 
  45. '_bbp_theme_package_id' => 'default', // The ID for the current theme package 
  46. '_bbp_default_role' => bbp_get_participant_role(), // Default forums role 
  47. '_bbp_settings_integration' => 0, // Put settings into existing admin pages 
  48.  
  49. /** Per Page **********************************************************/ 
  50.  
  51. '_bbp_topics_per_page' => 15, // Topics per page 
  52. '_bbp_replies_per_page' => 15, // Replies per page 
  53. '_bbp_forums_per_page' => 50, // Forums per page 
  54. '_bbp_topics_per_rss_page' => 25, // Topics per RSS page 
  55. '_bbp_replies_per_rss_page' => 25, // Replies per RSS page 
  56.  
  57. /** Page For **********************************************************/ 
  58.  
  59. '_bbp_page_for_forums' => 0, // Page for forums 
  60. '_bbp_page_for_topics' => 0, // Page for forums 
  61. '_bbp_page_for_login' => 0, // Page for login 
  62. '_bbp_page_for_register' => 0, // Page for register 
  63. '_bbp_page_for_lost_pass' => 0, // Page for lost-pass 
  64.  
  65. /** Forum Root ********************************************************/ 
  66.  
  67. '_bbp_root_slug' => 'forums', // Forum archive slug 
  68. '_bbp_show_on_root' => 'forums', // What to show on root (forums|topics) 
  69. '_bbp_include_root' => 1, // Include forum-archive before single slugs 
  70.  
  71. /** Single Slugs ******************************************************/ 
  72.  
  73. '_bbp_forum_slug' => 'forum', // Forum slug 
  74. '_bbp_topic_slug' => 'topic', // Topic slug 
  75. '_bbp_reply_slug' => 'reply', // Reply slug 
  76. '_bbp_topic_tag_slug' => 'topic-tag', // Topic tag slug 
  77.  
  78. /** User Slugs ********************************************************/ 
  79.  
  80. '_bbp_user_slug' => 'users', // User profile slug 
  81. '_bbp_user_favs_slug' => 'favorites', // User favorites slug 
  82. '_bbp_user_subs_slug' => 'subscriptions', // User subscriptions slug 
  83. '_bbp_topic_archive_slug' => 'topics', // Topic archive slug 
  84. '_bbp_reply_archive_slug' => 'replies', // Reply archive slug 
  85.  
  86. /** Other Slugs *******************************************************/ 
  87.  
  88. '_bbp_view_slug' => 'view', // View slug 
  89. '_bbp_search_slug' => 'search', // Search slug 
  90.  
  91. /** Topics ************************************************************/ 
  92.  
  93. '_bbp_title_max_length' => 80, // Title Max Length 
  94. '_bbp_super_sticky_topics' => '', // Super stickies 
  95.  
  96. /** Forums ************************************************************/ 
  97.  
  98. '_bbp_private_forums' => '', // Private forums 
  99. '_bbp_hidden_forums' => '', // Hidden forums 
  100.  
  101. /** BuddyPress ********************************************************/ 
  102.  
  103. '_bbp_enable_group_forums' => 1, // Enable BuddyPress Group Extension 
  104. '_bbp_group_forums_root_id' => 0, // Group Forums parent forum id 
  105.  
  106. /** Akismet ***********************************************************/ 
  107.  
  108. '_bbp_enable_akismet' => 1 // Users from all sites can post 
  109.  
  110. ) ); 
  111.  
  112. /** 
  113. * Add default options 
  114. * 
  115. * Hooked to bbp_activate, it is only called once when bbPress is activated. 
  116. * This is non-destructive, so existing settings will not be overridden. 
  117. * 
  118. * @since bbPress (r3421) 
  119. * @uses bbp_get_default_options() To get default options 
  120. * @uses add_option() Adds default options 
  121. * @uses do_action() Calls 'bbp_add_options' 
  122. */ 
  123. function bbp_add_options() { 
  124.  
  125. // Add default options 
  126. foreach ( bbp_get_default_options() as $key => $value ) 
  127. add_option( $key, $value ); 
  128.  
  129. // Allow previously activated plugins to append their own options. 
  130. do_action( 'bbp_add_options' ); 
  131.  
  132. /** 
  133. * Delete default options 
  134. * 
  135. * Hooked to bbp_uninstall, it is only called once when bbPress is uninstalled. 
  136. * This is destructive, so existing settings will be destroyed. 
  137. * 
  138. * @since bbPress (r3421) 
  139. * @uses bbp_get_default_options() To get default options 
  140. * @uses delete_option() Removes default options 
  141. * @uses do_action() Calls 'bbp_delete_options' 
  142. */ 
  143. function bbp_delete_options() { 
  144.  
  145. // Add default options 
  146. foreach ( array_keys( bbp_get_default_options() ) as $key ) 
  147. delete_option( $key ); 
  148.  
  149. // Allow previously activated plugins to append their own options. 
  150. do_action( 'bbp_delete_options' ); 
  151.  
  152. /** 
  153. * Add filters to each bbPress option and allow them to be overloaded from 
  154. * inside the $bbp->options array. 
  155. * 
  156. * @since bbPress (r3451) 
  157. * @uses bbp_get_default_options() To get default options 
  158. * @uses add_filter() To add filters to 'pre_option_{$key}' 
  159. * @uses do_action() Calls 'bbp_add_option_filters' 
  160. */ 
  161. function bbp_setup_option_filters() { 
  162.  
  163. // Add filters to each bbPress option 
  164. foreach ( array_keys( bbp_get_default_options() ) as $key ) 
  165. add_filter( 'pre_option_' . $key, 'bbp_pre_get_option' ); 
  166.  
  167. // Allow previously activated plugins to append their own options. 
  168. do_action( 'bbp_setup_option_filters' ); 
  169.  
  170. /** 
  171. * Filter default options and allow them to be overloaded from inside the 
  172. * $bbp->options array. 
  173. * 
  174. * @since bbPress (r3451) 
  175. * @param bool $value Optional. Default value false 
  176. * @return mixed false if not overloaded, mixed if set 
  177. */ 
  178. function bbp_pre_get_option( $value = '' ) { 
  179.  
  180. // Remove the filter prefix 
  181. $option = str_replace( 'pre_option_', '', current_filter() ); 
  182.  
  183. // Check the options global for preset value 
  184. if ( isset( bbpress()->options[$option] ) ) 
  185. $value = bbpress()->options[$option]; 
  186.  
  187. // Always return a value, even if false 
  188. return $value; 
  189.  
  190. /** Active? *******************************************************************/ 
  191.  
  192. /** 
  193. * Checks if favorites feature is enabled. 
  194. * 
  195. * @since bbPress (r2658) 
  196. * @param $default bool Optional.Default value true 
  197. * @uses get_option() To get the favorites option 
  198. * @return bool Is favorites enabled or not 
  199. */ 
  200. function bbp_is_favorites_active( $default = 1 ) { 
  201. return (bool) apply_filters( 'bbp_is_favorites_active', (bool) get_option( '_bbp_enable_favorites', $default ) ); 
  202.  
  203. /** 
  204. * Checks if subscription feature is enabled. 
  205. * 
  206. * @since bbPress (r2658) 
  207. * @param $default bool Optional.Default value true 
  208. * @uses get_option() To get the subscriptions option 
  209. * @return bool Is subscription enabled or not 
  210. */ 
  211. function bbp_is_subscriptions_active( $default = 1 ) { 
  212. return (bool) apply_filters( 'bbp_is_subscriptions_active', (bool) get_option( '_bbp_enable_subscriptions', $default ) ); 
  213.  
  214. /** 
  215. * Are topic tags allowed 
  216. * 
  217. * @since bbPress (r4097) 
  218. * @param $default bool Optional. Default value true 
  219. * @uses get_option() To get the allow tags 
  220. * @return bool Are tags allowed? 
  221. */ 
  222. function bbp_allow_topic_tags( $default = 1 ) { 
  223. return (bool) apply_filters( 'bbp_allow_topic_tags', (bool) get_option( '_bbp_allow_topic_tags', $default ) ); 
  224.  
  225. /** 
  226. * Is forum-wide searching allowed 
  227. * 
  228. * @since bbPress (r4970) 
  229. * @param $default bool Optional. Default value true 
  230. * @uses get_option() To get the forum-wide search setting 
  231. * @return bool Is forum-wide searching allowed? 
  232. */ 
  233. function bbp_allow_search( $default = 1 ) { 
  234. return (bool) apply_filters( 'bbp_allow_search', (bool) get_option( '_bbp_allow_search', $default ) ); 
  235.  
  236. /** 
  237. * Are replies threaded 
  238. * 
  239. * @since bbPress (r4944) 
  240. * 
  241. * @param bool $default Optional. Default value true 
  242. * @uses apply_filters() Calls 'bbp_thread_replies' with the calculated value and 
  243. * the thread replies depth 
  244. * @uses get_option() To get thread replies option 
  245. * @return bool Are replies threaded? 
  246. */ 
  247. function bbp_thread_replies() { 
  248. $depth = bbp_thread_replies_depth(); 
  249. $allow = bbp_allow_threaded_replies(); 
  250. $retval = (bool) ( ( $depth >= 2 ) && ( true === $allow ) ); 
  251.  
  252. return (bool) apply_filters( 'bbp_thread_replies', $retval, $depth, $allow ); 
  253.  
  254. /** 
  255. * Are threaded replies allowed 
  256. * 
  257. * @since bbPress (r4964) 
  258. * @param $default bool Optional. Default value false 
  259. * @uses get_option() To get the threaded replies setting 
  260. * @return bool Are threaded replies allowed? 
  261. */ 
  262. function bbp_allow_threaded_replies( $default = 0 ) { 
  263. return (bool) apply_filters( '_bbp_allow_threaded_replies', (bool) get_option( '_bbp_allow_threaded_replies', $default ) ); 
  264.  
  265. /** 
  266. * Maximum reply thread depth 
  267. * 
  268. * @since bbPress (r4944) 
  269. * 
  270. * @param int $default Thread replies depth 
  271. * @uses apply_filters() Calls 'bbp_thread_replies_depth' with the option value and 
  272. * the default depth 
  273. * @uses get_option() To get the thread replies depth 
  274. * @return int Thread replies depth 
  275. */ 
  276. function bbp_thread_replies_depth( $default = 2 ) { 
  277. return (int) apply_filters( 'bbp_thread_replies_depth', (int) get_option( '_bbp_thread_replies_depth', $default ) ); 
  278.  
  279. /** 
  280. * Are topic and reply revisions allowed 
  281. * 
  282. * @since bbPress (r3412) 
  283. * @param $default bool Optional. Default value true 
  284. * @uses get_option() To get the allow revisions 
  285. * @return bool Are revisions allowed? 
  286. */ 
  287. function bbp_allow_revisions( $default = 1 ) { 
  288. return (bool) apply_filters( 'bbp_allow_revisions', (bool) get_option( '_bbp_allow_revisions', $default ) ); 
  289.  
  290. /** 
  291. * Is the anonymous posting allowed? 
  292. * 
  293. * @since bbPress (r2659) 
  294. * @param $default bool Optional. Default value 
  295. * @uses get_option() To get the allow anonymous option 
  296. * @return bool Is anonymous posting allowed? 
  297. */ 
  298. function bbp_allow_anonymous( $default = 0 ) { 
  299. return apply_filters( 'bbp_allow_anonymous', (bool) get_option( '_bbp_allow_anonymous', $default ) ); 
  300.  
  301. /** 
  302. * Is this forum available to all users on all sites in this installation? 
  303. * 
  304. * @since bbPress (r3378) 
  305. * @param $default bool Optional. Default value false 
  306. * @uses get_option() To get the global access option 
  307. * @return bool Is global access allowed? 
  308. */ 
  309. function bbp_allow_global_access( $default = 1 ) { 
  310. return (bool) apply_filters( 'bbp_allow_global_access', (bool) get_option( '_bbp_allow_global_access', $default ) ); 
  311.  
  312. /** 
  313. * Is this forum available to all users on all sites in this installation? 
  314. * 
  315. * @since bbPress (r4294) 
  316. * @param $default string Optional. Default value empty 
  317. * @uses get_option() To get the default forums role option 
  318. * @return string The default forums user role 
  319. */ 
  320. function bbp_get_default_role( $default = 'bbp_participant' ) { 
  321. return apply_filters( 'bbp_get_default_role', get_option( '_bbp_default_role', $default ) ); 
  322.  
  323. /** 
  324. * Use the WordPress editor if available 
  325. * 
  326. * @since bbPress (r3386) 
  327. * @param $default bool Optional. Default value true 
  328. * @uses get_option() To get the WP editor option 
  329. * @return bool Use WP editor? 
  330. */ 
  331. function bbp_use_wp_editor( $default = 1 ) { 
  332. return (bool) apply_filters( 'bbp_use_wp_editor', (bool) get_option( '_bbp_use_wp_editor', $default ) ); 
  333.  
  334. /** 
  335. * Use WordPress's oEmbed API 
  336. * 
  337. * @since bbPress (r3752) 
  338. * @param $default bool Optional. Default value true 
  339. * @uses get_option() To get the oEmbed option 
  340. * @return bool Use oEmbed? 
  341. */ 
  342. function bbp_use_autoembed( $default = 1 ) { 
  343. return (bool) apply_filters( 'bbp_use_autoembed', (bool) get_option( '_bbp_use_autoembed', $default ) ); 
  344.  
  345. /** 
  346. * Get the current theme package ID 
  347. * 
  348. * @since bbPress (r3829) 
  349. * @param $default string Optional. Default value 'default' 
  350. * @uses get_option() To get the subtheme option 
  351. * @return string ID of the subtheme 
  352. */ 
  353. function bbp_get_theme_package_id( $default = 'default' ) { 
  354. return apply_filters( 'bbp_get_theme_package_id', get_option( '_bbp_theme_package_id', $default ) ); 
  355.  
  356. /** 
  357. * Output the maximum length of a title 
  358. * 
  359. * @since bbPress (r3246) 
  360. * @param $default bool Optional. Default value 80 
  361. */ 
  362. function bbp_title_max_length( $default = 80 ) { 
  363. echo bbp_get_title_max_length( $default ); 
  364. /** 
  365. * Return the maximum length of a title 
  366. * 
  367. * @since bbPress (r3246) 
  368. * @param $default bool Optional. Default value 80 
  369. * @uses get_option() To get the maximum title length 
  370. * @return int Is anonymous posting allowed? 
  371. */ 
  372. function bbp_get_title_max_length( $default = 80 ) { 
  373. return (int) apply_filters( 'bbp_get_title_max_length', (int) get_option( '_bbp_title_max_length', $default ) ); 
  374.  
  375. /** 
  376. * Output the grop forums root parent forum id 
  377. * 
  378. * @since bbPress (r3575) 
  379. * @param $default int Optional. Default value 
  380. */ 
  381. function bbp_group_forums_root_id( $default = 0 ) { 
  382. echo bbp_get_group_forums_root_id( $default ); 
  383. /** 
  384. * Return the grop forums root parent forum id 
  385. * 
  386. * @since bbPress (r3575) 
  387. * @param $default bool Optional. Default value 0 
  388. * @uses get_option() To get the root group forum ID 
  389. * @return int The post ID for the root forum 
  390. */ 
  391. function bbp_get_group_forums_root_id( $default = 0 ) { 
  392. return (int) apply_filters( 'bbp_get_group_forums_root_id', (int) get_option( '_bbp_group_forums_root_id', $default ) ); 
  393.  
  394. /** 
  395. * Checks if BuddyPress Group Forums are enabled 
  396. * 
  397. * @since bbPress (r3575) 
  398. * @param $default bool Optional. Default value true 
  399. * @uses get_option() To get the group forums option 
  400. * @return bool Is group forums enabled or not 
  401. */ 
  402. function bbp_is_group_forums_active( $default = 1 ) { 
  403. return (bool) apply_filters( 'bbp_is_group_forums_active', (bool) get_option( '_bbp_enable_group_forums', $default ) ); 
  404.  
  405. /** 
  406. * Checks if Akismet is enabled 
  407. * 
  408. * @since bbPress (r3575) 
  409. * @param $default bool Optional. Default value true 
  410. * @uses get_option() To get the Akismet option 
  411. * @return bool Is Akismet enabled or not 
  412. */ 
  413. function bbp_is_akismet_active( $default = 1 ) { 
  414. return (bool) apply_filters( 'bbp_is_akismet_active', (bool) get_option( '_bbp_enable_akismet', $default ) ); 
  415.  
  416. /** 
  417. * Integrate settings into existing WordPress pages 
  418. * 
  419. * @since bbPress (r4932) 
  420. * @param $default bool Optional. Default value false 
  421. * @uses get_option() To get the admin integration setting 
  422. * @return bool To deeply integrate settings, or not 
  423. */ 
  424. function bbp_settings_integration( $default = 0 ) { 
  425. return (bool) apply_filters( 'bbp_settings_integration', (bool) get_option( '_bbp_settings_integration', $default ) ); 
  426.  
  427. /** Slugs *********************************************************************/ 
  428.  
  429. /** 
  430. * Return the root slug 
  431. * 
  432. * @since bbPress (r3759) 
  433. * @return string 
  434. */ 
  435. function bbp_get_root_slug( $default = 'forums' ) { 
  436. return apply_filters( 'bbp_get_root_slug', get_option( '_bbp_root_slug', $default ) ); 
  437.  
  438. /** 
  439. * Are we including the root slug in front of forum pages? 
  440. * 
  441. * @since bbPress (r3759) 
  442. * @return bool 
  443. */ 
  444. function bbp_include_root_slug( $default = 1 ) { 
  445. return (bool) apply_filters( 'bbp_include_root_slug', (bool) get_option( '_bbp_include_root', $default ) ); 
  446.  
  447. /** 
  448. * Return the search slug 
  449. * 
  450. * @since bbPress (r4932) 
  451. * 
  452. * @return string 
  453. */ 
  454. function bbp_show_on_root( $default = 'forums' ) { 
  455. return apply_filters( 'bbp_show_on_root', get_option( '_bbp_show_on_root', $default ) ); 
  456.  
  457. /** 
  458. * Maybe return the root slug, based on whether or not it's included in the url 
  459. * 
  460. * @since bbPress (r3759) 
  461. * @return string 
  462. */ 
  463. function bbp_maybe_get_root_slug() { 
  464. $retval = ''; 
  465.  
  466. if ( bbp_get_root_slug() && bbp_include_root_slug() ) 
  467. $retval = trailingslashit( bbp_get_root_slug() ); 
  468.  
  469. return apply_filters( 'bbp_maybe_get_root_slug', $retval ); 
  470.  
  471. /** 
  472. * Return the single forum slug 
  473. * 
  474. * @since bbPress (r3759) 
  475. * @return string 
  476. */ 
  477. function bbp_get_forum_slug( $default = 'forum' ) {; 
  478. return apply_filters( 'bbp_get_root_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_forum_slug', $default ) ); 
  479.  
  480. /** 
  481. * Return the topic archive slug 
  482. * 
  483. * @since bbPress (r3759) 
  484. * @return string 
  485. */ 
  486. function bbp_get_topic_archive_slug( $default = 'topics' ) { 
  487. return apply_filters( 'bbp_get_topic_archive_slug', get_option( '_bbp_topic_archive_slug', $default ) ); 
  488.  
  489. /** 
  490. * Return the reply archive slug 
  491. * 
  492. * @since bbPress (r4925) 
  493. * @return string 
  494. */ 
  495. function bbp_get_reply_archive_slug( $default = 'replies' ) { 
  496. return apply_filters( 'bbp_get_reply_archive_slug', get_option( '_bbp_reply_archive_slug', $default ) ); 
  497.  
  498. /** 
  499. * Return the single topic slug 
  500. * 
  501. * @since bbPress (r3759) 
  502. * @return string 
  503. */ 
  504. function bbp_get_topic_slug( $default = 'topic' ) { 
  505. return apply_filters( 'bbp_get_topic_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_topic_slug', $default ) ); 
  506.  
  507. /** 
  508. * Return the topic-tag taxonomy slug 
  509. * 
  510. * @since bbPress (r3759) 
  511. * @return string 
  512. */ 
  513. function bbp_get_topic_tag_tax_slug( $default = 'topic-tag' ) { 
  514. return apply_filters( 'bbp_get_topic_tag_tax_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_topic_tag_slug', $default ) ); 
  515.  
  516. /** 
  517. * Return the single reply slug (used mostly for editing) 
  518. * 
  519. * @since bbPress (r3759) 
  520. * @return string 
  521. */ 
  522. function bbp_get_reply_slug( $default = 'reply' ) { 
  523. return apply_filters( 'bbp_get_reply_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_reply_slug', $default ) ); 
  524.  
  525. /** 
  526. * Return the single user slug 
  527. * 
  528. * @since bbPress (r3759) 
  529. * @return string 
  530. */ 
  531. function bbp_get_user_slug( $default = 'user' ) { 
  532. return apply_filters( 'bbp_get_user_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_user_slug', $default ) ); 
  533.  
  534. /** 
  535. * Return the single user favorites slug 
  536. * 
  537. * @since bbPress (r4187) 
  538. * @return string 
  539. */ 
  540. function bbp_get_user_favorites_slug( $default = 'favorites' ) { 
  541. return apply_filters( 'bbp_get_user_favorites_slug', get_option( '_bbp_user_favs_slug', $default ) ); 
  542.  
  543. /** 
  544. * Return the single user subscriptions slug 
  545. * 
  546. * @since bbPress (r4187) 
  547. * @return string 
  548. */ 
  549. function bbp_get_user_subscriptions_slug( $default = 'subscriptions' ) { 
  550. return apply_filters( 'bbp_get_user_subscriptions_slug', get_option( '_bbp_user_subs_slug', $default ) ); 
  551.  
  552. /** 
  553. * Return the topic view slug 
  554. * 
  555. * @since bbPress (r3759) 
  556. * @return string 
  557. */ 
  558. function bbp_get_view_slug( $default = 'view' ) { 
  559. return apply_filters( 'bbp_get_view_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_view_slug', $default ) ); 
  560.  
  561. /** 
  562. * Return the search slug 
  563. * 
  564. * @since bbPress (r4579) 
  565. * 
  566. * @return string 
  567. */ 
  568. function bbp_get_search_slug( $default = 'search' ) { 
  569. return apply_filters( 'bbp_get_search_slug', bbp_maybe_get_root_slug() . get_option( '_bbp_search_slug', $default ) ); 
  570.  
  571. /** Legacy ********************************************************************/ 
  572.  
  573. /** 
  574. * Checks if there is a previous BuddyPress Forum configuration 
  575. * 
  576. * @since bbPress (r3790) 
  577. * @param $default string Optional. Default empty string 
  578. * @uses get_option() To get the old bb-config.php location 
  579. * @return string The location of the bb-config.php file, if any 
  580. */ 
  581. function bbp_get_config_location( $default = '' ) { 
  582. return apply_filters( 'bbp_get_config_location', get_option( 'bb-config-location', $default ) ); 
.