What params are available with the_content filter?

I don’t think there are any additional parameters passed, per se, to the_content, but global variables like $post are accessible.

So something like this would work:

add_filter( 'the_content', 'check_for_post_parent' );

function check_for_post_parent($content) {
     global $post;
     if ($parent_id == $post->post_parent) {
          //do what you want to $content here, 
          //now that you know $parent_id
          //...
          }
     return $content;
     }

Leave a Comment