Changeset 26502 for trunk/src/wp-includes/ms-blogs.php
- Timestamp:
- 12/01/2013 05:31:49 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-blogs.php
r26120 r26502 18 18 19 19 update_blog_details( $wpdb->blogid, array('last_updated' => current_time('mysql', true)) ); 20 20 /** 21 * Fires after the blog details are updated. 22 * 23 * @since MU 24 * 25 * @param int $blog_id Blog ID. 26 */ 21 27 do_action( 'wpmu_blog_updated', $wpdb->blogid ); 22 28 } … … 208 214 restore_current_blog(); 209 215 216 /** 217 * Filter a blog's details. 218 * 219 * @since MU 220 * 221 * @param object $details The blog details. 222 */ 210 223 $details = apply_filters( 'blog_details', $details ); 211 224 … … 241 254 clean_blog_cache( $details ); 242 255 256 /** 257 * Fires after the blog details cache is cleared. 258 * 259 * @since 3.4.0 260 * 261 * @param int $blog_id Blog ID. 262 */ 243 263 do_action( 'refresh_blog_details', $blog_id ); 244 264 } … … 282 302 283 303 // If spam status changed, issue actions. 284 if ( $details[ 'spam' ] != $current_details[ 'spam' ] ) { 285 if ( $details[ 'spam' ] == 1 ) 304 if ( $details['spam'] != $current_details['spam'] ) { 305 if ( $details['spam'] == 1 ) { 306 /** 307 * Fires when the blog status is changed to 'spam'. 308 * 309 * @since MU 310 * 311 * @param int $blog_id Blog ID. 312 */ 286 313 do_action( 'make_spam_blog', $blog_id ); 287 else 314 } else { 315 /** 316 * Fires when the blog status is changed to 'ham'. 317 * 318 * @since MU 319 * 320 * @param int $blog_id Blog ID. 321 */ 288 322 do_action( 'make_ham_blog', $blog_id ); 323 } 289 324 } 290 325 291 326 // If mature status changed, issue actions. 292 if ( $details[ 'mature' ] != $current_details[ 'mature' ] ) { 293 if ( $details[ 'mature' ] == 1 ) 327 if ( $details['mature'] != $current_details['mature'] ) { 328 if ( $details['mature'] == 1 ) { 329 /** 330 * Fires when the blog status is changed to 'mature'. 331 * 332 * @since 3.1.0 333 * 334 * @param int $blog_id Blog ID. 335 */ 294 336 do_action( 'mature_blog', $blog_id ); 295 else 337 } else { 338 /** 339 * Fires when the blog status is changed to 'unmature'. 340 * 341 * @since 3.1.0 342 * 343 * @param int $blog_id Blog ID. 344 */ 296 345 do_action( 'unmature_blog', $blog_id ); 346 } 297 347 } 298 348 299 349 // If archived status changed, issue actions. 300 if ( $details[ 'archived' ] != $current_details[ 'archived' ] ) { 301 if ( $details[ 'archived' ] == 1 ) 350 if ( $details['archived'] != $current_details['archived'] ) { 351 if ( $details['archived'] == 1 ) { 352 /** 353 * Fires when the blog status is changed to 'archived'. 354 * 355 * @since MU 356 * 357 * @param int $blog_id Blog ID. 358 */ 302 359 do_action( 'archive_blog', $blog_id ); 303 else 360 } else { 361 /** 362 * Fires when the blog status is changed to 'unarchived'. 363 * 364 * @since MU 365 * 366 * @param int $blog_id Blog ID. 367 */ 304 368 do_action( 'unarchive_blog', $blog_id ); 369 } 305 370 } 306 371 307 372 // If deleted status changed, issue actions. 308 if ( $details[ 'deleted' ] != $current_details[ 'deleted' ] ) { 309 if ( $details[ 'deleted' ] == 1 ) 373 if ( $details['deleted'] != $current_details['deleted'] ) { 374 if ( $details['deleted'] == 1 ) { 375 /** 376 * Fires when the blog status is changed to 'deleted'. 377 * 378 * @since 3.5.0 379 * 380 * @param int $blog_id Blog ID. 381 */ 310 382 do_action( 'make_delete_blog', $blog_id ); 311 else 383 } else { 384 /** 385 * Fires when the blog status is changed to 'undeleted'. 386 * 387 * @since 3.5.0 388 * 389 * @param int $blog_id Blog ID. 390 */ 312 391 do_action( 'make_undelete_blog', $blog_id ); 313 } 314 315 if ( isset( $details[ 'public' ] ) ) { 392 } 393 } 394 395 if ( isset( $details['public'] ) ) { 316 396 switch_to_blog( $blog_id ); 317 update_option( 'blog_public', $details[ 'public'] );397 update_option( 'blog_public', $details['public'] ); 318 398 restore_current_blog(); 319 399 } … … 374 454 restore_current_blog(); 375 455 376 return apply_filters( 'blog_option_' . $option, $value, $id ); 456 /** 457 * Filter a blog option value. 458 * 459 * The dynamic portion of the hook name, $option, refers to the blog option name. 460 * 461 * @since 3.5.0 462 * 463 * @param string $value The option value. 464 * @param int $id Blog ID. 465 */ 466 return apply_filters( "blog_option_{$option}", $value, $id ); 377 467 } 378 468 … … 490 580 $GLOBALS['_wp_switched_stack'][] = $GLOBALS['blog_id']; 491 581 492 /* If we're switching to the same blog id that we're on, 493 * set the right vars, do the associated actions, but skip 494 * the extra unnecessary work */ 582 /* 583 * If we're switching to the same blog id that we're on, 584 * set the right vars, do the associated actions, but skip 585 * the extra unnecessary work 586 */ 495 587 if ( $new_blog == $GLOBALS['blog_id'] ) { 588 /** 589 * Fires when the blog is switched. 590 * 591 * @since MU 592 * 593 * @param int $new_blog New blog ID. 594 * @param int $new_blog Blog ID. 595 */ 496 596 do_action( 'switch_blog', $new_blog, $new_blog ); 497 597 $GLOBALS['switched'] = true; … … 531 631 } 532 632 633 /** This filter is documented in wp-includes/ms-blogs.php */ 533 634 do_action( 'switch_blog', $new_blog, $prev_blog_id ); 534 635 $GLOBALS['switched'] = true; … … 554 655 555 656 if ( $GLOBALS['blog_id'] == $blog ) { 657 /** This filter is documented in wp-includes/ms-blogs.php */ 556 658 do_action( 'switch_blog', $blog, $blog ); 557 659 // If we still have items in the switched stack, consider ourselves still 'switched' … … 592 694 } 593 695 696 /** This filter is documented in wp-includes/ms-blogs.php */ 594 697 do_action( 'switch_blog', $blog, $prev_blog_id ); 595 698 … … 663 766 refresh_blog_details( $blog_id ); 664 767 665 if ( 'spam' == $pref ) 666 ( $value == 1 ) ? do_action( 'make_spam_blog', $blog_id ) : do_action( 'make_ham_blog', $blog_id ); 667 elseif ( 'mature' == $pref ) 668 ( $value == 1 ) ? do_action( 'mature_blog', $blog_id ) : do_action( 'unmature_blog', $blog_id ); 669 elseif ( 'archived' == $pref ) 670 ( $value == 1 ) ? do_action( 'archive_blog', $blog_id ) : do_action( 'unarchive_blog', $blog_id ); 671 elseif ( 'deleted' == $pref ) 672 ( $value == 1 ) ? do_action( 'make_delete_blog', $blog_id ) : do_action( 'make_undelete_blog', $blog_id ); 673 elseif ( 'public' == $pref ) 768 if ( 'spam' == $pref ) { 769 if ( $value == 1 ) { 770 /** This filter is documented in wp-includes/ms-blogs.php */ 771 do_action( 'make_spam_blog', $blog_id ); 772 } else { 773 /** This filter is documented in wp-includes/ms-blogs.php */ 774 do_action( 'make_ham_blog', $blog_id ); 775 } 776 } elseif ( 'mature' == $pref ) { 777 if ( $value == 1 ) { 778 /** This filter is documented in wp-includes/ms-blogs.php */ 779 do_action( 'mature_blog', $blog_id ); 780 } else { 781 /** This filter is documented in wp-includes/ms-blogs.php */ 782 do_action( 'unmature_blog', $blog_id ); 783 } 784 } elseif ( 'archived' == $pref ) { 785 if ( $value == 1 ) { 786 /** This filter is documented in wp-includes/ms-blogs.php */ 787 do_action( 'archive_blog', $blog_id ); 788 } else { 789 /** This filter is documented in wp-includes/ms-blogs.php */ 790 do_action( 'unarchive_blog', $blog_id ); 791 } 792 } elseif ( 'deleted' == $pref ) { 793 if ( $value == 1 ) { 794 /** This filter is documented in wp-includes/ms-blogs.php */ 795 do_action( 'make_delete_blog', $blog_id ); 796 } else { 797 /** This filter is documented in wp-includes/ms-blogs.php */ 798 do_action( 'make_undelete_blog', $blog_id ); 799 } 800 } elseif ( 'public' == $pref ) { 801 /** 802 * Fires after the current blog's 'public' setting is updated. 803 * 804 * @since MU 805 * 806 * @param int $blog_id Blog ID. 807 * @param string $value The value of blog status. 808 */ 674 809 do_action( 'update_blog_public', $blog_id, $value ); // Moved here from update_blog_public(). 810 } 675 811 676 812 return $value;
Note: See TracChangeset
for help on using the changeset viewer.