Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2012 08:45:05 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Move _option functions into bp-core-options.php

File:
1 edited

Legend:

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

    r5723 r5724  
    5656
    5757/** Functions *****************************************************************/
    58 
    59 /**
    60  * Retrieve an option
    61  *
    62  * This is a wrapper for get_blog_option(), which in turn stores settings data (such as bp-pages)
    63  * on the appropriate blog, given your current setup.
    64  *
    65  * The 'bp_get_option' filter is primarily for backward-compatibility.
    66  *
    67  * @package BuddyPress
    68  * @since 1.5
    69  *
    70  * @uses bp_get_root_blog_id()
    71  * @param str $option_name The option to be retrieved
    72  * @param str $default Optional. Default value to be returned if the option isn't set
    73  * @return mixed The value for the option
    74  */
    75 function bp_get_option( $option_name, $default = '' ) {
    76     $value = get_blog_option( bp_get_root_blog_id(), $option_name, $default );
    77 
    78     return apply_filters( 'bp_get_option', $value );
    79 }
    80 
    81 /**
    82  * Save an option
    83  *
    84  * This is a wrapper for update_blog_option(), which in turn stores settings data (such as bp-pages)
    85  * on the appropriate blog, given your current setup.
    86  *
    87  * @package BuddyPress
    88  * @since 1.5
    89  *
    90  * @uses bp_get_root_blog_id()
    91  * @param str $option_name The option key to be set
    92  * @param str $value The value to be set
    93  */
    94 function bp_update_option( $option_name, $value ) {
    95     update_blog_option( bp_get_root_blog_id(), $option_name, $value );
    96 }
    97 
    98 /**
    99  * Delete an option
    100  *
    101  * This is a wrapper for delete_blog_option(), which in turn deletes settings data (such as
    102  * bp-pages) on the appropriate blog, given your current setup.
    103  *
    104  * @package BuddyPress
    105  * @since 1.5
    106  *
    107  * @uses bp_get_root_blog_id()
    108  * @param str $option_name The option key to be set
    109  */
    110 function bp_delete_option( $option_name ) {
    111     delete_blog_option( bp_get_root_blog_id(), $option_name );
    112 }
    11358
    11459/**
Note: See TracChangeset for help on using the changeset viewer.