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/themes/pub/wporg-plugins/template-tags.php

    r2986 r3009  
    11<?php
     2namespace WordPressdotorg\Plugin_Directory\Theme;
     3use WordPressdotorg\Plugin_Directory\Template;
    24
    35// Various Template tags
     
    3032
    3133function wporg_plugins_download_link() {
    32     $filename = sprintf( "%s.%s.zip", get_post()->post_name, wporg_plugins_the_version() );
    33     return esc_url( "https://downloads.wordpress.org/plugin/{$filename}" );
    34 }
    35 
    36 function worg_plugins_template_active_installs( $full = true ) {
    37     $count = WordPressdotorg\Plugin_Directory\Template::get_active_installs_count();
    38 
    39     if ( $count <= 10 ) {
    40         $text = __( 'Less than 10', 'wporg-plugins' );
    41     } elseif ( $count >= 1000000 ) {
    42         $text = __( '1+ million', 'wporg-plugins' );
    43     } else {
    44         $text = number_format_i18n( $count ) . '+';
    45     }
    46     return $full ? sprintf( __( '%s active installs', 'wporg-plugins' ), $text ) : $text;
     34    return esc_url( sprintf( "https://downloads.wordpress.org/plugin/%s.%s.zip", get_post()->post_name, wporg_plugins_the_version() ) );
    4735}
    4836
Note: See TracChangeset for help on using the changeset viewer.