I’m trying to create a custom wordpress title for a posts made under a custom post. Basically, its a version changelog for an application. I would like to only input the version number in the title field, and the output has to be standardized with a string accordingly.
My custom post type is ‘custom_version’ and the title output that I’m looking for is “Application has been updated to version “.
I’ve understood that this can be achieved using add_filter and I’ve tried playing with this code for days now, but I’m not really a PHP Pro so help is much appreciated 🙂 Here’s the code:
add_filter('the_title', 'new_title');
function new_title($title) {
global $post, $post_ID;
$title['custom_version'] = 'Application has been updated to v'.$title;
return $title;
}