Make WordPress Core

Ticket #40736: 40736.3.patch

File 40736.3.patch, 1.6 KB (added by pmbaldha, 8 years ago)

Deprecated get_blog_count() function and developed get_site_count function. This is final.

  • 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 intval( get_network_option( $network_id, 'user_count' ) );
    106106}
    107107
    108108/**
     
    111111 * The count is cached and updated twice daily. This is not a live count.
    112112 *
    113113 * @since MU 1.0
     114 *
     115 * @deprecated 4.8 Use get_site_count()
     116 * @see get_site_count()
     117 *
    114118 * @since 3.7.0 The $network_id parameter has been deprecated.
    115119 * @since 4.8.0 The $network_id parameter is now being used.
    116120 *
     
    118122 * @return int Number of active sites on the network.
    119123 */
    120124function get_blog_count( $network_id = null ) {
    121         return get_network_option( $network_id, 'blog_count' );
     125        _deprecated_function( __FUNCTION__, '4.8', 'get_site_count()' );
     126        return get_site_count( $network_id  );
    122127}
    123128
    124129/**
     130 * The number of active sites on your installation.
     131 *
     132 * The count is cached and updated twice daily. This is not a live count.
     133 *
     134 * @since MU 4.8
     135 *
     136 * @param int|null $network_id ID of the network. Default is the current network.
     137 * @return int Number of active sites on the network.
     138 */
     139function get_site_count( $network_id = null ) {
     140        return intval( get_network_option( $network_id, 'blog_count' ) );
     141}
     142
     143/**
    125144 * Get a blog post from any site on the network.
    126145 *
    127146 * @since MU 1.0