breadcrumbspress_builder_user_title
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_user_title", $name, $user_id );
Arguments
Name
Type
Description
$name
string
User display name or the Unknown fallback.
$user_id
integer
User ID.
Returns
Return the author title.
Filters the display name used when building an author breadcrumb.
Example
This example registers a callback for the filter. Adapt the values and conditions to your site.
add_filter( 'breadcrumbspress_builder_user_title', function( $name, $user_id ) {
if ( $user_id === 1 ) {
return 'Site author';
}
return $name;
}, 10, 2 );