Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




delete_site_option [ WordPress Function ]

delete_site_option ( $option )
Parameters:
  • (string) $option Name of option to remove. Expected to not be SQL-escaped.
Uses:
See:
Returns:
  • (bool) True, if succeed. False, if failure.
Defined at:



Removes site option by name.

Source


<?php
function delete_site_option$option ) {
    global 
$wpdb;

    
// ms_protect_special_option( $option ); @todo

    
do_action'pre_delete_site_option_' $option );

    if ( !
is_multisite() ) {
        
$result delete_option$option );
    } else {
        
$row $wpdb->get_row$wpdb->prepare"SELECT meta_id FROM {$wpdb->sitemeta} WHERE meta_key = %s AND site_id = %d"$option$wpdb->siteid ) );
        if ( 
is_null$row ) || !$row->meta_id )
            return 
false;
        
$cache_key "{$wpdb->siteid}:$option";
        
wp_cache_delete$cache_key'site-options' );

        
$result $wpdb->delete$wpdb->sitemeta, array( 'meta_key' => $option'site_id' => $wpdb->siteid ) );
    }

    if ( 
$result ) {
        
do_action"delete_site_option_{$option}"$option );
        
do_action"delete_site_option"$option );
        return 
true;
    }
    return 
false;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics