Skip to:
Content

bbPress.org

Changeset 4208


Ignore:
Timestamp:
09/08/2012 10:46:45 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Options:

  • Wrap some options loops in array_keys() to prevent making unnecessary $value variables.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bbp-includes/bbp-core-options.php

    r4193 r4208  
    137137
    138138    // Add default options
    139     foreach ( bbp_get_default_options() as $key => $value )
     139    foreach ( array_keys( bbp_get_default_options() ) as $key )
    140140        delete_option( $key );
    141141
     
    156156
    157157    // Add filters to each bbPress option
    158     foreach ( bbp_get_default_options() as $key => $value )
     158    foreach ( array_keys( bbp_get_default_options() ) as $key )
    159159        add_filter( 'pre_option_' . $key, 'bbp_pre_get_option' );
    160160
     
    172172 */
    173173function bbp_pre_get_option( $value = '' ) {
    174     $bbp = bbpress();
    175174
    176175    // Remove the filter prefix
     
    178177
    179178    // Check the options global for preset value
    180     if ( isset( $bbp->options[$option] ) )
    181         $value = $bbp->options[$option];
     179    if ( isset( bbpress()->options[$option] ) )
     180        $value = bbpress()->options[$option];
    182181
    183182    // Always return a value, even if false
Note: See TracChangeset for help on using the changeset viewer.