method_get_available_archives_options()

 
 
 
 

method_get_available_archives_options( $prepend = array(), $exclude = false )

Gets archive options for all public post types that have archives.


Description

Builds an associative array of archive option values (formatted as archive_{post_type}) for use in breadcrumb configuration selects. Always includes 'archive_post' for the Posts archive unless excluded.


Parameters

$prepend (array) :
Associative array of options to place before the archive options.

$exclude (string|false) :
Post type name to exclude. Default false.


Return

(array) Associative array of 'archive_{name}' => 'Archive: {Label}'.


Source

File: lib/helper-functions.php


Usage

PHP
$options = method_get_available_archives_options(
    array( '' => 'Item is Top Level' ),
    'post' // exclude Posts
);