Closed d4mation closed 6 years ago
This relates to #49
I thought I had requested review on this one. My bad!
And you're 100% certain that enqueing it this late in the WP load cycle is OK?
I am fairly certain. It is the exact same thing we're doing with the Textarea Field for WYSIWYGs.
I tested it for each field and it all works as expected.
This one is a little tricky, only because it is removing a Filter. But that shouldn't matter since running code on non-existent Actions and Filters doesn't harm anything.
With RBM FH v1.4.0 (First release of the new submodule method), a Filter called
rbm_fieldhelpers_load_datetimepicker
was introduced to Enable loading these scripts automatically whether a necessary Field was being used or not.Now these Fields instead enqueue the necessary scripts only when actually needed, similar to the WYSIWYG option for Textarea Fields. They'll only enqueue once, so there's no danger in doing it this way.