Changeset 17218 for trunk/wp-includes/ms-functions.php
- Timestamp:
- 01/04/2011 09:02:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/ms-functions.php
r16954 r17218 61 61 * @uses get_blogs_of_user() 62 62 * @uses add_user_to_blog() 63 * @uses update_user_meta()64 * @uses wp_cache_delete()65 * @uses get_user_meta()66 63 * @uses get_blog_details() 67 64 * … … 152 149 * 153 150 * @since MU 2.7 154 * @uses update_site_option()155 151 * 156 152 * @return int … … 166 162 * 167 163 * @since MU 1.0 168 * @uses update_site_option()169 164 * 170 165 * @param int $id Optional. A site_id. … … 204 199 * 205 200 * @since MU 1.0 206 * @uses switch_to_blog()207 * @uses update_user_meta()208 * @uses wp_cache_delete()209 * @uses restore_current_blog()210 201 * 211 202 * @param int $blog_id ID of the blog you're adding the user to. … … 246 237 * 247 238 * @since MU 1.0 248 * @uses switch_to_blog()249 * @uses get_user_meta()250 * @uses get_blogs_of_user()251 * @uses update_user_meta()252 * @uses restore_current_blog()253 239 * 254 240 * @param int $user_id ID of the user you're removing. … … 308 294 * 309 295 * @since MU 1.0 310 * @uses switch_to_blog()311 296 * @uses install_blog() 312 * @uses restore_current_blog()313 297 * 314 298 * @param string $domain The new blog's domain. … … 316 300 * @param string $string The new blog's title. 317 301 * @param int $site Optional. Defaults to 1. 318 * @return int $blog_idThe ID of the newly created blog302 * @return int The ID of the newly created blog 319 303 */ 320 304 function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) { … … 347 331 * 348 332 * @since MU 1.0 349 * @uses wp_cache_get()350 * @uses switch_to_blog()351 * @uses restore_current_blog()352 * @uses wp_cache_add()353 333 * 354 334 * @param int $_blog_id ID of the source blog. 355 335 * @param int $post_id ID of the desired post. 356 * @return string $linkThe post's permalink336 * @return string The post's permalink 357 337 */ 358 338 function get_blog_permalink( $_blog_id, $post_id ) { … … 377 357 * 378 358 * @since MU 2.6.5 379 * @uses wp_cache_get()380 * @uses wp_cache_set()381 359 * 382 360 * @param string $domain 383 361 * @param string $path Optional. Not required for subdomain installations. 384 * @return int $id362 * @return int 385 363 */ 386 364 function get_blog_id_from_url( $domain, $path = '/' ) { … … 408 386 } 409 387 410 // wpmu admin functions 411 388 // Admin functions 389 390 /** 391 * Redirect a user based on $_GET or $_POST arguments. 392 * 393 * The function looks for redirect arguments in the following order: 394 * 1) $_GET['ref'] 395 * 2) $_POST['ref'] 396 * 3) $_SERVER['HTTP_REFERER'] 397 * 4) $_GET['redirect'] 398 * 5) $_POST['redirect'] 399 * 6) $url 400 * 401 * @since MU 402 * @uses wpmu_admin_redirect_add_updated_param() 403 * 404 * @param string $url 405 */ 412 406 function wpmu_admin_do_redirect( $url = '' ) { 413 407 $ref = ''; … … 438 432 } 439 433 434 /** 435 * Adds an 'updated=true' argument to a URL. 436 * 437 * @since MU 438 * 439 * @param string $url 440 * @return string 441 */ 440 442 function wpmu_admin_redirect_add_updated_param( $url = '' ) { 441 443 if ( strpos( $url, 'updated=true' ) === false ) { … … 448 450 } 449 451 452 /** 453 * Checks an email address against a list of banned domains. 454 * 455 * This function checks against the Banned Email Domains list 456 * at wp-admin/network/settings.php. The check is only run on 457 * self-registrations; user creation at wp-admin/network/users.php 458 * bypasses this check. 459 * 460 * @since MU 461 * 462 * @param string $user_email The email provided by the user at registration. 463 * @return bool Returns true when the email address is banned. 464 */ 450 465 function is_email_address_unsafe( $user_email ) { 451 466 $banned_names = get_site_option( 'banned_email_domains' ); … … 471 486 } 472 487 488 /** 489 * Processes new user registrations. 490 * 491 * Checks the data provided by the user during signup. Verifies 492 * the validity and uniqueness of user names and user email addresses, 493 * and checks email addresses against admin-provided domain 494 * whitelists and blacklists. 495 * 496 * The hook 'wpmu_validate_user_signup' provides an easy way 497 * to modify the signup process. The value $result, which is passed 498 * to the hook, contains both the user-provided info and the error 499 * messages created by the function. 'wpmu_validate_user_signup' allows 500 * you to process the data in any way you'd like, and unset the 501 * relevant errors if necessary. 502 * 503 * @since MU 504 * @uses is_email_address_unsafe() 505 * @uses username_exists() 506 * @uses email_exists() 507 * 508 * @param string $user_name The login name provided by the user. 509 * @param string $user_email The email provided by the user. 510 * @return array Contains username, email, and error messages. 511 */ 473 512 function wpmu_validate_user_signup($user_name, $user_email) { 474 513 global $wpdb; … … 563 602 } 564 603 604 /** 605 * Processes new site registrations. 606 * 607 * Checks the data provided by the user during blog signup. Verifies 608 * the validity and uniqueness of blog paths and domains. 609 * 610 * This function prevents the current user from registering a new site 611 * with a blogname equivalent to another user's login name. Passing the 612 * $user parameter to the function, where $user is the other user, is 613 * effectively an override of this limitation. 614 * 615 * Filter 'wpmu_validate_blog_signup' if you want to modify 616 * the way that WordPress validates new site signups. 617 * 618 * @since MU 619 * @uses domain_exists() 620 * @uses username_exists() 621 * 622 * @param string $blogname The blog name provided by the user. Must be unique. 623 * @param string $blog_title The blog title provided by the user. 624 * @return array Contains the new site data and error messages. 625 */ 565 626 function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') { 566 627 global $wpdb, $domain, $base, $current_site; … … 646 707 } 647 708 648 // Record signup information for future activation. wpmu_validate_signup() should be run 649 // on the inputs before calling wpmu_signup(). 709 /** 710 * Record site signup information for future activation. 711 * 712 * @since MU 713 * @uses wpmu_signup_blog_notification() 714 * 715 * @param string $domain The requested domain. 716 * @param string $path The requested path. 717 * @param string $title The requested site title. 718 * @param string $user The user's requested login name. 719 * @param string $user_email The user's email address. 720 * @param array $meta By default, contains the requested privacy setting and lang_id. 721 */ 650 722 function wpmu_signup_blog($domain, $path, $title, $user, $user_email, $meta = '') { 651 723 global $wpdb; … … 671 743 } 672 744 745 /** 746 * Record user signup information for future activation. 747 * 748 * This function is used when user registration is open but 749 * new site registration is not. 750 * 751 * @since MU 752 * @uses wpmu_signup_user_notification() 753 * 754 * @param string $user The user's requested login name. 755 * @param string $user_email The user's email address. 756 * @param array $meta By default, this is an empty array. 757 */ 673 758 function wpmu_signup_user($user, $user_email, $meta = '') { 674 759 global $wpdb; … … 694 779 } 695 780 696 // Notify user of signup success. 781 /** 782 * Notify user of signup success. 783 * 784 * This is the notification function used when site registration 785 * is enabled. 786 * 787 * Filter 'wpmu_signup_blog_notification' to bypass this function or 788 * replace it with your own notification behavior. 789 * 790 * Filter 'wpmu_signup_blog_notification_email' and 791 * 'wpmu_signup_blog_notification_email' to change the content 792 * and subject line of the email sent to newly registered users. 793 * 794 * @since MU 795 * 796 * @param string $domain The new blog domain. 797 * @param string $path The new blog path. 798 * @param string $title The site title. 799 * @param string $user The user's login name. 800 * @param string $user_email The user's email address. 801 * @param array $meta By default, contains the requested privacy setting and lang_id. 802 * @param string $key The activation key created in wpmu_signup_blog() 803 * @return bool 804 */ 697 805 function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_email, $key, $meta = '') { 698 806 global $current_site; … … 735 843 } 736 844 845 /** 846 * Notify user of signup success. 847 * 848 * This is the notification function used when no new site has 849 * been requested. 850 * 851 * Filter 'wpmu_signup_user_notification' to bypass this function or 852 * replace it with your own notification behavior. 853 * 854 * Filter 'wpmu_signup_user_notification_email' and 855 * 'wpmu_signup_user_notification_subject' to change the content 856 * and subject line of the email sent to newly registered users. 857 * 858 * @since MU 859 * 860 * @param string $user The user's login name. 861 * @param string $user_email The user's email address. 862 * @param array $meta By default, an empty array. 863 * @param string $key The activation key created in wpmu_signup_user() 864 * @return bool 865 */ 737 866 function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') { 738 867 if ( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) ) … … 766 895 } 767 896 897 /** 898 * Activate a signup. 899 * 900 * Hook to 'wpmu_activate_user' or 'wpmu_activate_blog' for events 901 * that should happen only when users or sites are self-created (since 902 * those actions are not called when users and sites are created 903 * by a Super Admin). 904 * 905 * @since MU 906 * @uses wp_generate_password() 907 * @uses wpmu_welcome_user_notification() 908 * @uses add_user_to_blog() 909 * @uses add_new_user_to_blog() 910 * @uses wpmu_create_user() 911 * @uses wpmu_create_blog() 912 * @uses wpmu_welcome_notification() 913 * 914 * @param string $key The activation key provided to the user. 915 * @return array An array containing information about the activated user and/or blog 916 */ 768 917 function wpmu_activate_signup($key) { 769 918 global $wpdb, $current_site; … … 831 980 } 832 981 982 /** 983 * Create a user. 984 * 985 * This function runs when a user self-registers as well as when 986 * a Super Admin creates a new user. Hook to 'wpmu_new_user' for events 987 * that should affect all new users, but only on Multisite (otherwise 988 * use 'user_register'). 989 * 990 * @since MU 991 * @uses wp_create_user() 992 * 993 * @param string $user_name The new user's login name. 994 * @param string $password The new user's password. 995 * @param string $email The new user's email address. 996 * @return mixed Returns false on failure, or int $user_id on success 997 */ 833 998 function wpmu_create_user( $user_name, $password, $email) { 834 999 $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) ); … … 847 1012 } 848 1013 1014 /** 1015 * Create a site. 1016 * 1017 * This function runs when a user self-registers a new site as well 1018 * as when a Super Admin creates a new site. Hook to 'wpmu_new_blog' 1019 * for events that should affect all new sites. 1020 * 1021 * On subdirectory installs, $domain is the same as the main site's 1022 * domain, and the path is the subdirectory name (eg 'example.com' 1023 * and '/blog1/'). On subdomain installs, $domain is the new subdomain + 1024 * root domain (eg 'blog1.example.com'), and $path is '/'. 1025 * 1026 * @since MU 1027 * @uses domain_exists() 1028 * @uses insert_blog() 1029 * @uses wp_install_defaults() 1030 * @uses add_user_to_blog() 1031 * 1032 * @param string $domain The new site's domain. 1033 * @param string $path The new site's path. 1034 * @param string $title The new site's title. 1035 * @param int $user_id The user ID of the new site's admin. 1036 * @param array $meta Optional. Used to set initial site options. 1037 * @param int $site_id Optional. Only relevant on multi-network installs. 1038 * @return mixed Returns WP_Error object on failure, int $blog_id on success 1039 */ 849 1040 function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) { 850 1041 $domain = preg_replace( '/\s+/', '', sanitize_user( $domain, true ) ); … … 894 1085 } 895 1086 1087 /** 1088 * Notifies the network admin that a new site has been activated. 1089 * 1090 * Filter 'newblog_notify_siteadmin' to change the content of 1091 * the notification email. 1092 * 1093 * @since MU 1094 * 1095 * @param int $blog_id The new site's ID. 1096 * @return bool 1097 */ 896 1098 function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) { 897 1099 if ( get_site_option( 'registrationnotification' ) != 'yes' ) … … 920 1122 } 921 1123 1124 /** 1125 * Notifies the network admin that a new user has been activated. 1126 * 1127 * Filter 'newuser_notify_siteadmin' to change the content of 1128 * the notification email. 1129 * 1130 * @since MU 1131 * 1132 * @param int $user_id The new user's ID. 1133 * @return bool 1134 */ 922 1135 function newuser_notify_siteadmin( $user_id ) { 923 1136 if ( get_site_option( 'registrationnotification' ) != 'yes' ) … … 942 1155 } 943 1156 1157 /** 1158 * Check whether a blogname is already taken. 1159 * 1160 * Used during the new site registration process to ensure 1161 * that each blogname is unique. 1162 * 1163 * @since MU 1164 * 1165 * @param string $domain The domain to be checked. 1166 * @param string $path The path to be checked. 1167 * @param int $site_id Optional. Relevant only on multi-network installs. 1168 * @return int 1169 */ 944 1170 function domain_exists($domain, $path, $site_id = 1) { 945 1171 global $wpdb; … … 947 1173 } 948 1174 1175 /** 1176 * Store basic site info in the blogs table. 1177 * 1178 * This function creates a row in the wp_blogs table and returns 1179 * the new blog's ID. It is the first step in creating a new blog. 1180 * 1181 * @since MU 1182 * 1183 * @param string $domain The domain of the new site. 1184 * @param string $path The path of the new site. 1185 * @param int $site_id Unless you're running a multi-network install, be sure to set this value to 1. 1186 * @return int The ID of the new row 1187 */ 949 1188 function insert_blog($domain, $path, $site_id) { 950 1189 global $wpdb; … … 961 1200 } 962 1201 963 // Install an empty blog. wpdb should already be switched. 1202 /** 1203 * Install an empty blog. 1204 * 1205 * Creates the new blog tables and options. If calling this function 1206 * directly, be sure to use switch_to_blog() first, so that $wpdb 1207 * points to the new blog. 1208 * 1209 * @since MU 1210 * @uses make_db_current_silent() 1211 * @uses populate_roles() 1212 * 1213 * @param int $blog_id The value returned by insert_blog(). 1214 * @param string $blog_title The title of the new site. 1215 */ 964 1216 function install_blog($blog_id, $blog_title = '') { 965 1217 global $wpdb, $table_prefix, $wp_roles; … … 1000 1252 } 1001 1253 1002 // Deprecated, use wp_install_defaults() 1003 // should be switched already as $blog_id is ignored. 1254 /** 1255 * Set blog defaults. 1256 * 1257 * This function creates a row in the wp_blogs table. 1258 * 1259 * @since MU 1260 * @deprecated MU 1261 * @deprecated Use wp_install_defaults() 1262 * @uses wp_install_defaults() 1263 * 1264 * @param int $blog_id Ignored in this function. 1265 * @param int $user_id 1266 */ 1004 1267 function install_blog_defaults($blog_id, $user_id) { 1005 1268 global $wpdb; … … 1014 1277 } 1015 1278 1279 /** 1280 * Notify a user that her blog activation has been successful. 1281 * 1282 * Filter 'wpmu_welcome_notification' to disable or bypass. 1283 * 1284 * Filter 'update_welcome_email' and 'update_welcome_subject' to 1285 * modify the content and subject line of the notification email. 1286 * 1287 * @since MU 1288 * 1289 * @param int $blog_id 1290 * @param int $user_id 1291 * @param string $password 1292 * @param string $title The new blog's title 1293 * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization. 1294 * @return bool 1295 */ 1016 1296 function wpmu_welcome_notification($blog_id, $user_id, $password, $title, $meta = '') { 1017 1297 global $current_site; … … 1064 1344 } 1065 1345 1346 /** 1347 * Notify a user that her account activation has been successful. 1348 * 1349 * Filter 'wpmu_welcome_user_notification' to disable or bypass. 1350 * 1351 * Filter 'update_welcome_user_email' and 'update_welcome_user_subject' to 1352 * modify the content and subject line of the notification email. 1353 * 1354 * @since MU 1355 * 1356 * @param int $user_id 1357 * @param string $password 1358 * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization. 1359 * @return bool 1360 */ 1066 1361 function wpmu_welcome_user_notification($user_id, $password, $meta = '') { 1067 1362 global $current_site; … … 1097 1392 } 1098 1393 1394 /** 1395 * Get the current site info. 1396 * 1397 * Returns an object containing the ID, domain, path, and site_name 1398 * of the site being viewed. 1399 * 1400 * @since MU 1401 * 1402 * @return object 1403 */ 1099 1404 function get_current_site() { 1100 1405 global $current_site; … … 1102 1407 } 1103 1408 1409 /** 1410 * Get a numeric user ID from either an email address or a login. 1411 * 1412 * @since MU 1413 * @uses is_email() 1414 * 1415 * @param string $string 1416 * @return int 1417 */ 1104 1418 function get_user_id_from_string( $string ) { 1105 1419 $user_id = 0; … … 1119 1433 } 1120 1434 1435 /** 1436 * Get a user's most recent post. 1437 * 1438 * Walks through each of a user's blogs to find the post with 1439 * the most recent post_date_gmt. 1440 * 1441 * @since MU 1442 * @uses get_blogs_of_user() 1443 * 1444 * @param int $user_id 1445 * @return array Contains the blog_id, post_id, post_date_gmt, and post_gmt_ts 1446 */ 1121 1447 function get_most_recent_post_of_user( $user_id ) { 1122 1448 global $wpdb; … … 1151 1477 } 1152 1478 1153 /* Misc functions */ 1479 // Misc functions 1480 1481 /** 1482 * Get the size of a directory. 1483 * 1484 * A helper function that is used primarily to check whether 1485 * a blog has exceeded its allowed upload space. 1486 * 1487 * @since MU 1488 * @uses recurse_dirsize() 1489 * 1490 * @param string $directory 1491 * @return int 1492 */ 1154 1493 function get_dirsize( $directory ) { 1155 1494 $dirsize = get_transient( 'dirsize_cache' ); … … 1166 1505 } 1167 1506 1507 /** 1508 * Get the size of a directory recursively. 1509 * 1510 * Used by get_dirsize() to get a directory's size when it contains 1511 * other directories. 1512 * 1513 * @since MU 1514 * 1515 * @param string $directory 1516 * @return int 1517 */ 1168 1518 function recurse_dirsize( $directory ) { 1169 1519 $size = 0; … … 1193 1543 } 1194 1544 1545 /** 1546 * Check whether a blog has used its allotted upload space. 1547 * 1548 * Used by get_dirsize() to get a directory's size when it contains 1549 * other directories. 1550 * 1551 * @since MU 1552 * @uses get_dirsize() 1553 * 1554 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true. 1555 * @return int 1556 */ 1195 1557 function upload_is_user_over_quota( $echo = true ) { 1196 1558 if ( get_site_option( 'upload_space_check_disabled' ) ) … … 1213 1575 } 1214 1576 1577 /** 1578 * Check an array of MIME types against a whitelist. 1579 * 1580 * WordPress ships with a set of allowed upload filetypes, 1581 * which is defined in wp-includes/functions.php in 1582 * get_allowed_mime_types(). This function is used to filter 1583 * that list against the filetype whitelist provided by Multisite 1584 * Super Admins at wp-admin/network/settings.php. 1585 * 1586 * @since MU 1587 * 1588 * @param array $mimes 1589 * @return array 1590 */ 1215 1591 function check_upload_mimes( $mimes ) { 1216 1592 $site_exts = explode( ' ', get_site_option( 'upload_filetypes' ) ); … … 1224 1600 } 1225 1601 1602 /** 1603 * Update a blog's post count. 1604 * 1605 * WordPress MS stores a blog's post count as an option so as 1606 * to avoid extraneous COUNTs when a blog's details are fetched 1607 * with get_blog_details(). This function is called when posts 1608 * are published to make sure the count stays current. 1609 * 1610 * @since MU 1611 */ 1226 1612 function update_posts_count( $deprecated = '' ) { 1227 1613 global $wpdb; … … 1229 1615 } 1230 1616 1617 /** 1618 * Logs user registrations. 1619 * 1620 * @since MU 1621 * 1622 * @param int $blog_id 1623 * @param int $user_id 1624 */ 1231 1625 function wpmu_log_new_registrations( $blog_id, $user_id ) { 1232 1626 global $wpdb; … … 1235 1629 } 1236 1630 1631 /** 1632 * Get the remaining upload space for this blog. 1633 * 1634 * @since MU 1635 * @uses upload_is_user_over_quota() 1636 * @uses get_space_allowed() 1637 * @uses get_dirsize() 1638 * 1639 * @param int $size 1640 * @return int 1641 */ 1237 1642 function fix_import_form_size( $size ) { 1238 1643 if ( upload_is_user_over_quota( false ) == true ) … … 1316 1721 } 1317 1722 1723 /** 1724 * Ensure that the current site's domain is listed in the allowed redirect host list. 1725 * 1726 * @see wp_validate_redirect() 1727 * @since MU 1728 * 1729 * @return array The current site's domain 1730 */ 1318 1731 function redirect_this_site( $deprecated = '' ) { 1319 1732 global $current_site; … … 1321 1734 } 1322 1735 1736 /** 1737 * Check whether an upload is too big. 1738 * 1739 * @since MU 1740 * 1741 * @param array $upload 1742 * @return mixed If the upload is under the size limit, $upload is returned. Otherwise returns an error message. 1743 */ 1323 1744 function upload_is_file_too_big( $upload ) { 1324 1745 if ( is_array( $upload ) == false || defined( 'WP_IMPORTING' ) ) … … 1331 1752 } 1332 1753 1754 /** 1755 * Add a nonce field to the signup page. 1756 * 1757 * @since MU 1758 * @uses wp_nonce_field() 1759 */ 1333 1760 function signup_nonce_fields() { 1334 1761 $id = mt_rand(); … … 1337 1764 } 1338 1765 1766 /** 1767 * Process the signup nonce created in signup_nonce_fields(). 1768 * 1769 * @since MU 1770 * @uses wp_create_nonce() 1771 * 1772 * @param array $result 1773 * @return array 1774 */ 1339 1775 function signup_nonce_check( $result ) { 1340 1776 if ( !strpos( $_SERVER[ 'PHP_SELF' ], 'wp-signup.php' ) ) … … 1347 1783 } 1348 1784 1785 /** 1786 * Correct 404 redirects when NOBLOGREDIRECT is defined. 1787 * 1788 * @since MU 1789 */ 1349 1790 function maybe_redirect_404() { 1350 1791 global $current_site; … … 1357 1798 } 1358 1799 1800 /** 1801 * Add a new user to a blog by visiting /newbloguser/username/. 1802 * 1803 * This will only work when the user's details are saved as an option 1804 * keyed as 'new_user_x', where 'x' is the username of the user to be 1805 * added, as when a user is invited through the regular WP Add User interface. 1806 * 1807 * @since MU 1808 * @uses add_existing_user_to_blog() 1809 */ 1359 1810 function maybe_add_existing_user_to_blog() { 1360 1811 if ( false === strpos( $_SERVER[ 'REQUEST_URI' ], '/newbloguser/' ) ) … … 1377 1828 } 1378 1829 1830 /** 1831 * Add a user to a blog based on details from maybe_add_existing_user_to_blog(). 1832 * 1833 * @since MU 1834 * @uses add_user_to_blog() 1835 * 1836 * @param array $details 1837 */ 1379 1838 function add_existing_user_to_blog( $details = false ) { 1380 1839 global $blog_id; … … 1387 1846 } 1388 1847 1848 /** 1849 * Add a newly created user to the appropriate blog 1850 * 1851 * @since MU 1852 * 1853 * @param int $user_id 1854 * @param string $email 1855 * @param array $meta 1856 */ 1389 1857 function add_new_user_to_blog( $user_id, $email, $meta ) { 1390 1858 global $current_site; … … 1398 1866 } 1399 1867 1868 /** 1869 * Correct From host on outgoing mail to match the site domain 1870 * 1871 * @since MU 1872 */ 1400 1873 function fix_phpmailer_messageid( $phpmailer ) { 1401 1874 global $current_site; … … 1403 1876 } 1404 1877 1878 /** 1879 * Check to see whether a user is marked as a spammer, based on username 1880 * 1881 * @since MU 1882 * @uses get_current_user_id() 1883 * @uses get_user_id_from_string() 1884 * 1885 * @param string $username 1886 * @return bool 1887 */ 1405 1888 function is_user_spammy( $username = 0 ) { 1406 1889 if ( $username == 0 ) { … … 1414 1897 } 1415 1898 1899 /** 1900 * Update this blog's 'public' setting in the global blogs table. 1901 * 1902 * Public blogs have a setting of 1, private blogs are 0. 1903 * 1904 * @since MU 1905 * @uses update_blog_status() 1906 * 1907 * @param int $old_value 1908 * @param int $value The new public value 1909 * @return bool 1910 */ 1416 1911 function update_blog_public( $old_value, $value ) { 1417 1912 global $wpdb; … … 1421 1916 add_action('update_option_blog_public', 'update_blog_public', 10, 2); 1422 1917 1918 /** 1919 * Get the "dashboard blog", the blog where users without a blog edit their profile data. 1920 * 1921 * @since MU 1922 * @uses get_blog_details() 1923 * 1924 * @return int 1925 */ 1423 1926 function get_dashboard_blog() { 1424 1927 if ( $blog = get_site_option( 'dashboard_blog' ) ) … … 1428 1931 } 1429 1932 1933 /** 1934 * Check whether a usermeta key has to do with the current blog. 1935 * 1936 * @since MU 1937 * @uses wp_get_current_user() 1938 * 1939 * @param string $key 1940 * @param int $user_id Optional. Defaults to current user. 1941 * @param int $blog_id Optional. Defaults to current blog. 1942 * @return bool 1943 */ 1430 1944 function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) { 1431 1945 global $wpdb; … … 1445 1959 } 1446 1960 1961 /** 1962 * Check whether users can self-register, based on Network settings. 1963 * 1964 * @since MU 1965 * 1966 * @return bool 1967 */ 1447 1968 function users_can_register_signup_filter() { 1448 1969 $registration = get_site_option('registration'); … … 1454 1975 add_filter('option_users_can_register', 'users_can_register_signup_filter'); 1455 1976 1977 /** 1978 * Ensure that the welcome message is not empty. Currently unused. 1979 * 1980 * @since MU 1981 * 1982 * @param string $text 1983 * @return string 1984 */ 1456 1985 function welcome_user_msg_filter( $text ) { 1457 1986 if ( !$text ) {
Note: See TracChangeset
for help on using the changeset viewer.