Auto Image Field wordpress plugin and $wpdb->prepare issue

I have been using Auto Image Field plugin by Arturo on this blog site. Lately when i added a blog post, the wp-admin shouted an exception:

Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/auto-image-field/auto-image-field.php on line 102.

To fix this issue, remove all instances of “$wpdb->prepare” as below:

Change the below line from
$fields = $wpdb->get_results($wpdb->prepare(“SELECT * FROM $field_table_name WHERE 1”), ARRAY_A);
$fields = $wpdb->get_results(“SELECT * FROM $field_table_name WHERE 1”, ARRAY_A);

This shall fix the issue.

You can also download the updated auto-image-field.php file.

Add a Comment

Your email address will not be published. Required fields are marked *

To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image