Need a hook or global post declaration for other filters
-
We use a filter which modifies aspects of the author information on posts. When this (Publish to Apple News) plugin calls the
get_the_author_meta
function, since it is not in the context of a post, there is no way to get post information, so filters that use post information will not work.The normal method of using
global $post;
to get at the post doesn’t work.In the file
admin/apple-actions/index/class-export.php
there is the function:public function fetch_exporter() { do_action( 'apple_news_do_fetch_exporter', $this->id ); .... $author = ucfirst( get_the_author_meta( 'display_name', $post->post_author ) );
If a hook could be added before each post was processed, which included the post info, we could get filters to work.
Or, you could add a
global $post;
line at the beginning of that function, but I suspect the hook would be the right way to go.
- The topic ‘Need a hook or global post declaration for other filters’ is closed to new replies.