breadcrumbspress_builder_for_date_month_archive

Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

Definition
apply_filters( "breadcrumbspress_builder_for_date_month_archive", $breadcrumbs, $year, $month, $use_template );
Arguments
Name
Type
Description
$breadcrumbs
array
Breadcrumb trail as an array of Crumb objects.
$year
integer
Archive year.
$month
integer
Archive month.
$use_template
boolean
Whether the configured title and display templates are used.
Returns
Return the breadcrumb array, containing Crumb objects in the intended order.

Filters the breadcrumb trail built for a month archive.

This hook is used when building the current-request trail. It is not a universal filter for trails generated directly for a specific post or term. The current generator caches a nonempty result for the request. Month and day builders call the year builder, and the day builder also calls the month builder, so earlier date filters can run while a deeper date trail is built.

Example

This example registers a callback for the filter. Adapt the values and conditions to your site.

add_filter( 'breadcrumbspress_builder_for_date_month_archive', function( $breadcrumbs, $year, $month, $use_template ) {
    if ( isset( $breadcrumbs['home'] ) ) {
        $breadcrumbs['home']->title = 'Start';
    }
    return $breadcrumbs;
}, 10, 4 );
Rate this reference
0
0
4

You are not allowed to rate this post.

Leave a Comment

0
0
0
0
0
0
0
0
0