Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: make_spam_blog

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
248      $fields = array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id');
249      foreach ( array_intersect( array_keys( $details ), $fields ) as $field )
250           $update_details[$field] = $details[$field];
251
252      $wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) );
253
254      // If spam status changed, issue actions.
255      if ( $details[ 'spam' ] != $current_details[ 'spam' ] ) {
256           if ( $details[ 'spam' ] == 1 )
257                do_action( "make_spam_blog", $blog_id );
258           else
259                do_action( "make_ham_blog", $blog_id );
260      }
261
262      if ( isset($details[ 'public' ]) )
263           update_blog_option( $blog_id, 'blog_public', $details[ 'public' ], false );
264
265      refresh_blog_details($blog_id);
266
 
Line Code
510           return $value;
511
512      $wpdb->update( $wpdb->blogs, array($pref => $value, 'last_updated' => current_time('mysql', true)), array('blog_id' => $blog_id) );
513
514      if ( $refresh )
515           refresh_blog_details($blog_id);
516
517      if ( $pref == 'spam' ) {
518           if ( $value == 1 )
519                do_action( "make_spam_blog", $blog_id );
520           else
521                do_action( "make_ham_blog", $blog_id );
522      }
523
524      return $value;
525 }
526
527 function get_blog_status( $id, $pref ) {
528      global $wpdb;