Switch language

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




update_blog_status [ WordPress Function ]

update_blog_status ( $blog_id, $pref, $value, $deprecated = null )
Parameters:
  • (int) $blog_id BLog ID
  • (string) $pref A field name
  • (string) $value Value for $pref
Returns:
  • (string) $value
Defined at:



Update a blog details field.

Source


<?php
function update_blog_status$blog_id$pref$value$deprecated null ) {
    global 
$wpdb;

    if ( 
null !== $deprecated  )
        
_deprecated_argument__FUNCTION__'3.1' );

    if ( !
in_array$pref, array( 'site_id''domain''path''registered''last_updated''public''archived''mature''spam''deleted''lang_id') ) )
        return 
$value;

    
$wpdb->update$wpdb->blogs, array($pref => $value'last_updated' => current_time('mysql'true)), array('blog_id' => $blog_id) );

    
refresh_blog_details($blog_id);

    if ( 
'spam' == $pref )
        ( 
$value == ) ? do_action'make_spam_blog'$blog_id ) :    do_action'make_ham_blog'$blog_id );
    elseif ( 
'mature' == $pref )
        ( 
$value == ) ? do_action'mature_blog'$blog_id ) : do_action'unmature_blog'$blog_id );
    elseif ( 
'archived' == $pref )
        ( 
$value == ) ? do_action'archive_blog'$blog_id ) : do_action'unarchive_blog'$blog_id );
    elseif ( 
'archived' == $pref )
        ( 
$value == ) ? do_action'archive_blog'$blog_id ) : do_action'unarchive_blog'$blog_id );

    return 
$value;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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