update_site_option [ WordPress Function ]
update_site_option ( $option, $value )
| Parameters: |
|
| Uses: | |
| See: | |
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: update_user_option, update_option, delete_site_option, get_site_option, add_site_option
Update the value of a site option that was already added.
Source
<?php
function update_site_option( $option, $value ) {
global $wpdb;
$oldvalue = get_site_option( $option );
$value = apply_filters( 'pre_update_site_option_' . $option, $value, $oldvalue );
if ( $value === $oldvalue )
return false;
if ( false === $oldvalue )
return add_site_option( $option, $value );
if ( !is_multisite() ) {
$result = update_option( $option, $value );
} else {
$value = sanitize_option( $option, $value );
$cache_key = "{$wpdb->siteid}:$option";
wp_cache_set( $cache_key, $value, 'site-options' );
$_value = $value;
$value = maybe_serialize( $value );
$result = $wpdb->update( $wpdb->sitemeta, array( 'meta_value' => $value ), array( 'site_id' => $wpdb->siteid, 'meta_key' => $option ) );
$value = $_value;
}
if ( $result ) {
do_action( "update_site_option_{$option}", $option, $value, $oldvalue );
do_action( "update_site_option", $option, $value, $oldvalue );
return true;
}
return false;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- WPMU Functions/update site option « WordPress Codex
Description. Updates global (i.e. networkwide, not for the current blog) key and value data with the provided un-sanitized information. This function has been ...
codex.wordpress.org - WordPress › Support » update_site_option( ) fails for (pretty) large data
I cannot test this on 3.0.1 right now. By the way, I'm trying to cache a result set for 5 minutes into a site option with update_site_option( ) and get_site_option( ) ...
wordpress.org - WordPress options in Standalone vs Multisite ( aka update_option ...
Dec 14, 2011 ... While researching how data needed to be migrated for Multisite functionality in BackupBuddy I've had to do a lot of digging into the differences ...
www.dustinbolton.com - update_site_option Wordpress hook details -- Adam Brown, BYU ...
WordPress version history for update_site_option ... We find related hooks using word stems. update_site_option has 3 significant word stem(s): update , site ...
adambrown.info