• Hi,
    Your plugin causes the following error:

    Notice: Die Funktion WP_Scripts::localize wurde fehlerhaft aufgerufen. Der Parameter $l10n muss ein Array sein. Um beliebige Daten an Skripte zu übergeben, verwende stattdessen die Funktion wp_add_inline_script(). Weitere Informationen: Debugging in WordPress (engl.). (Diese Meldung wurde in Version 5.7.0 hinzugefügt.) in /wp-includes/functions.php on line 6031

    What can we do?

    Kind regards,
    Jan

Viewing 1 replies (of 1 total)
  • nicolasbinet

    (@nicolasbinet)

    First, your can replace lines 6 & 7 in init/wmi-functions.php by these 2 lines

    wp_localize_script( 'wmi-admin-script', 'editimg', array('url' => WMI_MENU_IMG_URL . 'assets/images/edit-icon.svg' ));
    wp_localize_script( 'wmi-admin-script', 'deleteimg', array('url' => WMI_MENU_IMG_URL . 'assets/images/delete-icon.svg' ));

    And in line 20 in assets/js/wmi-admin-script.js

    jQuery('#upload-image-'+ menu_id).before('<div class="menu-img-block menu-block-'+menu_id+'"><ul class="menu-actions"><li><a href="javascript:void(0);" class="edit-btn" id="upload-image-'+menu_id+' data-id="'+menu_id+'"><img src="'+editimg.url+'" alt="edit"></a></li> <li><a href="javascript:void(0);" class="close-btn"><img src="'+deleteimg.url+'" alt="delete"></li></ul> <img class="menu-image upload-image-'+menu_id+'" src="'+attachment.url+'" width="120" height="120"></div>');

    At the end, there is still a Js error, but it works any way.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.