0

What I need is altering default Wordpress posts-pooling mechanism so I can get posts from other tables in database, not just default wp_posts and wp_postmeta.

How is that possible?

I'm ready to proudly die dealing with consequences of altering Wordpress core.

1 Answer 1

1

Don't hack the Core. There are filters in WP_Query that should more than suffice to include your table, if your SQL and regex are good enough.

  • posts_distinct - Alters SQL 'DISTINCTROW' clause to the query that returns the post array.
  • posts_groupby - Alters SQL 'GROUP BY' clause of the query that returns the post array.
  • posts_join - Alters SQL 'JOIN' clause of the query that returns the post array.
  • post_limits - Alters SQL 'LIMIT' clause of the query that returns the post array.
  • posts_orderby - Alters SQL 'ORDER BY' clause of the query that returns the post array.
  • posts_where - Alters SQL 'WHERE' clause of the query that returns the post array.
  • posts_join_paged - Alters SQL paging for posts using 'JOIN' clause of the query that returns the post array.
  • posts_where_paged - Alters SQL paging for posts using 'WHERE' clause of the query that returns the post array.
  • posts_clauses - Alters all the SQL clauses above in one go. It gives you an array of elements that are easy to alter

http://codex.wordpress.org/Class_Reference/WP_Query#Filters

Your question is not detailed enough for a more detailed answer.

2
  • Thanks. It will take some time to to check this and, and I'll accept your answer Commented May 28, 2013 at 13:20
  • I will accept your answer to rewart your efforts, but I must ask one more (much more detailed ) question regarding this issue. Commented Jun 15, 2013 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.