install_popular_tags

Retrieve popular WordPress plugin tags.

Description

(array) install_popular_tags( (array) $args = array() ); 

Returns (array)

Parameters (1)

0. $args — Optional. (array) => array()
The args.

Usage

  1. if ( !function_exists( 'install_popular_tags' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/plugin-install.php'; 
  3.  
  4. // The args. 
  5. $args = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = install_popular_tags($args); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/plugin-install.php  
  1. function install_popular_tags( $args = array() ) { 
  2. $key = md5(serialize($args)); 
  3. if ( false !== ($tags = get_site_transient('poptags_' . $key) ) ) 
  4. return $tags; 
  5.  
  6. $tags = plugins_api('hot_tags', $args); 
  7.  
  8. if ( is_wp_error($tags) ) 
  9. return $tags; 
  10.  
  11. set_site_transient( 'poptags_' . $key, $tags, 3 * HOUR_IN_SECONDS ); 
  12.  
  13. return $tags;