breadcrumbspress_visibility

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_visibility", $visible );
Arguments
Name
Type
Description
$visible
boolean
Initial visibility value; true by default.
Returns
Return false to prevent the normal current-trail visibility check from allowing display.

Controls the initial visibility decision for the current breadcrumb trail.

Returning true still allows the page-type visibility settings to hide the trail. Calls that force display bypass the visibility check. This is not a general visibility filter for every specific-post or term trail.

Example

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

add_filter( 'breadcrumbspress_visibility', function( $visible ) {
    if ( is_page( 'private-area' ) ) {
        return false;
    }
    return $visible;
}, 10, 1 );
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