You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On upgrading to Wordpress v5.5 it also upgrades JQuery, which no longer supports the 'live' command so scripts need updating to use the 'on' command instead. The TEXT tab on the editing screen to view a page in HTML doesn't work due to JQuery errors in the My Meta Box files. The following lines should be replaced:
metabox.js
466 echo '<script>
jQuery(document).ready(function() {
var '.$counter.' = '.$c.';
/* jQuery("#add-'.$field['id'].'").live('click', function() { /
jQuery(document).on("click", "#add-'.$field['id'].'", function() {
'.$counter.' = '.$counter.' + 1;
jQuery(this).before(''.$js_code.'');
update_repeater_fields();
});
/ jQuery("#remove-'.$field['id'].'").live('click', function() { */
jQuery(document).on("click", "#remove-'.$field['id'].'", function() {
var $confirm = confirm("Delete? Are you sure?");
if (jQuery(this).parent().hasClass("re-control") && $confirm != false)
jQuery(this).parent().parent().remove();
else if ($confirm != false)
jQuery(this).parent().remove();
});
});
</script>';
I have also added extra code in the last bit to provide a confirmation dialogue if you click on the red X button to delete a repeat field by accident.
The text was updated successfully, but these errors were encountered:
The asterixes have got removed in these 2 lines in the above
/* jQuery("#add-'.$field['id'].'").live('click', function() { /
/ jQuery("#remove-'.$field['id'].'").live('click', function() { */
and don't copy the 466 - that's roughly the line number of the starting line to help find it. Or just do a search of the text for .live
The same has happened again. Just delete those 2 lines - they were only the originals you are looking for to be replaced.
Also make sure you completely wipe your browser cache and refresh otherwise you won't see it work.
On upgrading to Wordpress v5.5 it also upgrades JQuery, which no longer supports the 'live' command so scripts need updating to use the 'on' command instead. The TEXT tab on the editing screen to view a page in HTML doesn't work due to JQuery errors in the My Meta Box files. The following lines should be replaced:
metabox.js
45 // $(".at-re-toggle").live('click', function() {
$(document).on("click", ".at-re-toggle", function() {
194 //$('.simplePanelimageUploadclear,.simplePanelfileUploadclear').live('click', function( event ){
$(document).on("click", ".simplePanelimageUploadclear,.simplePanelfileUploadclear", function( event ) {
my-meta-box-class.php
466 echo '<script>
jQuery(document).ready(function() {
var '.$counter.' = '.$c.';
/* jQuery("#add-'.$field['id'].'").live('click', function() { /
jQuery(document).on("click", "#add-'.$field['id'].'", function() {
'.$counter.' = '.$counter.' + 1;
jQuery(this).before(''.$js_code.'');
update_repeater_fields();
});
/ jQuery("#remove-'.$field['id'].'").live('click', function() { */
jQuery(document).on("click", "#remove-'.$field['id'].'", function() {
var $confirm = confirm("Delete? Are you sure?");
if (jQuery(this).parent().hasClass("re-control") && $confirm != false)
jQuery(this).parent().parent().remove();
else if ($confirm != false)
jQuery(this).parent().remove();
});
});
</script>';
I have also added extra code in the last bit to provide a confirmation dialogue if you click on the red X button to delete a repeat field by accident.
The text was updated successfully, but these errors were encountered: