WordPress.org

Make WordPress Core

Ticket #40736: 40736.4.patch

File 40736.4.patch, 2.0 KB (added by pmbaldha, 4 years ago)

int typecating for get_user_count(). Deprecated get_blog_count() function.Developed get_site_count() function.

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

     
    516516
    517517        return $results;
    518518}
     519
     520/**
     521 * The number of active sites on your installation.
     522 *
     523 * The count is cached and updated twice daily. This is not a live count.
     524 *
     525 * @since MU 1.0
     526 *
     527 * @deprecated 4.9.0 Use get_site_count()
     528 * @see get_site_count()
     529 *
     530 * @since 3.7.0 The $network_id parameter has been deprecated.
     531 * @since 4.8.0 The $network_id parameter is now being used.
     532 *
     533 * @param int|null $network_id ID of the network. Default is the current network.
     534 * @return int Number of active sites on the network.
     535 */
     536function get_blog_count( $network_id = null ) {
     537        _deprecated_function( __FUNCTION__, '4.8', 'get_site_count()' );
     538        return get_site_count( $network_id  );
     539}
  • src/wp-includes/ms-functions.php

     
    102102 * @return int Number of active users on the network.
    103103 */
    104104function get_user_count( $network_id = null ) {
    105         return get_network_option( $network_id, 'user_count' );
     105        return (int) get_network_option( $network_id, 'user_count' );
    106106}
    107107
    108108/**
     
    110110 *
    111111 * The count is cached and updated twice daily. This is not a live count.
    112112 *
    113  * @since MU 1.0
    114  * @since 3.7.0 The $network_id parameter has been deprecated.
    115  * @since 4.8.0 The $network_id parameter is now being used.
     113 * @since 4.9.0
    116114 *
    117115 * @param int|null $network_id ID of the network. Default is the current network.
    118116 * @return int Number of active sites on the network.
    119117 */
    120 function get_blog_count( $network_id = null ) {
    121         return get_network_option( $network_id, 'blog_count' );
     118function get_site_count( $network_id = null ) {
     119        return (int) get_network_option( $network_id, 'blog_count' );
    122120}
    123121
    124122/**