I would like to change the title shown on the sidebar (Recent Posts / Pages) based on certain attributes about the post (e.g. post_status) within a plugin.
Currently I've tried using a filter to the_title(), but I only got the title text, so I can't evaluate its corresponding post. How do I get the actual post inside this filter? Or what would be a better way around this?