• Resolved Biranit

    (@biranit)


    Hi,

    In the latest version of CPT UI, after upgrade, when I edit a post_tag — completely unrelated to CPT UI, while editing the tag NAME, it changes the name to some_thing_like_that.

    This is because you have the following function in cptui.js:

    // Switch spaces for underscores on our slug fields.
    	$('#name').on('keyup',function(e){
    		var value = $(this).val();
    		value = value.replace(/ /g, "_");
    		value = value.toLowerCase();
    		value = replaceDiacritics(value);
    		$(this).attr('value',value);
    	});

    But #name is the ID of many input fields across wp-admin. You cannot put a function like this without limiting it to CPT UI only.

    You MUST change $(‘#name’) to something more specific, like $(“.cptui-table #name”). Alternatively, you must enqueue this script ONLY on the CPTUI screen.

    This needs to be fixed urgently.

    Thank you,

    Bira

    https://www.ads-software.com/plugins/custom-post-type-ui/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Major bug in latest version – cptui.min.js alters ANY #name field’ is closed to new replies.