Make WordPress Core


Ignore:
Timestamp:
01/04/2011 09:02:38 AM (15 years ago)
Author:
nacin
Message:

Giant chunk of phpdoc for multisite functions. props boonebgorges, SergeyBiryukov. fixes #14953.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r16954 r17218  
    6161 * @uses get_blogs_of_user()
    6262 * @uses add_user_to_blog()
    63  * @uses update_user_meta()
    64  * @uses wp_cache_delete()
    65  * @uses get_user_meta()
    6663 * @uses get_blog_details()
    6764 *
     
    152149 *
    153150 * @since MU 2.7
    154  * @uses update_site_option()
    155151 *
    156152 * @return int
     
    166162 *
    167163 * @since MU 1.0
    168  * @uses update_site_option()
    169164 *
    170165 * @param int $id Optional. A site_id.
     
    204199 *
    205200 * @since MU 1.0
    206  * @uses switch_to_blog()
    207  * @uses update_user_meta()
    208  * @uses wp_cache_delete()
    209  * @uses restore_current_blog()
    210201 *
    211202 * @param int $blog_id ID of the blog you're adding the user to.
     
    246237 *
    247238 * @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()
    253239 *
    254240 * @param int $user_id ID of the user you're removing.
     
    308294 *
    309295 * @since MU 1.0
    310  * @uses switch_to_blog()
    311296 * @uses install_blog()
    312  * @uses restore_current_blog()
    313297 *
    314298 * @param string $domain The new blog's domain.
     
    316300 * @param string $string The new blog's title.
    317301 * @param int $site Optional. Defaults to 1.
    318  * @return int $blog_id The ID of the newly created blog
     302 * @return int The ID of the newly created blog
    319303 */
    320304function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {
     
    347331 *
    348332 * @since MU 1.0
    349  * @uses wp_cache_get()
    350  * @uses switch_to_blog()
    351  * @uses restore_current_blog()
    352  * @uses wp_cache_add()
    353333 *
    354334 * @param int $_blog_id ID of the source blog.
    355335 * @param int $post_id ID of the desired post.
    356  * @return string $link The post's permalink
     336 * @return string The post's permalink
    357337 */
    358338function get_blog_permalink( $_blog_id, $post_id ) {
     
    377357 *
    378358 * @since MU 2.6.5
    379  * @uses wp_cache_get()
    380  * @uses wp_cache_set()
    381359 *
    382360 * @param string $domain
    383361 * @param string $path Optional. Not required for subdomain installations.
    384  * @return int $id
     362 * @return int
    385363 */
    386364function get_blog_id_from_url( $domain, $path = '/' ) {
     
    408386}
    409387
    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 */
    412406function wpmu_admin_do_redirect( $url = '' ) {
    413407    $ref = '';
     
    438432}
    439433
     434/**
     435 * Adds an 'updated=true' argument to a URL.
     436 *
     437 * @since MU
     438 *
     439 * @param string $url
     440 * @return string
     441 */
    440442function wpmu_admin_redirect_add_updated_param( $url = '' ) {
    441443    if ( strpos( $url, 'updated=true' ) === false ) {
     
    448450}
    449451
     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 */
    450465function is_email_address_unsafe( $user_email ) {
    451466    $banned_names = get_site_option( 'banned_email_domains' );
     
    471486}
    472487
     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 */
    473512function wpmu_validate_user_signup($user_name, $user_email) {
    474513    global $wpdb;
     
    563602}
    564603
     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 */
    565626function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') {
    566627    global $wpdb, $domain, $base, $current_site;
     
    646707}
    647708
    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 */
    650722function wpmu_signup_blog($domain, $path, $title, $user, $user_email, $meta = '') {
    651723    global $wpdb;
     
    671743}
    672744
     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 */
    673758function wpmu_signup_user($user, $user_email, $meta = '') {
    674759    global $wpdb;
     
    694779}
    695780
    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 */
    697805function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_email, $key, $meta = '') {
    698806    global $current_site;
     
    735843}
    736844
     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 */
    737866function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') {
    738867    if ( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) )
     
    766895}
    767896
     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 */
    768917function wpmu_activate_signup($key) {
    769918    global $wpdb, $current_site;
     
    831980}
    832981
     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 */
    833998function wpmu_create_user( $user_name, $password, $email) {
    834999    $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
     
    8471012}
    8481013
     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 */
    8491040function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) {
    8501041    $domain = preg_replace( '/\s+/', '', sanitize_user( $domain, true ) );
     
    8941085}
    8951086
     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 */
    8961098function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
    8971099    if ( get_site_option( 'registrationnotification' ) != 'yes' )
     
    9201122}
    9211123
     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 */
    9221135function newuser_notify_siteadmin( $user_id ) {
    9231136    if ( get_site_option( 'registrationnotification' ) != 'yes' )
     
    9421155}
    9431156
     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 */
    9441170function domain_exists($domain, $path, $site_id = 1) {
    9451171    global $wpdb;
     
    9471173}
    9481174
     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 */
    9491188function insert_blog($domain, $path, $site_id) {
    9501189    global $wpdb;
     
    9611200}
    9621201
    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 */
    9641216function install_blog($blog_id, $blog_title = '') {
    9651217    global $wpdb, $table_prefix, $wp_roles;
     
    10001252}
    10011253
    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 */
    10041267function install_blog_defaults($blog_id, $user_id) {
    10051268    global $wpdb;
     
    10141277}
    10151278
     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 */
    10161296function wpmu_welcome_notification($blog_id, $user_id, $password, $title, $meta = '') {
    10171297    global $current_site;
     
    10641344}
    10651345
     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 */
    10661361function wpmu_welcome_user_notification($user_id, $password, $meta = '') {
    10671362    global $current_site;
     
    10971392}
    10981393
     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 */
    10991404function get_current_site() {
    11001405    global $current_site;
     
    11021407}
    11031408
     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 */
    11041418function get_user_id_from_string( $string ) {
    11051419    $user_id = 0;
     
    11191433}
    11201434
     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 */
    11211447function get_most_recent_post_of_user( $user_id ) {
    11221448    global $wpdb;
     
    11511477}
    11521478
    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 */
    11541493function get_dirsize( $directory ) {
    11551494    $dirsize = get_transient( 'dirsize_cache' );
     
    11661505}
    11671506
     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 */
    11681518function recurse_dirsize( $directory ) {
    11691519    $size = 0;
     
    11931543}
    11941544
     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 */
    11951557function upload_is_user_over_quota( $echo = true ) {
    11961558    if ( get_site_option( 'upload_space_check_disabled' ) )
     
    12131575}
    12141576
     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 */
    12151591function check_upload_mimes( $mimes ) {
    12161592    $site_exts = explode( ' ', get_site_option( 'upload_filetypes' ) );
     
    12241600}
    12251601
     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 */
    12261612function update_posts_count( $deprecated = '' ) {
    12271613    global $wpdb;
     
    12291615}
    12301616
     1617/**
     1618 * Logs user registrations.
     1619 *
     1620 * @since MU
     1621 *
     1622 * @param int $blog_id
     1623 * @param int $user_id
     1624 */
    12311625function wpmu_log_new_registrations( $blog_id, $user_id ) {
    12321626    global $wpdb;
     
    12351629}
    12361630
     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 */
    12371642function fix_import_form_size( $size ) {
    12381643    if ( upload_is_user_over_quota( false ) == true )
     
    13161721}
    13171722
     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 */
    13181731function redirect_this_site( $deprecated = '' ) {
    13191732    global $current_site;
     
    13211734}
    13221735
     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 */
    13231744function upload_is_file_too_big( $upload ) {
    13241745    if ( is_array( $upload ) == false || defined( 'WP_IMPORTING' ) )
     
    13311752}
    13321753
     1754/**
     1755 * Add a nonce field to the signup page.
     1756 *
     1757 * @since MU
     1758 * @uses wp_nonce_field()
     1759 */
    13331760function signup_nonce_fields() {
    13341761    $id = mt_rand();
     
    13371764}
    13381765
     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 */
    13391775function signup_nonce_check( $result ) {
    13401776    if ( !strpos( $_SERVER[ 'PHP_SELF' ], 'wp-signup.php' ) )
     
    13471783}
    13481784
     1785/**
     1786 * Correct 404 redirects when NOBLOGREDIRECT is defined.
     1787 *
     1788 * @since MU
     1789 */
    13491790function maybe_redirect_404() {
    13501791    global $current_site;
     
    13571798}
    13581799
     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 */
    13591810function maybe_add_existing_user_to_blog() {
    13601811    if ( false === strpos( $_SERVER[ 'REQUEST_URI' ], '/newbloguser/' ) )
     
    13771828}
    13781829
     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 */
    13791838function add_existing_user_to_blog( $details = false ) {
    13801839    global $blog_id;
     
    13871846}
    13881847
     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 */
    13891857function add_new_user_to_blog( $user_id, $email, $meta ) {
    13901858    global $current_site;
     
    13981866}
    13991867
     1868/**
     1869 * Correct From host on outgoing mail to match the site domain
     1870 *
     1871 * @since MU
     1872 */
    14001873function fix_phpmailer_messageid( $phpmailer ) {
    14011874    global $current_site;
     
    14031876}
    14041877
     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 */
    14051888function is_user_spammy( $username = 0 ) {
    14061889    if ( $username == 0 ) {
     
    14141897}
    14151898
     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 */
    14161911function update_blog_public( $old_value, $value ) {
    14171912    global $wpdb;
     
    14211916add_action('update_option_blog_public', 'update_blog_public', 10, 2);
    14221917
     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 */
    14231926function get_dashboard_blog() {
    14241927    if ( $blog = get_site_option( 'dashboard_blog' ) )
     
    14281931}
    14291932
     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 */
    14301944function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
    14311945    global $wpdb;
     
    14451959}
    14461960
     1961/**
     1962 * Check whether users can self-register, based on Network settings.
     1963 *
     1964 * @since MU
     1965 *
     1966 * @return bool
     1967 */
    14471968function users_can_register_signup_filter() {
    14481969    $registration = get_site_option('registration');
     
    14541975add_filter('option_users_can_register', 'users_can_register_signup_filter');
    14551976
     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 */
    14561985function welcome_user_msg_filter( $text ) {
    14571986    if ( !$text ) {
Note: See TracChangeset for help on using the changeset viewer.