Astra_Breadcrumb_Trail::__construct( array $args = array() )

Sets up the breadcrumb trail properties. Calls the Breadcrumb_Trail::add_items() method to create the array of breadcrumb items.


Description


Parameters

$args

(array) (Optional)

  • 'container'
    (string) Container HTML element. nav|div
  • 'before'
    (string) String to output before breadcrumb menu.
  • 'after'
    (string) String to output after breadcrumb menu.
  • 'browse_tag'
    (string) The HTML tag to use to wrap the "Browse" header text.
  • 'list_tag'
    (string) The HTML tag to use for the list wrapper.
  • 'item_tag'
    (string) The HTML tag to use for the item wrapper.
  • 'show_on_front'
    (bool) Whether to show when is_front_page().
  • 'network'
    (bool) Whether to link to the network main site (multisite only).
  • 'show_title'
    (bool) Whether to show the title (last item) in the trail.
  • 'show_browse'
    (bool) Whether to show the breadcrumb menu header.
  • 'labels'
    (array) Text labels. @see Breadcrumb_Trail::set_labels()
  • 'post_taxonomy'
    (array) Taxonomies to use for post types. @see Breadcrumb_Trail::set_post_taxonomy()
  • 'echo'
    (bool) Whether to print or return the breadcrumbs.

Default value: array()


Return

(void)


Source

File: inc/addons/breadcrumbs/class-astra-breadcrumb-trail.php

	public function __construct( $args = array() ) {

		$defaults = array(
			'container'       => 'nav',
			'before'          => '',
			'after'           => '',
			'browse_tag'      => 'h2',
			'list_tag'        => 'ul',
			'item_tag'        => 'li',
			'show_on_front'   => true,
			'network'         => false,
			'show_title'      => true,
			'show_browse'     => true,
			'labels'          => array(),
			'post_taxonomy'   => array(),
			'echo'            => true,
			'schema'          => true,
		);

		// Parse the arguments with the deaults.
		$this->args = apply_filters( 'astra_breadcrumb_trail_args', wp_parse_args( $args, $defaults ) );

		// Set the labels and post taxonomy properties.
		$this->set_labels();
		$this->set_post_taxonomy();

		// Let's find some items to add to the trail!
		$this->add_items();
	}

Changelog

Changelog
Version Description
0.6.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.