Switch language

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




update_blog_details [ WordPress Function ]

update_blog_details ( $blog_id, $details = array() )
Parameters:
  • (int) $blog_id Blog ID
  • (array) $details Array of details keyed by blogs table field names.
Returns:
  • (bool) True if update succeeds, false otherwise.
Defined at:



Update the details for a blog. Updates the blogs table for a given blog id.

Source


<?php
function update_blog_details$blog_id$details = array() ) {
    global 
$wpdb;

    if ( empty(
$details) )
        return 
false;

    if ( 
is_object($details) )
        
$details get_object_vars($details);

    
$current_details get_blog_details($blog_idfalse);
    if ( empty(
$current_details) )
        return 
false;

    
$current_details get_object_vars($current_details);

    
$details array_merge($current_details$details);
    
$details['last_updated'] = current_time('mysql'true);

    
$update_details = array();
    
$fields = array( 'site_id''domain''path''registered''last_updated''public''archived''mature''spam''deleted''lang_id');
    foreach ( 
array_intersectarray_keys$details ), $fields ) as $field )
        
$update_details[$field] = $details[$field];

    
$wpdb->update$wpdb->blogs$update_details, array('blog_id' => $blog_id) );

    
// If spam status changed, issue actions.
    
if ( $details'spam' ] != $current_details'spam' ] ) {
        if ( 
$details'spam' ] == )
            
do_action"make_spam_blog"$blog_id );
        else
            
do_action"make_ham_blog"$blog_id );
    }

    if ( isset(
$details'public' ]) )
        
update_blog_option$blog_id'blog_public'$details'public' ] );

    
refresh_blog_details($blog_id);

    return 
true;
}
?>

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