• Resolved stilografico

    (@stilografico)


    Since several time I use in my custom themes the function “wp_prepare_attachment_for_js” to print responsive images with values coming from wp native thumbnails and ACF images field.
    I just updated ACF to the newest release 5.5.4 and got this error.

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'acf_qtranslate_acf_5_file' does not have a method 'wp_prepare_attachment_for_js' in ../wp-includes/class-wp-hook.php on line 298

    I just commented line 47 in this file acf-qtranslate/src/acf_5/fields/file.php
    add_filter('wp_prepare_attachment_for_js', array($this, 'wp_prepare_attachment_for_js'), 10, 3);

    The error disappears but I guess now ACF Q-translate does not extends images translations any more.

    Are you planning to update the plugin shortly?
    Thank you

    Andrea

  • The topic ‘Error using ‘wp_prepare_attachment_for_js’ function’ is closed to new replies.