Feature request: “aps_prefix_the_title” hook which returns boolean value
-
It would be nice to have a dedicated hook to determine whether or not to prefix archived titles with “Archived:”.
The filter could look something like this:
apply_filters( 'aps_prefix_the_title', true, $post_id )
For now, this is what I use:
add_filter( 'the_title', function( $title, $post_id ) { return get_post_type( $post_id ) == 'project' ? ltrim( preg_replace( '/^Archived:/', '', $title )) : $title; }, 13, 2 );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Feature request: “aps_prefix_the_title” hook which returns boolean value’ is closed to new replies.