Plugin Author
Chouby
(@chouby)
Thanks, I would like to look a this. Could you point me to this new _doing_it_wrong
?
If you call get_posts(['post_type' => ['post','page']])
, you should get a _doing_it_wrong
originating from line 160 of frontend-auto-translate.php
. This should probably be refactored to always convert post_type
to an array with an in (...)
query.
Per the documentation, post_type
can be a string or an array of post types:
https://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters
XDebug gives me this (partial) backtrace:
26 1.9941 35546616 PLL_Frontend_Auto_Translate->pre_get_posts( ) .../class-wp-hook.php:298
27 1.9942 35546712 wpdb->prepare( ) .../frontend-auto-translate.php:160
28 1.9942 35547432 _doing_it_wrong( ) .../wp-db.php:1310
29 1.9942 35548136 trigger_error ( ) .../functions.php:4139
-
This reply was modified 6 years, 6 months ago by jcracknell.
Plugin Author
Chouby
(@chouby)
I see. The _doing_it_wrong
is added by WP 4.8.2 but the bug is not related to WP 4.8.2. I will fix that. Thanks for pointing this 🙂
Plugin Author
Chouby
(@chouby)