update_blog_details [ WordPress Function ]
update_blog_details ( $blog_id, $details = array() )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: update_blog_status, get_blog_details, update_blog_option, refresh_blog_details, update_blog_public
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_id, false);
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_intersect( array_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' ] == 1 )
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 ]
Top Google zoekresultaten
- Function Reference/update blog details « WordPress Codex
1 Description; 2 Parameters; 3 Return Values; 4 Source File. Description. Update the details for a blog. Updates the blogs table for a given blog id. Parameters ...
codex.wordpress.org - <?php /** * Site/blog functions that work with the blogs table and ...
@since MU */ function wpmu_update_blogs_date() { global $wpdb; update_blog_details( $wpdb->blogid, array('last_updated' => current_time('mysql ', true)) ) ...
core.svn.wordpress.org - #20305 (update_blog_status should also handle delete/undelete ...
Then function update_blog_details defined in /includes/ms-blogs.php handles ... Hence the corresponding code should go into function update_blog_details ...
core.trac.wordpress.org - update_blog_details | A HitchHackers guide through WordPress
Feb 12, 2011 ... function update_blog_details( $blog_id, $details = array() ) { global $wpdb; if ( empty($details) ) return false; if ( is_object($details) ) $details ...
hitchhackerguide.com