Ticket #25229: ms.2.diff
File ms.2.diff, 10.4 KB (added by , 11 years ago) |
---|
-
ms.php
61 61 } 62 62 63 63 $blog = get_blog_details( $blog_id ); 64 64 /** 65 * Fires before a blog is deleted. 66 * 67 * @since 3.0.0 68 * 69 * @param int $blog_id Blog ID. 70 * @param bool $drop True if blog's table should be dropped. Default is false. 71 */ 65 72 do_action( 'delete_blog', $blog_id, $drop ); 66 73 67 74 $users = get_users( array( 'blog_id' => $blog_id, 'fields' => 'ids' ) ); … … 80 87 $drop = false; 81 88 82 89 if ( $drop ) { 90 /** 91 * Filter the tables to drop when the blog is deleted. 92 * 93 * @since 3.0.0 94 * 95 * @param array Blog tables that you want to be dropped. 96 * @param int $blog_id Blog ID of the blog which tables are going to be dropped. 97 */ 83 98 $drop_tables = apply_filters( 'wpmu_drop_tables', $wpdb->tables( 'blog' ), $blog_id ); 84 99 85 100 foreach ( (array) $drop_tables as $table ) { … … 89 104 $wpdb->delete( $wpdb->blogs, array( 'blog_id' => $blog_id ) ); 90 105 91 106 $uploads = wp_upload_dir(); 107 /** 108 * Filter the upload base directory to delete when the blog is deleted. 109 * 110 * @since 3.0.0 111 * 112 * @param string $uploads['basedir'] uploads path without subdirectory. see wp_upload_dir(). 113 * @param int $blog_id Blog ID. 114 */ 92 115 $dir = apply_filters( 'wpmu_delete_blog_upload_dir', $uploads['basedir'], $blog_id ); 93 116 $dir = rtrim( $dir, DIRECTORY_SEPARATOR ); 94 117 $top_dir = $dir; … … 137 160 138 161 if ( !$user->exists() ) 139 162 return false; 140 163 /** 164 * Fires when a user is deleted from the network 165 * 166 * Long description. 167 * 168 * @since 3.0.0 169 * 170 * @param int $id User ID of the user about to be deleted from the network. 171 * 172 */ 141 173 do_action( 'wpmu_delete_user', $id ); 142 174 143 175 $blogs = get_blogs_of_user( $id ); … … 172 204 173 205 clean_user_cache( $user ); 174 206 175 // allow for commit transaction 207 208 /** 209 * Fires after the user is deleted. Allow for commit transaction. 210 * 211 * This hook also occures in /wp-admin/includes/user.php 212 * 213 * @since 2.8.0 214 * 215 * @param int $id User ID of the user about to be deleted from the network. 216 */ 176 217 do_action( 'deleted_user', $id ); 177 218 178 219 return true; … … 189 230 'newemail' => $value 190 231 ); 191 232 update_option( 'adminhash', $new_admin_email ); 233 234 $email_text = "Dear user, 192 235 193 $content = apply_filters( 'new_admin_email_content', __( "Dear user,194 195 236 You recently requested to have the administration email address on 196 237 your site changed. 197 238 If this is correct, please click on the following link to change it: … … 204 245 205 246 Regards, 206 247 All at ###SITENAME### 207 ###SITEURL### " ), $new_admin_email );248 ###SITEURL### "; 208 249 250 /** 251 * Filter the email text that gets sent out when the site admin email is requested to be changed. 252 * 253 * The Following string have a special meaning and will get replaced dynamically. 254 * ###ADMIN_URL### The link to click on to confirm the email change. Required otherwise this functunalty is will break. 255 * ###EMAIL### The new email. 256 * ###SITENAME### The name of the site. 257 * ###SITEURL### The url to the site. 258 * 259 * @since 3.0.0 260 * 261 * @param string $email_text Text in the email. 262 * @param string $new_admin_email New admin email that the current administration email was changed to. 263 */ 264 $content = apply_filters( 'new_admin_email_content', __( $email_text), $new_admin_email ); 265 209 266 $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'options.php?adminhash='.$hash ) ), $content ); 210 267 $content = str_replace( '###EMAIL###', $value, $content ); 211 268 $content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content ); … … 243 300 'newemail' => $_POST['email'] 244 301 ); 245 302 update_option( $current_user->ID . '_new_email', $new_user_email ); 303 304 $email_text = "Dear user, 246 305 247 $content = apply_filters( 'new_user_email_content', __( "Dear user,248 249 306 You recently requested to have the email address on your account changed. 250 307 If this is correct, please click on the following link to change it: 251 308 ###ADMIN_URL### … … 257 314 258 315 Regards, 259 316 All at ###SITENAME### 260 ###SITEURL###" ), $new_user_email );317 ###SITEURL###"; 261 318 319 /** 320 * Filter the email text that gets sent out when a user changes emails. 321 * 322 * The Following string have a special meaning and will get replaced dynamically. 323 * ###ADMIN_URL### The link to click on to confirm the email change. Required otherwise this functunalty is will break. 324 * ###EMAIL### The new email. 325 * ###SITENAME### The name of the site. 326 * ###SITEURL### The url to the site. 327 * 328 * @since 3.0.0 329 * 330 * @param string $email_text Text in the email. 331 * @param string $new_user_email New user email that the current user has changed to. 332 */ 333 $content = apply_filters( 'new_user_email_content', __( $email_text ), $new_user_email ); 334 262 335 $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail='.$hash ) ), $content ); 263 336 $content = str_replace( '###EMAIL###', $_POST['email'], $content); 264 337 $content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content ); … … 377 450 clean_user_cache( $user ); 378 451 379 452 if ( $pref == 'spam' ) { 380 if ( $value == 1 ) 453 if ( $value == 1 ) { 454 /** 455 * Fires when the user is marked as a SPAM user. 456 * 457 * @since 3.0.0 458 * 459 * @param int $id User ID of the user marked as spam. 460 */ 381 461 do_action( 'make_spam_user', $id ); 382 else 462 } else { 463 /** 464 * Fires when the user is marked as a HAM user. Opposite of SPAM. 465 * 466 * @since 3.0.0 467 * 468 * @param int $id User ID of the user marked as ham. 469 */ 383 470 do_action( 'make_ham_user', $id ); 471 } 384 472 } 385 473 386 474 return $value; … … 411 499 '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 500 '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 501 've' => 'Venda', 'vi' => 'Vietnamese', 'vo' => 'Volapük', 'cy' => 'Welsh','wa' => 'Walloon','wo' => 'Wolof', 'xh' => 'Xhosa', 'yi' => 'Yiddish', 'yo' => 'Yoruba', 'za' => 'Zhuang; Chuang', 'zu' => 'Zulu' ); 502 503 /** 504 * Filter allows the ability to modify langage codes. 505 * 506 * This could be used if you want to changed the long form of a specific code. 507 * 508 * @since 3.0.0 509 * 510 * @param array $lang_codes. Key Value Pair of Language Codes where key is the short version. 511 * @param string $code is a 2 letter desigantion of the language. 512 */ 414 513 $lang_codes = apply_filters( 'lang_codes', $lang_codes, $code ); 415 514 return strtr( $code, $lang_codes ); 416 515 } … … 498 597 499 598 // Order by name 500 599 uksort( $output, 'strnatcasecmp' ); 501 600 /** 601 * Filter the langage dropdown of the available langages. 602 * 603 * @since 3.0.0 604 * 605 * @param array $output HTML output of the dropdown. 606 * @param array $lang_files of langage files that are available. 607 * @param string $current The current langage code. 608 */ 502 609 $output = apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current ); 503 610 echo implode( "\n\t", $output ); 504 611 } … … 575 682 <?php if ( in_array( get_site_option( 'registration' ), array( 'all', 'blog' ) ) ) : ?> 576 683 <tr> 577 684 <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> 685 <a href="<?php 686 /** 687 * Filter the url to the site creation location. 688 * 689 * The url that the user goes to create a new site on the network. 690 * 691 * Also found in wp-login.php and wp-includes/canonical.php. 692 * 693 * @since 3.0.0 694 * 695 * @param string Url to the site creation location. 696 */ 697 echo apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); ?>"><?php _e( 'Create a New Site' ); ?></a> 579 698 </th> 580 699 </tr> 581 700 <?php endif; ?> … … 595 714 // If global super_admins override is defined, there is nothing to do here. 596 715 if ( isset($super_admins) ) 597 716 return false; 598 717 718 /** 719 * Fires before the user is being made a super admin. 720 * 721 * @since 3.0.0 722 * 723 * @param int $user_id User ID of the user made super admin 724 */ 599 725 do_action( 'grant_super_admin', $user_id ); 600 726 601 727 // Directly fetch site_admins instead of using get_super_admins() … … 605 731 if ( $user && ! in_array( $user->user_login, $super_admins ) ) { 606 732 $super_admins[] = $user->user_login; 607 733 update_site_option( 'site_admins' , $super_admins ); 734 735 /** 736 * Fires after the user is made a super admin. 737 * 738 * @since 3.0.0 739 * 740 * @param int $user_id User ID of the user made super admin 741 */ 608 742 do_action( 'granted_super_admin', $user_id ); 609 743 return true; 610 744 } … … 623 757 // If global super_admins override is defined, there is nothing to do here. 624 758 if ( isset($super_admins) ) 625 759 return false; 626 760 /** 761 * Fires before the user is removed as a super admin. 762 * 763 * @since 3.0.0 764 * 765 * @param int $user_id User ID of the user removed as a super admin. 766 */ 627 767 do_action( 'revoke_super_admin', $user_id ); 628 768 629 769 // Directly fetch site_admins instead of using get_super_admins() … … 634 774 if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) { 635 775 unset( $super_admins[$key] ); 636 776 update_site_option( 'site_admins', $super_admins ); 777 778 /** 779 * Fires after the user is removed as a super admin. 780 * 781 * @since 3.0.0 782 * 783 * @param int $user_id User ID of the user removed as a super admin. 784 */ 637 785 do_action( 'revoked_super_admin', $user_id ); 638 786 return true; 639 787 } … … 656 804 $result = true; 657 805 else 658 806 $result = false; 659 807 /** 808 * Filter whether or not we can edit this network from this page. 809 * 810 * @since 3.1.0 811 * 812 * @param bool $result Can you edit this network from this page? 813 * @param int $site_id The network/site id to check. Different from blog id. 814 */ 660 815 return apply_filters( 'can_edit_network', $result, $site_id ); 661 816 } 662 817