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
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
You must be logged in to post a comment.
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:
In
wp-includes/post-template.php
youâll find the place, where the filters are applied:The only parameter is the content text.
But you can always use the global variable $post to get more information about the currently used post. Try the following snippet in your themeâs functions.php:
On a child page you get some nice data:
'post_parent' => 2167
is the ID of the parent post. On pages without a parent the parameter is set to0
.