$post->post_title in filter function
-
I am having problems accessing $post->post_title in a filter function inside my plugin. The function gets called from wp-icludes/link-template.php get_ajacent_post()
... $where = apply_filters( "get_{$adjacent}_post_where", $where, $in_same_cat, $excluded_categories ); ...
this is relevant plugin code
function filter_next_post_where($where) { return "WHERE p.post_title > '".$post->post_title."' AND p.post_type = 'post' AND p.post_status = 'publish' AND tt.taxonomy = 'category'"; } add_filter('get_next_post_where', 'filter_next_post_where');
The filter function is supposed to replace default where clause in post query but for some reason $post->post_title resolves to empty.
function returns
WHERE p.post_title < '' AND p.post_type = 'post' AND p.post_status = 'publish' AND tt.taxonomy = 'category'
The function is called from within the loop.. what am I missing?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘$post->post_title in filter function’ is closed to new replies.