Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/20/2013 07:21:38 PM (10 years ago)
Author:
boonebgorges
Message:

Improve inline docs in bp-core. See #5022

File:
1 edited

Legend:

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

    r7228 r7451  
    22
    33/**
    4  * BuddyPress Options
     4 * BuddyPress Options.
    55 *
    66 * @package BuddyPress
     
    1212
    1313/**
    14  * Get the default site options and their values
    15  *
    16  * @since BuddyPress (1.6)
    17  *
    18  * @return array Filtered option names and values
     14 * Get the default site options and their values.
     15 *
     16 * @since BuddyPress (1.6.0)
     17 *
     18 * @return array Filtered option names and values.
    1919 */
    2020function bp_get_default_options() {
     
    8787
    8888/**
    89  * Add default options
     89 * Add default options when BuddyPress is first activated.
    9090 *
    9191 * Hooked to bp_activate, it is only called once when BuddyPress is activated.
    9292 * This is non-destructive, so existing settings will not be overridden.
    9393 *
    94  * @since BuddyPress (1.6)
    95  *
    96  * @uses bp_get_default_options() To get default options
    97  * @uses add_option() Adds default options
    98  * @uses do_action() Calls 'bp_add_options'
     94 * Currently unused.
     95 *
     96 * @since BuddyPress (1.6.0)
     97 *
     98 * @uses bp_get_default_options() To get default options.
     99 * @uses add_option() Adds default options.
     100 * @uses do_action() Calls 'bp_add_options'.
    99101 */
    100102function bp_add_options() {
     
    112114
    113115/**
    114  * Delete default options
     116 * Delete default options.
    115117 *
    116118 * Hooked to bp_uninstall, it is only called once when BuddyPress is uninstalled.
    117119 * This is destructive, so existing settings will be destroyed.
    118120 *
    119  * @since BuddyPress (1.6)
    120  *
    121  * @uses bp_get_default_options() To get default options
    122  * @uses delete_option() Removes default options
    123  * @uses do_action() Calls 'bp_delete_options'
     121 * Currently unused.
     122 *
     123 * @since BuddyPress (1.6.0)
     124 *
     125 * @uses bp_get_default_options() To get default options.
     126 * @uses delete_option() Removes default options.
     127 * @uses do_action() Calls 'bp_delete_options'.
    124128 */
    125129function bp_delete_options() {
     
    137141
    138142/**
    139  * Add filters to each BuddyPress option and allow them to be overloaded from
    140  * inside the $bp->options array.
    141  *
    142  * @since BuddyPress (1.6)
    143  *
    144  * @uses bp_get_default_options() To get default options
    145  * @uses add_filter() To add filters to 'pre_option_{$key}'
    146  * @uses do_action() Calls 'bp_add_option_filters'
     143 * Add filters to each BP option, allowing them to be overloaded from inside the $bp->options array.
     144 *
     145 * Currently unused.
     146 *
     147 * @since BuddyPress (1.6.0)
     148 *
     149 * @uses bp_get_default_options() To get default options.
     150 * @uses add_filter() To add filters to 'pre_option_{$key}'.
     151 * @uses do_action() Calls 'bp_add_option_filters'.
    147152 */
    148153function bp_setup_option_filters() {
     
    160165
    161166/**
    162  * Filter default options and allow them to be overloaded from inside the
    163  * $bp->options array.
     167 * Filter default options and allow them to be overloaded from inside the $bp->options array.
     168 *
     169 * Currently unused.
    164170 *
    165171 * @since BuddyPress (1.6)
     
    187193
    188194/**
    189  * Retrieve an option
    190  *
    191  * This is a wrapper for get_blog_option(), which in turn stores settings data (such as bp-pages)
    192  * on the appropriate blog, given your current setup.
     195 * Retrieve an option.
     196 *
     197 * This is a wrapper for {@link get_blog_option()}, which in turn stores settings data
     198 * (such as bp-pages) on the appropriate blog, given your current setup.
    193199 *
    194200 * The 'bp_get_option' filter is primarily for backward-compatibility.
    195201 *
    196  * @package BuddyPress
    197  * @since BuddyPress (1.5)
     202 * @since BuddyPress (1.5.0)
    198203 *
    199204 * @uses bp_get_root_blog_id()
    200  * @param string $option_name The option to be retrieved
    201  * @param string $default Optional. Default value to be returned if the option isn't set
    202  * @return mixed The value for the option
     205 *
     206 * @param string $option_name The option to be retrieved.
     207 * @param string $default Optional. Default value to be returned if the option
     208 *        isn't set. See {@link get_blog_option()}.
     209 * @return mixed The value for the option.
    203210 */
    204211function bp_get_option( $option_name, $default = '' ) {
     
    209216
    210217/**
    211  * Save an option
    212  *
    213  * This is a wrapper for update_blog_option(), which in turn stores settings data (such as bp-pages)
    214  * on the appropriate blog, given your current setup.
    215  *
    216  * @package BuddyPress
    217  * @since BuddyPress (1.5)
     218 * Save an option.
     219 *
     220 * This is a wrapper for {@link update_blog_option()}, which in turn stores
     221 * settings data (such as bp-pages) on the appropriate blog, given your current
     222 * setup.
     223 *
     224 * @since BuddyPress (1.5.0)
    218225 *
    219226 * @uses bp_get_root_blog_id()
    220  * @param string $option_name The option key to be set
    221  * @param string $value The value to be set
     227 *
     228 * @param string $option_name The option key to be set.
     229 * @param string $value The value to be set.
    222230 */
    223231function bp_update_option( $option_name, $value ) {
     
    226234
    227235/**
    228  * Delete an option
    229  *
    230  * This is a wrapper for delete_blog_option(), which in turn deletes settings data (such as
    231  * bp-pages) on the appropriate blog, given your current setup.
    232  *
    233  * @package BuddyPress
    234  * @since BuddyPress (1.5)
     236 * Delete an option.
     237 *
     238 * This is a wrapper for {@link delete_blog_option()}, which in turn deletes
     239 * settings data (such as bp-pages) on the appropriate blog, given your current
     240 * setup.
     241 *
     242 * @since BuddyPress (1.5.0)
    235243 *
    236244 * @uses bp_get_root_blog_id()
    237  * @param string $option_name The option key to be set
     245 *
     246 * @param string $option_name The option key to be deleted.
    238247 */
    239248function bp_delete_option( $option_name ) {
     
    242251
    243252/**
    244  * When switching from single to multisite we need to copy blog options to
    245  * site options.
    246  *
    247  * This function is no longer used
    248  *
    249  * @package BuddyPress Core
    250  * @deprecated Since BuddyPress (1.6)
     253 * Copy BP options from a single site to multisite config.
     254 *
     255 * Run when switching from single to multisite and we need to copy blog options
     256 * to site options.
     257 *
     258 * This function is no longer used.
     259 *
     260 * @deprecated 1.6.0
    251261 */
    252262function bp_core_activate_site_options( $keys = array() ) {
     
    275285
    276286/**
     287 * Fetch global BP options.
     288 *
    277289 * BuddyPress uses common options to store configuration settings. Many of these
    278290 * settings are needed at run time. Instead of fetching them all and adding many
    279291 * initial queries to each page load, let's fetch them all in one go.
    280292 *
    281  * @package BuddyPress Core
    282  * @todo Use settings API and audit these methods
     293 * @todo Use settings API and audit these methods.
     294 *
     295 * @return array $root_blog_options_meta List of options.
    283296 */
    284297function bp_core_get_root_options() {
     
    376389 * Is profile sycing disabled?
    377390 *
    378  * @since BuddyPress (1.6)
    379  *
    380  * @param bool $default Optional.Default value true
    381  *
    382  * @uses bp_get_option() To get the profile sync option
    383  * @return bool Is profile sync enabled or not
     391 * @since BuddyPress (1.6.0)
     392 *
     393 * @uses bp_get_option() To get the profile sync option.
     394 *
     395 * @param bool $default Optional. Fallback value if not found in the database.
     396 *        Default: true.
     397 * @return bool True if profile sync is enabled, otherwise false.
    384398 */
    385399function bp_disable_profile_sync( $default = true ) {
     
    390404 * Is the Toolbar hidden for logged out users?
    391405 *
    392  * @since BuddyPress (1.6)
    393  *
    394  * @param bool $default Optional.Default value true
    395  *
    396  * @uses bp_get_option() To get the logged out Toolbar option
    397  * @return bool Is logged out Toolbar enabled or not
     406 * @since BuddyPress (1.6.0)
     407 *
     408 * @uses bp_get_option() To get the logged out Toolbar option.
     409 *
     410 * @param bool $default Optional. Fallback value if not found in the database.
     411 *        Default: true.
     412 * @return bool True if the admin bar should be hidden for logged-out users,
     413 *         otherwise false.
    398414 */
    399415function bp_hide_loggedout_adminbar( $default = true ) {
     
    404420 * Are members able to upload their own avatars?
    405421 *
    406  * @since BuddyPress (1.6)
    407  *
    408  * @param bool $default Optional. Default value true
    409  *
    410  * @uses bp_get_option() To get the avatar uploads option
    411  * @return bool Are avatar uploads allowed?
     422 * @since BuddyPress (1.6.0)
     423 *
     424 * @uses bp_get_option() To get the avatar uploads option.
     425 *
     426 * @param bool $default Optional. Fallback value if not found in the database.
     427 *        Default: true.
     428 * @return bool True if avatar uploads are disabled, otherwise false.
    412429 */
    413430function bp_disable_avatar_uploads( $default = true ) {
     
    418435 * Are members able to delete their own accounts?
    419436 *
    420  * @since BuddyPress (1.6)
    421  *
    422  * @param bool $default Optional. Default value
    423  *
    424  * @uses bp_get_option() To get the account deletion option
    425  * @return bool Is account deletion allowed?
     437 * @since BuddyPress (1.6.0)
     438 *
     439 * @uses bp_get_option() To get the account deletion option.
     440 *
     441 * @param bool $default Optional. Fallback value if not found in the database.
     442 *        Default: true.
     443 * @return bool True if users are able to delete their own accounts, otherwise
     444 *         false.
    426445 */
    427446function bp_disable_account_deletion( $default = false ) {
     
    432451 * Are blog and forum activity stream comments disabled?
    433452 *
    434  * @since BuddyPress (1.6)
    435  *
    436  * @param bool $default Optional. Default value false
    437  * @todo split and move into blog and forum components
    438  * @uses bp_get_option() To get the blog/forum comments option
    439  * @return bool Is blog/forum comments allowed?
     453 * @since BuddyPress (1.6.0)
     454 *
     455 * @todo split and move into blog and forum components.
     456 * @uses bp_get_option() To get the blog/forum comments option.
     457 *
     458 * @param bool $default Optional. Fallback value if not found in the database.
     459 *        Default: false.
     460 * @return bool True if activity comments are disabled for blog and forum
     461 *         items, otherwise false.
    440462 */
    441463function bp_disable_blogforum_comments( $default = false ) {
     
    446468 * Is group creation turned off?
    447469 *
    448  * @since BuddyPress (1.6)
    449  *
    450  * @param bool $default Optional. Default value true
    451  *
    452  * @todo Move into groups component
    453  * @uses bp_get_option() To get the group creation
    454  * @return bool Allow group creation?
     470 * @since BuddyPress (1.6.0)
     471 *
     472 * @todo Move into groups component.
     473 * @uses bp_get_option() To get the group creation.
     474 *
     475 * @param bool $default Optional. Fallback value if not found in the database.
     476 *        Default: true.
     477 * @return bool True if group creation is restricted, otherwise false.
    455478 */
    456479function bp_restrict_group_creation( $default = true ) {
     
    459482
    460483/**
    461  * Have we migrated to using the WordPress Toolbar?
    462  *
    463  * @since BuddyPress (1.6)
    464  *
    465  * @param bool $default Optional. Default value true
    466  *
    467  * @todo Move into groups component
    468  * @uses bp_get_option() To get the WP editor option
    469  * @return bool Use WP editor?
     484 * Should the old BuddyBar be forced in place of the WP admin bar?
     485 *
     486 * @since BuddyPress (1.6.0)
     487 *
     488 * @uses bp_get_option() To get the BuddyBar option.
     489 *
     490 * @param bool $default Optional. Fallback value if not found in the database.
     491 *        Default: true.
     492 * @return bool True if the BuddyBar should be forced on, otherwise false.
    470493 */
    471494function bp_force_buddybar( $default = true ) {
     
    474497
    475498/**
    476  * Output the group forums root parent forum id
    477  *
    478  * @since BuddyPress (1.6)
    479  *
    480  * @param bool $default Optional. Default value
     499 * Output the group forums root parent forum id.
     500 *
     501 * @since BuddyPress (1.6.0)
     502 *
     503 * @param bool $default Optional. Default: '0'.
    481504 */
    482505function bp_group_forums_root_id( $default = '0' ) {
     
    484507}
    485508    /**
    486      * Return the group forums root parent forum id
     509     * Return the group forums root parent forum id.
    487510     *
    488      * @since BuddyPress (1.6)
     511     * @since BuddyPress (1.6.0)
    489512     *
    490      * @param bool $default Optional. Default value 0
     513     * @uses bp_get_option() To get the root forum ID from the database.
    491514     *
    492      * @uses bp_get_option() To get the maximum title length
    493      * @return int Is anonymous posting allowed?
     515     * @param bool $default Optional. Default: '0'.
     516     * @return int The ID of the group forums root forum.
    494517     */
    495518    function bp_get_group_forums_root_id( $default = '0' ) {
     
    498521
    499522/**
    500  * Checks if BuddyPress Group Forums are enabled
    501  *
    502  * @since BuddyPress (1.6)
    503  *
    504  * @param bool $default Optional. Default value true
    505  *
    506  * @uses bp_get_option() To get the group forums option
    507  * @return bool Is group forums enabled or not
     523 * Check whether BuddyPress Group Forums are enabled.
     524 *
     525 * @since BuddyPress (1.6.0)
     526 *
     527 * @uses bp_get_option() To get the group forums option.
     528 *
     529 * @param bool $default Optional. Fallback value if not found in the database.
     530 *        Default: true.
     531 * @return bool True if group forums are active, otherwise false.
    508532 */
    509533function bp_is_group_forums_active( $default = true ) {
     
    512536
    513537/**
    514  * Checks if Akismet is enabled
    515  *
    516  * @since BuddyPress (1.6)
    517  *
    518  * @param bool $default Optional. Default value true
    519  *
    520  * @uses bp_get_option() To get the Akismet option
    521  * @return bool Is Akismet enabled or not
     538 * Check whether Akismet is enabled.
     539 *
     540 * @since BuddyPress (1.6.0)
     541 *
     542 * @uses bp_get_option() To get the Akismet option.
     543 *
     544 * @param bool $default Optional. Fallback value if not found in the database.
     545 *        Default: true.
     546 * @return bool True if Akismet is enabled, otherwise false.
    522547 */
    523548function bp_is_akismet_active( $default = true ) {
     
    526551
    527552/**
    528  * Get the current theme package ID
    529  *
    530  * @since BuddyPress (1.7)
    531  *
    532  * @param string $default Optional. Default value 'default'
    533  * @uses get_option() To get the subtheme option
    534  * @return string ID of the subtheme
     553 * Get the current theme package ID.
     554 *
     555 * @since BuddyPress (1.7.0)
     556 *
     557 * @uses get_option() To get the theme package option.
     558 *
     559 * @param bool $default Optional. Fallback value if not found in the database.
     560 *        Default: 'legacy'.
     561 * @return string ID of the theme package.
    535562 */
    536563function bp_get_theme_package_id( $default = 'legacy' ) {
Note: See TracChangeset for help on using the changeset viewer.