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
If another plugin registers a direct event callback handler for an element inside the post's content, and it gets registered before o2.Routers.App initializes, then those registrations will be wiped out by this line:
That may not be a bug exactly, but it creates unexpected conflicts with other plugins, and is very time-consuming to troubleshoot. There's probably a better way to achieve whatever that code is doing, without breaking other plugins.
Steps to reproduce
Add the code below to mu-plugins/foo.php:
Deactivate o2 plugin
Load a post on the front end of the site
Open the dev console
Click on the click me text at the bottom of the post, see the event logged in the console, to indicate that it's working
Activate the o2 plugin and repeat the above, you'll see that nothing happens.
Do any of the workarounds below and you'll see it start working again
If another plugin registers a direct event callback handler for an element inside the post's content, and it gets registered before
o2.Routers.App
initializes, then those registrations will be wiped out by this line:o2/js/app/main.js
Line 44 in 62cb626
That may not be a bug exactly, but it creates unexpected conflicts with other plugins, and is very time-consuming to troubleshoot. There's probably a better way to achieve whatever that code is doing, without breaking other plugins.
Steps to reproduce
mu-plugins/foo.php
:click me
text at the bottom of the post, see the event logged in the console, to indicate that it's workingWorkarounds
Here are some ways that plugins can work around this bug until it's fixed.
jQuery(document).on( 'ready.o2', function() {}
jQuery.on( event, selector, data, handler )
(the new version of the old jQuery.live() )wp_print_footer_scripts
instead ofwp_footer_scripts
wp_enqueue_script
, pass thetrue
var for the footer param (untested, but I'm guessing it'd work)The text was updated successfully, but these errors were encountered: