Title: Feature request: &#8220;aps_prefix_the_title&#8221; hook which returns boolean value
Last modified: June 5, 2017

---

# Feature request: “aps_prefix_the_title” hook which returns boolean value

 *  Resolved [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/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 );
       ```
   
    -  This topic was modified 8 years, 10 months ago by [Gemini Labs](https://wordpress.org/support/users/geminilabs/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Frankie Jarrett](https://wordpress.org/support/users/fjarrett/)
 * (@fjarrett)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/feature-request-aps_prefix_the_title-hook-which-returns-boolean-value/#post-9202485)
 * Hi [@geminilabs](https://wordpress.org/support/users/geminilabs/),
 * You might consider taking the opposite approach here.
 * Rather than using a later hook priority to undo what the APS filter has done 
   to the title, use an earlier hook priority to remove the APS filter entirely.
 * Quick example (untested):
 *     ```
       add_filter( 'the_title', function ( $title, $post_id ) {
           if ( 'project' === get_post_type( $post_id ) ) {
               remove_filter( 'the_title', 'aps_the_title', 10 );
           }
           return $title;
       }, 9, 2 );
       ```
   
    -  This reply was modified 8 years, 10 months ago by [Frankie Jarrett](https://wordpress.org/support/users/fjarrett/).

Viewing 1 replies (of 1 total)

The topic ‘Feature request: “aps_prefix_the_title” hook which returns boolean value’
is closed to new replies.

 * ![](https://ps.w.org/archived-post-status/assets/icon-256x256.png?rev=3103140)
 * [Archive Content with Archived Post Status](https://wordpress.org/plugins/archived-post-status/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/archived-post-status/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/archived-post-status/)
 * [Active Topics](https://wordpress.org/support/plugin/archived-post-status/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/archived-post-status/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/archived-post-status/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Frankie Jarrett](https://wordpress.org/support/users/fjarrett/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/feature-request-aps_prefix_the_title-hook-which-returns-boolean-value/#post-9202485)
 * Status: resolved