Making WordPress.org


Ignore:
Timestamp:
04/20/2016 11:59:45 AM (9 years ago)
Author:
dd32
Message:

Plugin Directory: Use the new stat fields introduced with r2985.

See #1596

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php

    r2927 r2986  
    142142        $this->plugin_meta = \plugins_api( 'plugin_information', array(
    143143            'slug'   => $post->post_name,
    144             'fields' => array( 'active_installs' => true ),
    145144        ) );
    146145        ?>
     
    184183     */
    185184    public function column_installs( $post ) {
    186         if ( ! empty( $this->plugin_meta->active_installs ) ) {
    187             echo number_format_i18n( $this->plugin_meta->active_installs ) . '+';
     185        $active_installs = get_post_meta( $post->ID, 'active_installs', true );
     186        if ( $active_installs >= 1000000 ) {
     187            _e( '1+ million', 'wporg-plugins' );
     188        } elseif ( $active_installs <= 10 ) {
     189            _e( 'Less than 10', 'wporg-plugins' );
     190        } else {
     191            printf( "%s+", number_format_i18n( $active_installs ) );
    188192        }
    189193    }
     
    206210     */
    207211    public function column_support( $post ) {
    208         $resolutions = get_post_meta( $post->ID, 'support_resolutions', true );
    209         $unresolved  = empty( $resolutions ) ? 0 : $resolutions['no'];
    210         $link_text   = sprintf( __( '%d unresolved', 'wporg-plugins' ), $unresolved );
     212        $threads    = get_post_meta( $post->ID, 'support_threads', true );
     213        $resolved   = get_post_meta( $post->ID, 'support_threads_resolved', true );
     214        $unresolved = max( 0, $threads - $resolved );
     215        $link_text  = sprintf( __( '%d unresolved', 'wporg-plugins' ), $unresolved );
    211216
    212217        printf( '<a href="%s">%s</a>', esc_url( 'https://wordpress.org/support/plugin/' . $post->post_name ), $link_text );
Note: See TracChangeset for help on using the changeset viewer.