Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text tab in Wordpress 5.5 editor stops working #150

Open
chopper-lee opened this issue Aug 14, 2020 · 3 comments
Open

Text tab in Wordpress 5.5 editor stops working #150

chopper-lee opened this issue Aug 14, 2020 · 3 comments

Comments

@chopper-lee
Copy link

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.

@chopper-lee
Copy link
Author

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

@chopper-lee
Copy link
Author

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.

@BobbyRuby
Copy link

@chopper-lee Thanks a shit ton my brother. I was all worried for a second and boom... you had my answer. Just upgraded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants