Make WordPress Core

Ticket #40736: 40736.7.patch

File 40736.7.patch, 2.0 KB (added by desrosj, 7 years ago)

Refreshed patch to apply cleanly

  • src/wp-includes/ms-deprecated.php

     
    546546
    547547        return isset( $current_user->$local_key );
    548548}
     549
     550/**
     551 * The number of active sites on your installation.
     552 *
     553 * The count is cached and updated twice daily. This is not a live count.
     554 *
     555 * @since MU 1.0
     556 *
     557 * @deprecated 5.0.0 Use get_site_count()
     558 * @see get_site_count()
     559 *
     560 * @since 3.7.0 The $network_id parameter has been deprecated.
     561 * @since 4.9.0 The $network_id parameter is now being used.
     562 *
     563 * @param int|null $network_id ID of the network. Default is the current network.
     564 * @return int Number of active sites on the network.
     565 */
     566function get_blog_count( $network_id = null ) {
     567        _deprecated_function( __FUNCTION__, '5.0', 'get_site_count()' );
     568        return get_site_count( $network_id  );
     569}
  • src/wp-includes/ms-functions.php

     
    107107 * @return int Number of active users on the network.
    108108 */
    109109function get_user_count( $network_id = null ) {
    110         return get_network_option( $network_id, 'user_count' );
     110        return (int) get_network_option( $network_id, 'user_count' );
    111111}
    112112
    113113/**
     
    115115 *
    116116 * The count is cached and updated twice daily. This is not a live count.
    117117 *
    118  * @since MU (3.0.0)
    119  * @since 3.7.0 The $network_id parameter has been deprecated.
    120  * @since 4.8.0 The $network_id parameter is now being used.
     118 * @since 5.0.0
    121119 *
    122120 * @param int|null $network_id ID of the network. Default is the current network.
    123121 * @return int Number of active sites on the network.
    124122 */
    125 function get_blog_count( $network_id = null ) {
    126         return get_network_option( $network_id, 'blog_count' );
     123function get_site_count( $network_id = null ) {
     124        return (int) get_network_option( $network_id, 'blog_count' );
    127125}
    128126
    129127/**