get_archives

Retrieves a list of archives.

Description

(string|null) get_archives( (string) $type = '', (string) $limit = '', (string) $format = 'html', (string) $before = '', (string) $after = '', (constant) $show_post_count = false ); 

Returns (string|null)

Parameters (6)

0. $type — Optional. (string) => ''
The type.
1. $limit — Optional. (string) => ''
The limit.
2. $format — Optional. (string) => 'html'
The format.
3. $before — Optional. (string) => ''
The before.
4. $after — Optional. (string) => ''
The after.
5. $show_post_count — Optional. (constant) => false
The show post count.

Usage

  1. if ( !function_exists( 'get_archives' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The type. 
  5. $type = ''; 
  6.  
  7. // The limit. 
  8. $limit = ''; 
  9.  
  10. // The format. 
  11. $format = 'html'; 
  12.  
  13. // The before. 
  14. $before = ''; 
  15.  
  16. // The after. 
  17. $after = ''; 
  18.  
  19. // The show post count. 
  20. $show_post_count = false; 
  21.  
  22. // NOTICE! Understand what this does before running. 
  23. $result = get_archives($type, $limit, $format, $before, $after, $show_post_count); 
  24.  

Defined (1)

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

/wp-includes/deprecated.php  
  1. function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { 
  2. _deprecated_function( __FUNCTION__, '2.1.0', 'wp_get_archives()' ); 
  3. $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); 
  4. return wp_get_archives($args);