We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I propose to return WP_Query instance in find_related function instead of post array.
It's more native to Wordpress code style and developer can use standart loop in template or pass WP_Query instance to custom templater class.
The text was updated successfully, but these errors were encountered:
Seems like an interesting idea but this would break backwards compat.
Sorry, something went wrong.
To no to brake backward compatibility you can add an optional parameter. For example:
public function find_related( $post_id, $return = 5, $instance = false ) { $args = array( 'more_like' => $post_id, 'posts_per_page' => $return, 'ep_integrate' => true, 'ignore_sticky_posts' => true, ); $query = new WP_Query( apply_filters( 'ep_find_related_args', $args ) ); if ( $instance ) return $query; if ( ! $query->have_posts() ) { return false; } return $query->posts; }
Looking into this.
Successfully merging a pull request may close this issue.
I propose to return WP_Query instance in find_related function instead of post array.
It's more native to Wordpress code style and developer can use standart loop in template or pass WP_Query instance to custom templater class.
The text was updated successfully, but these errors were encountered: