Ticket #25229: ms.diff
File ms.diff, 9.3 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/ms.php
40 40 41 41 return $file; 42 42 } 43 43 44 add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' ); 44 45 45 46 /** … … 61 62 } 62 63 63 64 $blog = get_blog_details( $blog_id ); 64 65 /** 66 * Fires before a blog is deleted. 67 * 68 * @since 3.0 69 * 70 * @param int $blog_id Blog ID. 71 * @param bool $drop True if blog's table should be dropped. Default is false. 72 */ 65 73 do_action( 'delete_blog', $blog_id, $drop ); 66 74 67 75 $users = get_users( array( 'blog_id' => $blog_id, 'fields' => 'ids' ) ); … … 80 88 $drop = false; 81 89 82 90 if ( $drop ) { 91 /** 92 * Allows you to modify the tables that you want to be dropped when the blog is deleted. 93 * 94 * @since 3.0 95 * 96 * @param array Blog tables that you want to be dropped. 97 * @param int $blog_id Blog ID of the blog which tables are going to be dropped. 98 */ 83 99 $drop_tables = apply_filters( 'wpmu_drop_tables', $wpdb->tables( 'blog' ), $blog_id ); 84 100 85 101 foreach ( (array) $drop_tables as $table ) { … … 89 105 $wpdb->delete( $wpdb->blogs, array( 'blog_id' => $blog_id ) ); 90 106 91 107 $uploads = wp_upload_dir(); 108 /** 109 * Allows you to modify the upload base directory that is going to be deleted when the blog is deleted. 110 * 111 * @since 3.0 112 * 113 * @param string $uploads['basedir'] uploads path without subdirectory. see wp_upload_dir(). 114 * @param int $blog_id Blog ID. 115 */ 92 116 $dir = apply_filters( 'wpmu_delete_blog_upload_dir', $uploads['basedir'], $blog_id ); 93 117 $dir = rtrim( $dir, DIRECTORY_SEPARATOR ); 94 118 $top_dir = $dir; … … 137 161 138 162 if ( !$user->exists() ) 139 163 return false; 140 164 /** 165 * Fires before a user is deleted from the network 166 * 167 * Long description. 168 * 169 * @since 3.0 170 * 171 * @param int $id User ID of the user about to be deleted from the network. 172 * 173 */ 141 174 do_action( 'wpmu_delete_user', $id ); 142 175 143 176 $blogs = get_blogs_of_user( $id ); … … 172 205 173 206 clean_user_cache( $user ); 174 207 175 // allow for commit transaction 208 209 /** 210 * Fires after the user has been deleted. Allow for commit transaction. 211 * 212 * This hook also occures in /wp-admin/includes/user.php 213 * 214 * @since Unknown 215 * 216 * @param int $id User ID of the user about to be deleted from the network. 217 */ 176 218 do_action( 'deleted_user', $id ); 177 219 178 220 return true; … … 189 231 'newemail' => $value 190 232 ); 191 233 update_option( 'adminhash', $new_admin_email ); 192 234 /** 235 * Allows you to overwrite the email that gets sent out when administration email is requested to be changed. 236 * 237 * The Following string have a special meaning and will get replaced dynamically. 238 * ###ADMIN_URL### The link to click on to confirm the email change. Required otherwise this functunalty is will break. 239 * ###EMAIL### The new email. 240 * ###SITENAME### The name of the site. 241 * ###SITEURL### The url to the site. 242 * 243 * @since 3.0 244 * 245 * @param string Text in the email. 246 * @param string $new_admin_email New admin email that the current administration email was changed to. 247 */ 193 248 $content = apply_filters( 'new_admin_email_content', __( "Dear user, 194 249 195 250 You recently requested to have the administration email address on … … 243 298 'newemail' => $_POST['email'] 244 299 ); 245 300 update_option( $current_user->ID . '_new_email', $new_user_email ); 246 301 /** 302 * Allows you to overwrite the email that gets sent out when a user changes emails. 303 * 304 * The Following string have a special meaning and will get replaced dynamically. 305 * ###ADMIN_URL### The link to click on to confirm the email change. Required otherwise this functunalty is will break. 306 * ###EMAIL### The new email. 307 * ###SITENAME### The name of the site. 308 * ###SITEURL### The url to the site. 309 * 310 * @since 3.0 311 * 312 * @param string Text in the email. 313 * @param string $new_admin_email New admin email that the current administration email was changed to. 314 */ 247 315 $content = apply_filters( 'new_user_email_content', __( "Dear user, 248 316 249 317 You recently requested to have the email address on your account changed. … … 377 445 clean_user_cache( $user ); 378 446 379 447 if ( $pref == 'spam' ) { 380 if ( $value == 1 ) 448 if ( $value == 1 ) { 449 /** 450 * Fires when the user is marked as a SPAM user. 451 * 452 * @since 3.0 453 * 454 * @param int $id User Id of the user marked as spam. 455 */ 381 456 do_action( 'make_spam_user', $id ); 382 else 457 } else { 458 /** 459 * Fires when the user is marked as a HAM user. Opposite of SPAM. 460 * 461 * @since 3.0 462 * 463 * @param int $id User Id of the user marked as ham. 464 */ 383 465 do_action( 'make_ham_user', $id ); 466 } 384 467 } 385 468 386 469 return $value; … … 411 494 'sg' => 'Sango', 'sa' => 'Sanskrit', 'sr' => 'Serbian', 'hr' => 'Croatian', 'si' => 'Sinhala; Sinhalese', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'se' => 'Northern Sami', 'sm' => 'Samoan', 'sn' => 'Shona', 'sd' => 'Sindhi', 'so' => 'Somali', 'st' => 'Sotho, Southern', 'es' => 'Spanish; Castilian', 'sc' => 'Sardinian', 'ss' => 'Swati', 'su' => 'Sundanese', 'sw' => 'Swahili', 412 495 'sv' => 'Swedish', 'ty' => 'Tahitian', 'ta' => 'Tamil', 'tt' => 'Tatar', 'te' => 'Telugu', 'tg' => 'Tajik', 'tl' => 'Tagalog', 'th' => 'Thai', 'bo' => 'Tibetan', 'ti' => 'Tigrinya', 'to' => 'Tonga (Tonga Islands)', 'tn' => 'Tswana', 'ts' => 'Tsonga', 'tk' => 'Turkmen', 'tr' => 'Turkish', 'tw' => 'Twi', 'ug' => 'Uighur; Uyghur', 'uk' => 'Ukrainian', 'ur' => 'Urdu', 'uz' => 'Uzbek', 413 496 've' => 'Venda', 'vi' => 'Vietnamese', 'vo' => 'Volapük', 'cy' => 'Welsh','wa' => 'Walloon','wo' => 'Wolof', 'xh' => 'Xhosa', 'yi' => 'Yiddish', 'yo' => 'Yoruba', 'za' => 'Zhuang; Chuang', 'zu' => 'Zulu' ); 497 498 /** 499 * Filter allows the ability to modify langage codes. 500 * 501 * This could be used if you want to changed the long form of a specific code. 502 * 503 * @since 3.0 504 * 505 * @param array $lang_codes. Key Value Pair of Language Codes where key is the short version. 506 * @param string $code is a 2 letter desigantion of the language. 507 */ 414 508 $lang_codes = apply_filters( 'lang_codes', $lang_codes, $code ); 415 509 return strtr( $code, $lang_codes ); 416 510 } … … 498 592 499 593 // Order by name 500 594 uksort( $output, 'strnatcasecmp' ); 501 595 /** 596 * Allows you to modify the langage dropdown of langages available. 597 * 598 * @since 3.0 599 * 600 * @param array $output HTML output of the dropdown. 601 * @param array $lang_files of langage files that are available. 602 * @param string $current The current langage code. 603 */ 502 604 $output = apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current ); 503 605 echo implode( "\n\t", $output ); 504 606 } … … 575 677 <?php if ( in_array( get_site_option( 'registration' ), array( 'all', 'blog' ) ) ) : ?> 576 678 <tr> 577 679 <th scope="row" colspan="2" class="th-full"> 578 <a href="<?php echo apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); ?>"><?php _e( 'Create a New Site' ); ?></a> 680 <a href="<?php 681 682 /** 683 * Allows you to modify the url to the site creation location. 684 * 685 * Also found in wp-login.php and wp-includes/canonical.php. 686 * 687 * @since 3.0 688 * 689 * @param string Url to the site creation location. 690 */ 691 echo apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); ?>"><?php _e( 'Create a New Site' ); ?></a> 579 692 </th> 580 693 </tr> 581 694 <?php endif; ?> … … 595 708 // If global super_admins override is defined, there is nothing to do here. 596 709 if ( isset($super_admins) ) 597 710 return false; 598 711 712 /** 713 * Fires before the user is being made a super admin. 714 * 715 * @since 3.0 716 * 717 * @param $int $user_id 718 */ 599 719 do_action( 'grant_super_admin', $user_id ); 600 720 601 721 // Directly fetch site_admins instead of using get_super_admins() … … 605 725 if ( $user && ! in_array( $user->user_login, $super_admins ) ) { 606 726 $super_admins[] = $user->user_login; 607 727 update_site_option( 'site_admins' , $super_admins ); 728 729 /** 730 * Fires after the user is made a super admin. 731 * 732 * @since 3.0 733 * 734 * @param $int $user_id 735 */ 608 736 do_action( 'granted_super_admin', $user_id ); 609 737 return true; 610 738 } … … 623 751 // If global super_admins override is defined, there is nothing to do here. 624 752 if ( isset($super_admins) ) 625 753 return false; 626 754 /** 755 * Fires before the user is removed as a super admin. 756 * 757 * @since 3.0 758 * 759 * @param $int $user_id 760 */ 627 761 do_action( 'revoke_super_admin', $user_id ); 628 762 629 763 // Directly fetch site_admins instead of using get_super_admins() … … 634 768 if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) { 635 769 unset( $super_admins[$key] ); 636 770 update_site_option( 'site_admins', $super_admins ); 771 772 /** 773 * Fires after the user is removed as a super admin. 774 * 775 * @since 3.0 776 * 777 * @param $int $user_id 778 */ 637 779 do_action( 'revoked_super_admin', $user_id ); 638 780 return true; 639 781 } … … 656 798 $result = true; 657 799 else 658 800 $result = false; 659 801 /** 802 * Allwes you to overwrite whether or not we can edit this network from a particular page. 803 * 804 * @since 3.1.0 805 * 806 * @param bool $result Can you edit this network from this page? 807 * @param int $site_id The network/site id to check. Different from blog id. 808 */ 660 809 return apply_filters( 'can_edit_network', $result, $site_id ); 661 810 } 662 811