Ok, based upon some more testing, it now seems to work (the example code above).
Not sure why it did not earlier (I suspect some caching in the way).
Marking this resolved.
For reference, here is the content filter illustrating what we are trying to do
function default_for_empty_content($content) {
if( is_singular() && is_main_query() ) {
if (empty($content) ) {
$custom = "";
$custom .= "some custom content here";
$custom .= "[ratemypost]"; // This does not work
return $custom;
}
}
return $content;
}
add_filter('the_content', 'default_for_empty_content');
Thanks, looks like our do_shortcode usage is non standard. We’ll see if we cant adjust that.