Skip to:
Content

BuddyPress.org

Changeset 9598


Ignore:
Timestamp:
03/05/2015 05:22:42 AM (7 years ago)
Author:
tw2113
Message:

Adds hooks documentation for bp-core-options.php.

See #5940.

File:
1 edited

Legend:

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

    r9471 r9598  
    101101    );
    102102
     103    /**
     104     * Filters the default options to be set upon activation.
     105     *
     106     * @since BuddyPress (1.6.0)
     107     *
     108     * @param array $options Array of default options to set.
     109     */
    103110    return apply_filters( 'bp_get_default_options', $options );
    104111}
     
    126133    }
    127134
    128     // Allow previously activated plugins to append their own options.
     135    /**
     136     * Fires after the addition of default options when BuddyPress is first activated.
     137     *
     138     * Allows previously activated plugins to append their own options.
     139     *
     140     * @since BuddyPress (1.6.0)
     141     */
    129142    do_action( 'bp_add_options' );
    130143}
     
    154167    }
    155168
    156     // Allow previously activated plugins to append their own options.
     169    /**
     170     * Fires after the deletion of default options when BuddyPress is first deactivated.
     171     *
     172     * Allows previously activated plugins to append their own options.
     173     *
     174     * @since BuddyPress (1.6.0)
     175     */
    157176    do_action( 'bp_delete_options' );
    158177}
     
    179198    }
    180199
    181     // Allow previously activated plugins to append their own options.
     200    /**
     201     * Fires after the addition of filters to each BuddyPress option.
     202     *
     203     * Allows previously activated plugins to append their own options.
     204     *
     205     * @since BuddyPress (1.6.0)
     206     */
    182207    do_action( 'bp_setup_option_filters' );
    183208}
     
    188213 * Currently unused.
    189214 *
    190  * @since BuddyPress (1.6)
     215 * @since BuddyPress (1.6.0)
    191216 *
    192217 * @param bool $value Optional. Default value false
     
    219244 * The 'bp_get_option' filter is primarily for backward-compatibility.
    220245 *
    221  * @since BuddyPress (1.5.0)
     246 * @since BuddyPress (1.2.0)
    222247 *
    223248 * @uses bp_get_root_blog_id()
     
    230255function bp_get_option( $option_name, $default = '' ) {
    231256    $value = get_blog_option( bp_get_root_blog_id(), $option_name, $default );
     257
     258    /**
     259     * Filters the option value for the requested option.
     260     *
     261     * @since BuddyPress (1.2.0)
     262     *
     263     * @param mixed $value The value for the option.
     264     */
    232265    return apply_filters( 'bp_get_option', $value );
    233266}
     
    355388        // On Multisite installations, some options must always be fetched from sitemeta
    356389        if ( is_multisite() ) {
     390
     391            /**
     392             * Filters multisite options retrieved from sitemeta.
     393             *
     394             * @since BuddyPress (1.5.0)
     395             *
     396             * @param array $value Array of multisite options from sitemeta table.
     397             */
    357398            $network_options = apply_filters( 'bp_core_network_options', array(
    358399                'tags_blog_id'       => '0',
     
    431472    }
    432473
     474    /**
     475     * Filters the global BP options.
     476     *
     477     * @since BuddyPress (1.5.0)
     478     *
     479     * @param array $root_blog_options_meta Array of global BP options.
     480     */
    433481    return apply_filters( 'bp_core_get_root_options', $root_blog_options_meta );
    434482}
     
    448496 */
    449497function bp_disable_profile_sync( $default = false ) {
     498
     499    /**
     500     * Filters whether or not profile syncing is disabled.
     501     *
     502     * @since BuddyPress (1.6.0)
     503     *
     504     * @param bool $value Whether or not syncing is disabled.
     505     */
    450506    return (bool) apply_filters( 'bp_disable_profile_sync', (bool) bp_get_option( 'bp-disable-profile-sync', $default ) );
    451507}
     
    464520 */
    465521function bp_hide_loggedout_adminbar( $default = true ) {
     522
     523    /**
     524     * Filters whether or not the toolbar is hidden for logged out users.
     525     *
     526     * @since BuddyPress (1.6.0)
     527     *
     528     * @param bool $value Whether or not the toolbar is hidden.
     529     */
    466530    return (bool) apply_filters( 'bp_hide_loggedout_adminbar', (bool) bp_get_option( 'hide-loggedout-adminbar', $default ) );
    467531}
     
    479543 */
    480544function bp_disable_avatar_uploads( $default = true ) {
     545
     546    /**
     547     * Filters whether or not members are able to upload their own avatars.
     548     *
     549     * @since BuddyPress (1.6.0)
     550     *
     551     * @param bool $value Whether or not members are able to upload their own avatars.
     552     */
    481553    return (bool) apply_filters( 'bp_disable_avatar_uploads', (bool) bp_get_option( 'bp-disable-avatar-uploads', $default ) );
    482554}
     
    495567 */
    496568function bp_disable_account_deletion( $default = false ) {
     569
     570    /**
     571     * Filters whether or not members are able to delete their own accounts.
     572     *
     573     * @since BuddyPress (1.6.0)
     574     *
     575     * @param bool $value Whether or not members are able to delete their own accounts.
     576     */
    497577    return apply_filters( 'bp_disable_account_deletion', (bool) bp_get_option( 'bp-disable-account-deletion', $default ) );
    498578}
     
    512592 */
    513593function bp_disable_blogforum_comments( $default = false ) {
     594
     595    /**
     596     * Filters whether or not blog and forum activity stream comments are disabled.
     597     *
     598     * @since BuddyPress (1.6.0)
     599     *
     600     * @param bool $value Whether or not blog and forum activity stream comments are disabled.
     601     */
    514602    return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) bp_get_option( 'bp-disable-blogforum-comments', $default ) );
    515603}
     
    528616 */
    529617function bp_restrict_group_creation( $default = true ) {
     618
     619    /**
     620     * Filters whether or not group creation is turned off.
     621     *
     622     * @since BuddyPress (1.6.0)
     623     *
     624     * @param bool $value Whether or not group creation is turned off.
     625     */
    530626    return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) );
    531627}
     
    543639 */
    544640function bp_force_buddybar( $default = true ) {
     641
     642    /**
     643     * Filters whether or not BuddyBar should be forced in place of WP Admin Bar.
     644     *
     645     * @since BuddyPress (1.6.0)
     646     *
     647     * @param bool $value Whether or not BuddyBar should be forced in place of WP Admin Bar.
     648     */
    545649    return (bool) apply_filters( 'bp_force_buddybar', (bool) bp_get_option( '_bp_force_buddybar', $default ) );
    546650}
     
    567671     */
    568672    function bp_get_group_forums_root_id( $default = '0' ) {
     673
     674        /**
     675         * Filters the group forums root parent forum id.
     676         *
     677         * @since BuddyPress (1.6.0)
     678         *
     679         * @param int $value The group forums root parent forum id.
     680         */
    569681        return (int) apply_filters( 'bp_get_group_forums_root_id', (int) bp_get_option( '_bp_group_forums_root_id', $default ) );
    570682    }
     
    582694 */
    583695function bp_is_group_forums_active( $default = true ) {
     696
     697    /**
     698     * Filters whether or not BuddyPress Group Forums are enabled.
     699     *
     700     * @since BuddyPress (1.6.0)
     701     *
     702     * @param bool $value Whether or not BuddyPress Group Forums are enabled.
     703     */
    584704    return (bool) apply_filters( 'bp_is_group_forums_active', (bool) bp_get_option( '_bp_enable_group_forums', $default ) );
    585705}
     
    597717 */
    598718function bp_is_akismet_active( $default = true ) {
     719
     720    /**
     721     * Filters whether or not Akismet is enabled.
     722     *
     723     * @since BuddyPress (1.6.0)
     724     *
     725     * @param bool $value Whether or not Akismet is enabled.
     726     */
    599727    return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default ) );
    600728}
     
    612740 */
    613741function bp_is_activity_heartbeat_active( $default = true ) {
     742
     743    /**
     744     * Filters whether or not Activity Heartbeat refresh is enabled.
     745     *
     746     * @since BuddyPress (2.0.0)
     747     *
     748     * @param bool $value Whether or not Activity Heartbeat refresh is enabled.
     749     */
    614750    return (bool) apply_filters( 'bp_is_activity_heartbeat_active', (bool) bp_get_option( '_bp_enable_heartbeat_refresh', $default ) );
    615751}
     
    627763 */
    628764function bp_get_theme_package_id( $default = 'legacy' ) {
     765
     766    /**
     767     * Filters the current theme package ID.
     768     *
     769     * @since BuddyPress (1.7.0)
     770     *
     771     * @param string $value The current theme package ID.
     772     */
    629773    return apply_filters( 'bp_get_theme_package_id', bp_get_option( '_bp_theme_package_id', $default ) );
    630774}
Note: See TracChangeset for help on using the changeset viewer.