15th Dec2012

WordPress 3.5 – PHP Warning: Missing argument 2 for wpdb::prepare()

by Gyro

I just updated a work in progress to WordPress 3.5, and ended up with broken permalinks (to fix that: reset to default permalinks, then set the custom permalinks again), and my favorite plugin "Network Shared Posts" gave a super-long error message on each page, something along the lines of
PHP Warning: Missing argument 2 for wpdb::prepare()…blablabla…

So, after doing some research I found out that the root of all evil are the WordPress developers! Or to be more precise, they decided to make their functions more strict, resulting in a lot of plugins now showing the error "PHP Warning: Missing argument 2 for wpdb::prepare()", after someone updates to WordPress 3.5 and before the author has the chance to update, or in some cases totally rewrite their plugin. Read this article for more on this.

Here is my work-around to literally hide all "PHP Warning: Missing argument 2 for wpdb::prepare()" error messages:

(more…)

1345