Changeset 18587
- Timestamp:
- 08/23/2011 08:24:35 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r18567 r18587 570 570 * resources can not be serialized or added as an option. 571 571 * 572 * You can create options without values and then add values later. Does not573 * check whether the option has already been added, but does checkthat you572 * You can create options without values and then update the values later. 573 * Existing options will not be updated and checks are performed to ensure that you 574 574 * aren't adding a protected WordPress option. Care should be taken to not name 575 * options the same as the ones which are protected and to not add options 576 * that were already added. 575 * options the same as the ones which are protected. 577 576 * 578 577 * @package WordPress … … 3776 3775 * Add a new site option. 3777 3776 * 3777 * Existing options will not be updated. Note that prior to 3.3 this wasn't the case. 3778 * 3778 3779 * @see add_option() 3779 3780 * @package WordPress … … 3800 3801 3801 3802 if ( $wpdb->get_row( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) ) ) 3802 return update_site_option( $option, $value );3803 return false; 3803 3804 3804 3805 $value = sanitize_option( $option, $value ); … … 3811 3812 } 3812 3813 3813 do_action( "add_site_option_{$option}", $option, $value ); 3814 do_action( "add_site_option", $option, $value ); 3815 3816 return $result; 3814 if ( $result ) { 3815 do_action( "add_site_option_{$option}", $option, $value ); 3816 do_action( "add_site_option", $option, $value ); 3817 return true; 3818 } 3819 return false; 3817 3820 } 3818 3821
Note: See TracChangeset
for help on using the changeset viewer.