Menu
Nadzweb.com
Nadzweb.com

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

Posted on November 27, 2013November 27, 2013 by admin

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);
to:
$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.

  • php
  • wordpress
  • Leave a Reply Cancel reply

    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

    Tags

    .htaccess angular angular2 angular2-pipes angular4 angularjs apache bigdata blockchain children codeigniter computer graphics ethereum flot flot charts funny hadoop http javascript jquery kanban lena linux love math mathematics microsoft misc node js php phpframework php frameworks postgres pun-intended python react sass scrum scss silverstripe software ssl story valentines day wordpress

    Archives

    Recent Posts

    • Install only Postgres client 11 on Ubuntu 18.04
    • PostgreSQL – Granting access to users
    • Querying JSONB Postgres fields in SQLAlchemy
    • Angular – Writing unit tests for setTimeout in functions
    • Angular 6 – getting previous url from angular router
    ©2021 Nadzweb.com | Powered by WordPress & Superb Themes