add_site_option [ WordPress Function ]
add_site_option ( $option, $value )
| Parameters: |
|
| Uses: | |
| See: | |
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: add_screen_option, add_option, get_site_option, delete_site_option, update_site_option
Add a new site option.
Existing options will not be updated. Note that prior to 3.3 this wasn't the case.
Source
<?php
function add_site_option( $option, $value ) {
global $wpdb;
$value = apply_filters( 'pre_add_site_option_' . $option, $value );
if ( !is_multisite() ) {
$result = add_option( $option, $value );
} else {
$cache_key = "{$wpdb->siteid}:$option";
if ( false !== get_site_option( $option ) )
return false;
$value = sanitize_option( $option, $value );
wp_cache_set( $cache_key, $value, 'site-options' );
$_value = $value;
$value = maybe_serialize( $value );
$result = $wpdb->insert( $wpdb->sitemeta, array('site_id' => $wpdb->siteid, 'meta_key' => $option, 'meta_value' => $value ) );
$value = $_value;
}
if ( $result ) {
do_action( "add_site_option_{$option}", $option, $value );
do_action( "add_site_option", $option, $value );
return true;
}
return false;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- WPMU Functions/add site option « WordPress Codex
Description. Adds a new site option and returns the ID of the inserted post in the table (wp_sitemeta). Existing site options will not be updated by this function.
codex.wordpress.org - (add_site_option() and update_site_option() not ... - WordPress Trac
add_site_option() and update_site_option() not working correctly when non-false default is loaded into the cache. Reported by: boonebgorges, Owned by: ...
core.trac.wordpress.org - get_, update_ and add_site_option()
October 21, 2007, 9:30 pm. get_, update_ and add_site_option(). Summary: These functions get or set site option variables according to user specification.
holisticnetworking.net - add_site_option() WordPress function reference, arguments and ...
add_site_option( $option, $value ). option: (string) Name of option to add. Expected to not be SQL-escaped. value: (mixed) Optional. Option value, can be ...
queryposts.com