I switched the language in WordPress test site to Macedonian but still no error.
Thread Starter
net
(@krstarica)
console.log(jQuery('#publish'));
Object { 0: <input#publish.button.button-primary.button-large>, length: 1, context: HTMLDocument → post.php, selector: "#publish" }
undefined
console.log(jQuery('#publish').data('events'));
undefined
undefined
Compare that with a new WordPress installation, no plugins installed:
jQuery('#publish')
[input#publish.button.button-primary.button-large, context: document, selector: "#publish"]
jQuery('#publish').data('events')
Object {click: Array(1)}
And with Require Post Category installed:
jQuery('#publish')
[input#publish.button.button-primary.button-large, context: document, selector: "#publish"]
jQuery('#publish').data('events')
Object {click: Array(2)}
I would still suggest going through your plugins and functions.php code to find out what is causing the issue because it could cause problems with other plugins.
Thread Starter
net
(@krstarica)
Found it in functions.php, thanks.
We were removing jquery-migrate.js:
https://isabelcastillo.com/remove-jquery-migrate-script-wordpress
Are you using some older jQuery functions?
Looks like I am accessing the events in a deprecated way — with SCRIPT_DEBUG on I can see this:
JQMIGRATE: Use of jQuery.fn.data('events') is deprecated
Seeing that we’ve come to the source of the issue I’m marking this as resolved.
Thank you for your help in troubleshooting. I will look for an alternative way to access the events and refactor the code for the next release.
Thread Starter
net
(@krstarica)
Great, many thanks for your help and awesome plugin.