Notification when function is registered on e.g. $(document).ready()

is there a way to be notified when a function is registered via the jQuery $(document)ready() functionality and get a reference to that?

The background:
Im using a parent theme on a wordpress site, which uses ajax page transitions and document ready is only called on the first load. Now i want a reference to each function previously registered to call them again if my page changes.

Read More

The goal: is to restore the functionality of $(document).ready() as not only me, but many other plugins out there are using it and i obviously dont want to rewrite them all.
Yes, i could call MY registered function with no efford but this feels kind of lackluster while destroying the underlying functionality. By the way: it is the parent themes transitions, so overriding this wouldn’t be the best solution either.

What i want is to provide an addition, that intercepts every registration and calls the registered functions again manually after the transition. Is that a good idea?
(notice calling ready() manually doesn’t work if it was called already automatically on the initial page load)

Related posts

Leave a Reply

1 comment