Making WordPress.org

Changeset 3183


Ignore:
Timestamp:
05/19/2016 09:48:48 PM (9 years ago)
Author:
obenland
Message:

Plugin Directory: Only show support stats if there are any.

See #1719.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-support.php

    r3040 r3183  
    2424    public function widget( $args, $instance ) {
    2525        $post        = get_post();
    26         $resolutions = true;
     26        $threads     = get_post_meta( $post->ID, 'support_threads', true ) ?: 0;
     27        $resolved    = get_post_meta( $post->ID, 'support_threads_resolved', true ) ?: 0;
     28        $resolutions = (bool) $threads;
    2729        $support_url = 'https://wordpress.org/support/plugin/' . $post->post_name;
    2830
     
    4850            <?php
    4951            /* translators: 1: Number of resolved threads; 2: Number of all threads; */
    50             printf( __( '%1$s of %2$s support threads in the last two months have been marked resolved.', 'wporg-plugins' ),
    51                 get_post_meta( $post->ID, 'support_threads', true ),
    52                 get_post_meta( $post->ID, 'support_threads_resolved', true )
    53             );
     52            printf( __( '%1$s of %2$s support threads in the last two months have been marked resolved.', 'wporg-plugins' ), $threads, $resolved );
    5453            ?>
    5554        </p>
Note: See TracChangeset for help on using the changeset viewer.