You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.
Add a placeholder subtitle when editing the post. This way, I still reach the filter. In my filter, check if it is the placeholder and then not display the title. Not very elegant, but the one that I'm using right now to avoid the second strategy.
Filter the_title and single_post_title on my own and try to replicate almost everything that the the_subtitle method does somehow or duplicate and plug the class Subtitles itself. Not elegant at all.
@actual-saurabh Love the idea. Go ahead and whip up a PR for it, and I'll make sure to get it in the next release ASAP. Your use case makes total sense there. Thanks for bringing it to my attention!
Hi @philiparthurmoore,
For a project, I needed to add subtitles and prefixes to titles. Rather than reinventing the wheel, I use this plugin and it's great.
I used the
the_subtitle
filter in https://github.com/professionalthemes/Subtitles/blob/master/public/class-subtitles.php#L713 to add prefixes to my custom post type titles. It helps me that Subtitles has already taken the decisions that my code needs to take before displaying prefixes.Only problem is some of my posts have a prefix, but not a subtitle. Because of https://github.com/professionalthemes/Subtitles/blob/master/public/class-subtitles.php#L586-L588, I never reach the filter.
Right now, I have two strategies:
the_title
andsingle_post_title
on my own and try to replicate almost everything that the the_subtitle method does somehow or duplicate and plug the classSubtitles
itself. Not elegant at all.Would you be open to adding a boolean filter that allows the code to continue at https://github.com/professionalthemes/Subtitles/blob/master/public/class-subtitles.php#L586-L588? It could be set to false when subtitles are empty, but an extension like mine could force set it to true.
If you are, I can send in a PR.
The text was updated successfully, but these errors were encountered: