Changeset 4125 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-popular-tags.php
- Timestamp:
- 09/24/2016 05:06:50 AM (8 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-popular-tags.php
r4124 r4125 9 9 * @package WordPressdotorg_Plugin_Directory 10 10 */ 11 class Popular_ Categories extends Base {11 class Popular_Tags extends Base { 12 12 13 13 function __construct() { 14 register_rest_route( 'plugins/v1', '/popular- categories/?', array(14 register_rest_route( 'plugins/v1', '/popular-tags/?', array( 15 15 'methods' => WP_REST_Server::READABLE, 16 'callback' => array( $this, 'popular_ categories' ),16 'callback' => array( $this, 'popular_tags' ), 17 17 ) ); 18 18 } … … 24 24 * @return array A formatted array of all plugin categories on the site. 25 25 */ 26 function popular_ categories( $request ) {27 $terms = get_terms( 'plugin_ category', array( 'hide_empty' => false, 'orderby' => 'count', 'order' => 'DESC' ) );26 function popular_tags( $request ) { 27 $terms = get_terms( 'plugin_tags', array( 'hide_empty' => false, 'orderby' => 'count', 'order' => 'DESC' ) ); 28 28 29 29 $response = array();
Note: See TracChangeset
for help on using the changeset viewer.