Making WordPress.org


Ignore:
Timestamp:
04/26/2016 07:33:28 AM (9 years ago)
Author:
dd32
Message:

Plugin Directory: Add a Review Widget to the theme, and all the other required things for Widgets.
This adds a namespace to the theme and begins to reduce the duplication of template functionality between wp-admin and the theme.

See #1584.
Fixes #1575.

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

    r2998 r3009  
    22namespace WordPressdotorg\Plugin_Directory\Admin\List_Table;
    33use \WordPressdotorg\Plugin_Directory\Tools;
     4use \WordPressdotorg\Plugin_Directory\Template;
    45
    56_get_list_table( 'WP_Posts_List_Table' );
     
    159160     */
    160161    public function column_rating( $post ) {
    161         if ( function_exists( 'wporg_get_dashicons_stars' ) ) {
    162             echo wporg_get_dashicons_stars( get_post_meta( $post->ID, 'rating', true ) );
    163         }
     162        echo Template::dashicons_stars( get_post_meta( $post->ID, 'rating', true ) );
    164163    }
    165164
     
    170169     */
    171170    public function column_installs( $post ) {
    172         $active_installs = get_post_meta( $post->ID, 'active_installs', true );
    173         if ( $active_installs >= 1000000 ) {
    174             _e( '1+ million', 'wporg-plugins' );
    175         } elseif ( $active_installs <= 10 ) {
    176             _e( 'Less than 10', 'wporg-plugins' );
    177         } else {
    178             printf( "%s+", number_format_i18n( $active_installs ) );
    179         }
     171        echo Template::active_installs( false, $post );
    180172    }
    181173
Note: See TracChangeset for help on using the changeset viewer.