Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2012 08:10:10 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Tweak the BuddyPress installation and update wizard:

  • Rename new 'bp-force-buddybar' option to '_bp_force_buddybar' to fit naming scheme
  • Remove single-site to multi-site wizard step, since the page-nag will take care of this
  • Remove any previous db versions when updating
  • Use bp_get_option() in bp-core-options.php
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-options.php

    r5585 r5721  
    8383        // Users from all sites can post
    8484        '_bp_enable_akismet'              => true,
     85       
     86        /** BuddyBar **********************************************************/
     87
     88        // Force the BuddyBar
     89        '_bp_force_buddybar'              => false
    8590    );
    8691
     
    191196 * When switching from single to multisite we need to copy blog options to
    192197 * site options.
     198 *
     199 * This function is no longer used
    193200 *
    194201 * @package BuddyPress Core
    195  * @todo Does this need to be here anymore after the introduction of bp_get_option etc?
     202 * @deprecated Since BuddyPress (1.6)
    196203 */
    197204function bp_core_activate_site_options( $keys = array() ) {
     
    205212                $bp->site_options[ $key ] = bp_get_option( $key, $default );
    206213
    207                 if ( !bp_update_option( $key, $bp->site_options[ $key ] ) )
     214                if ( !bp_update_option( $key, $bp->site_options[ $key ] ) ) {
    208215                    $errors = true;
     216                }
    209217            }
    210218        }
    211219
    212         if ( empty( $errors ) )
     220        if ( empty( $errors ) ) {
    213221            return true;
     222        }
    214223    }
    215224
     
    310319 * @param $default bool Optional.Default value true
    311320 *
    312  * @uses get_option() To get the profile sync option
     321 * @uses bp_get_option() To get the profile sync option
    313322 * @return bool Is profile sync enabled or not
    314323 */
    315324function bp_disable_profile_sync( $default = true ) {
    316     return (bool) apply_filters( 'bp_disable_profile_sync', (bool) get_option( 'bp-disable-profile-sync', $default ) );
     325    return (bool) apply_filters( 'bp_disable_profile_sync', (bool) bp_get_option( 'bp-disable-profile-sync', $default ) );
    317326}
    318327
     
    324333 * @param $default bool Optional.Default value true
    325334 *
    326  * @uses get_option() To get the logged out admin bar option
     335 * @uses bp_get_option() To get the logged out admin bar option
    327336 * @return bool Is logged out admin bar enabled or not
    328337 */
    329338function bp_hide_loggedout_adminbar( $default = true ) {
    330     return (bool) apply_filters( 'bp_hide_loggedout_adminbar', (bool) get_option( 'hide-loggedout-adminbar', $default ) );
     339    return (bool) apply_filters( 'bp_hide_loggedout_adminbar', (bool) bp_get_option( 'hide-loggedout-adminbar', $default ) );
    331340}
    332341
     
    338347 * @param $default bool Optional. Default value true
    339348 *
    340  * @uses get_option() To get the avatar uploads option
     349 * @uses bp_get_option() To get the avatar uploads option
    341350 * @return bool Are avatar uploads allowed?
    342351 */
    343352function bp_disable_avatar_uploads( $default = true ) {
    344     return (bool) apply_filters( 'bp_disable_avatar_uploads', (bool) get_option( 'bp-disable-avatar-uploads', $default ) );
     353    return (bool) apply_filters( 'bp_disable_avatar_uploads', (bool) bp_get_option( 'bp-disable-avatar-uploads', $default ) );
    345354}
    346355
     
    352361 * @param $default bool Optional. Default value
    353362 *
    354  * @uses get_option() To get the account deletion option
     363 * @uses bp_get_option() To get the account deletion option
    355364 * @return bool Is account deletion allowed?
    356365 */
    357366function bp_disable_account_deletion( $default = false ) {
    358     return apply_filters( 'bp_disable_account_deletion', (bool) get_option( 'bp-disable-account-deletion', $default ) );
     367    return apply_filters( 'bp_disable_account_deletion', (bool) bp_get_option( 'bp-disable-account-deletion', $default ) );
    359368}
    360369
     
    366375 * @param $default bool Optional. Default value false
    367376 * @todo split and move into blog and forum components
    368  * @uses get_option() To get the blog/forum comments option
     377 * @uses bp_get_option() To get the blog/forum comments option
    369378 * @return bool Is blog/forum comments allowed?
    370379 */
    371380function bp_disable_blogforum_comments( $default = false ) {
    372     return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) get_option( 'bp-disable-blogforum-comments', $default ) );
     381    return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) bp_get_option( 'bp-disable-blogforum-comments', $default ) );
    373382}
    374383
     
    381390 *
    382391 * @todo Move into groups component
    383  * @uses get_option() To get the group creation
     392 * @uses bp_get_option() To get the group creation
    384393 * @return bool Allow group creation?
    385394 */
    386395function bp_restrict_group_creation( $default = true ) {
    387     return (bool) apply_filters( 'bp_restrict_group_creation', (bool) get_option( 'bp_restrict_group_creation', $default ) );
     396    return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) );
    388397}
    389398
     
    396405 *
    397406 * @todo Move into groups component
    398  * @uses get_option() To get the WP editor option
     407 * @uses bp_get_option() To get the WP editor option
    399408 * @return bool Use WP editor?
    400409 */
    401410function bp_force_buddybar( $default = true ) {
    402     return (bool) apply_filters( 'bp_force_buddybar', (bool) get_option( 'bp-force-buddybar', $default ) );
     411    return (bool) apply_filters( 'bp_force_buddybar', (bool) bp_get_option( '_bp_force_buddybar', $default ) );
    403412}
    404413
     
    410419 * @param $default bool Optional. Default value true
    411420 *
    412  * @uses get_option() To get the WP editor option
     421 * @uses bp_get_option() To get the WP editor option
    413422 * @return bool Use WP editor?
    414423 */
    415424function bp_use_wp_editor( $default = true ) {
    416     return (bool) apply_filters( 'bp_use_wp_editor', (bool) get_option( '_bp_use_wp_editor', $default ) );
     425    return (bool) apply_filters( 'bp_use_wp_editor', (bool) bp_get_option( '_bp_use_wp_editor', $default ) );
    417426}
    418427
     
    434443     * @param $default bool Optional. Default value 0
    435444     *
    436      * @uses get_option() To get the maximum title length
     445     * @uses bp_get_option() To get the maximum title length
    437446     * @return int Is anonymous posting allowed?
    438447     */
    439448    function bp_get_group_forums_root_id( $default = '0' ) {
    440         return (int) apply_filters( 'bp_get_group_forums_root_id', (int) get_option( '_bbp_group_forums_root_id', $default ) );
     449        return (int) apply_filters( 'bp_get_group_forums_root_id', (int) bp_get_option( '_bbp_group_forums_root_id', $default ) );
    441450    }
    442451
     
    448457 * @param $default bool Optional. Default value true
    449458 *
    450  * @uses get_option() To get the group forums option
     459 * @uses bp_get_option() To get the group forums option
    451460 * @return bool Is group forums enabled or not
    452461 */
    453462function bp_is_group_forums_active( $default = true ) {
    454     return (bool) apply_filters( 'bp_is_group_forums_active', (bool) get_option( '_bbp_enable_group_forums', $default ) );
     463    return (bool) apply_filters( 'bp_is_group_forums_active', (bool) bp_get_option( '_bbp_enable_group_forums', $default ) );
    455464}
    456465
     
    462471 * @param $default bool Optional. Default value true
    463472 *
    464  * @uses get_option() To get the Akismet option
     473 * @uses bp_get_option() To get the Akismet option
    465474 * @return bool Is Akismet enabled or not
    466475 */
    467476function bp_is_akismet_active( $default = true ) {
    468     return (bool) apply_filters( 'bp_is_akismet_active', (bool) get_option( '_bp_enable_akismet', $default ) );
     477    return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default ) );
    469478}
    470479
Note: See TracChangeset for help on using the changeset viewer.