• Resolved net

    (@krstarica)


    jQuery(function($){ should be changed to (function($) {

    });</script> should be changed to })(jQuery);</script>

Viewing 6 replies - 16 through 21 (of 21 total)
  • Plugin Author Josh Hartman

    (@joshhartman)

    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
    Plugin Author Josh Hartman

    (@joshhartman)

    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?

    Plugin Author Josh Hartman

    (@joshhartman)

    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.

Viewing 6 replies - 16 through 21 (of 21 total)

The topic ‘Doesn’t work’ is closed to new replies.