I am looking for what params are passed to my filter function. Where can I find such info in the codex?

http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content didn’t provide much info

I wanted to know if the post is a child of another

2 Answers
2

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 Reply

Your email address will not be published. Required fields are marked *