Make WordPress Core


Ignore:
Timestamp:
05/26/2015 09:50:13 PM (10 years ago)
Author:
wonderboymusic
Message:

Fix doc blocks for ms-*.php files.
A few functions can return a conditional instead of an if/else of true/false.

See #32444.

File:
1 edited

Legend:

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

    r31348 r32611  
    1313 *
    1414 * @since MU
     15 *
     16 * @global wpdb $wpdb
    1517 */
    1618function wpmu_update_blogs_date() {
     
    6769 * @since MU
    6870 *
     71 * @global wpdb $wpdb
     72 *
    6973 * @param string $slug
    7074 * @return int A blog id
     
    98102 * @since MU
    99103 *
    100  * @param int|string|array $fields A blog ID, a blog slug, or an array of fields to query against. Optional. If not specified the current blog ID is used.
    101  * @param bool $get_all Whether to retrieve all details or only the details in the blogs table. Default is true.
     104 * @global wpdb $wpdb
     105 *
     106 * @param int|string|array $fields  Optional. A blog ID, a blog slug, or an array of fields to query against.
     107 *                                  If not specified the current blog ID is used.
     108 * @param bool             $get_all Whether to retrieve all details or only the details in the blogs table.
     109 *                                  Default is true.
    102110 * @return object|false Blog details on success. False on failure.
    103111 */
     
    273281 * @since MU
    274282 *
    275  * @param int $blog_id Blog ID
     283 * @global wpdb $wpdb
     284 *
     285 * @param int   $blog_id Blog ID
    276286 * @param array $details Array of details keyed by blogs table field names.
    277287 * @return bool True if update succeeds, false otherwise.
     
    445455 * @since MU
    446456 *
    447  * @param int $id A blog ID. Can be null to refer to the current blog.
    448  * @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
    449  * @param mixed $default Optional. Default value to return if the option does not exist.
     457 * @param int    $id      A blog ID. Can be null to refer to the current blog.
     458 * @param string $option  Name of option to retrieve. Expected to not be SQL-escaped.
     459 * @param mixed  $default Optional. Default value to return if the option does not exist.
    450460 * @return mixed Value set for the option.
    451461 */
     
    490500 * @since MU
    491501 *
    492  * @param int $id A blog ID. Can be null to refer to the current blog.
     502 * @param int    $id    A blog ID. Can be null to refer to the current blog.
    493503 * @param string $option Name of option to add. Expected to not be SQL-escaped.
    494  * @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped.
     504 * @param mixed  $value Optional. Option value, can be anything. Expected to not be SQL-escaped.
    495505 * @return bool False if option was not added and true if option was added.
    496506 */
     
    516526 * @since MU
    517527 *
    518  * @param int $id A blog ID. Can be null to refer to the current blog.
     528 * @param int    $id    A blog ID. Can be null to refer to the current blog.
    519529 * @param string $option Name of option to remove. Expected to not be SQL-escaped.
    520530 * @return bool True, if option is successfully deleted. False on failure.
     
    541551 * @since MU
    542552 *
    543  * @param int $id The blog id
     553 * @param int    $id    The blog id
    544554 * @param string $option The option key
    545  * @param mixed $value The option value
     555 * @param mixed  $value The option value
    546556 * @return bool True on success, false on failure.
    547557 */
     
    577587 * @since MU
    578588 *
    579  * @param int $new_blog The id of the blog you want to switch to. Default: current blog
     589 * @global wpdb            $wpdb
     590 * @global int             $blog_id
     591 * @global array           $_wp_switched_stack
     592 * @global bool            $switched
     593 * @global string          $table_prefix
     594 * @global WP_Object_Cache $wp_object_cache
     595 *
     596 * @param int  $new_blog   The id of the blog you want to switch to. Default: current blog
    580597 * @param bool $deprecated Deprecated argument
    581  * @return bool Always returns True.
     598 * @return true Always returns True.
    582599 */
    583600function switch_to_blog( $new_blog, $deprecated = null ) {
    584     global $wpdb, $wp_roles;
     601    global $wpdb;
    585602
    586603    if ( empty( $new_blog ) )
     
    636653
    637654    if ( did_action( 'init' ) ) {
    638         $wp_roles->reinit();
     655        wp_roles()->reinit();
    639656        $current_user = wp_get_current_user();
    640657        $current_user->for_blog( $new_blog );
     
    654671 * @since MU
    655672 *
     673 * @global wpdb            $wpdb
     674 * @global array           $_wp_switched_stack
     675 * @global int             $blog_id
     676 * @global bool            $switched
     677 * @global string          $table_prefix
     678 * @global WP_Object_Cache $wp_object_cache
     679 *
    656680 * @return bool True on success, false if we're already on the current blog
    657681 */
    658682function restore_current_blog() {
    659     global $wpdb, $wp_roles;
     683    global $wpdb;
    660684
    661685    if ( empty( $GLOBALS['_wp_switched_stack'] ) )
     
    700724
    701725    if ( did_action( 'init' ) ) {
    702         $wp_roles->reinit();
     726        wp_roles()->reinit();
    703727        $current_user = wp_get_current_user();
    704728        $current_user->for_blog( $blog );
     
    719743 * @since 3.5.0
    720744 *
     745 * @global array $_wp_switched_stack
     746 *
    721747 * @return bool True if switched, false otherwise.
    722748 */
     
    742768 * @since MU
    743769 *
    744  * @param int $id The blog id
     770 * @param int    $id      The blog id
    745771 * @param string $archived The new status
    746772 * @return string $archived
     
    756782 * @since MU
    757783 *
    758  * @param int $blog_id BLog ID
    759  * @param string $pref A field name
    760  * @param string $value Value for $pref
    761  * @return string $value
     784 * @global wpdb $wpdb
     785 *
     786 * @param int    $blog_id BLog ID
     787 * @param string $pref    A field name
     788 * @param string $value   Value for $pref
     789 * @param null   $deprecated
     790 * @return string|false $value
    762791 */
    763792function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
     
    829858 * @since MU
    830859 *
    831  * @param int $id The blog id
     860 * @global wpdb $wpdb
     861 *
     862 * @param int    $id   The blog id
    832863 * @param string $pref A field name
    833  * @return bool $value
     864 * @return bool|string|null $value
    834865 */
    835866function get_blog_status( $id, $pref ) {
     
    848879 * @since MU
    849880 *
     881 * @global wpdb $wpdb
     882 *
    850883 * @param mixed $deprecated Not used
    851  * @param int $start The offset
    852  * @param int $quantity The maximum number of blogs to retrieve. Default is 40.
     884 * @param int   $start      The offset
     885 * @param int   $quantity  The maximum number of blogs to retrieve. Default is 40.
    853886 * @return array The list of blogs
    854887 */
     
    869902 * @param string $new_status The new post status
    870903 * @param string $old_status The old post status
    871  * @param object $post Post object
     904 * @param object $post       Post object
    872905 */
    873906function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) {
Note: See TracChangeset for help on using the changeset viewer.