churchthemes / church-theme-content

The Church Content WordPress plugin provides compatible themes with church-related post types, taxonomies and custom fields.
https://churchthemes.com/plugins/church-content/
GNU General Public License v2.0
58 stars 27 forks source link

Events - Time picker jQuery UI CSS - Conflict with Advanced Custom Fields Pro #20

Closed nathanp closed 3 years ago

nathanp commented 7 years ago

When the Advanced Custom Fields plugin is activated, the time picker for events does not display correctly. Apparently, the ACF plugin also has styles for the jQuery UI time picker and is overriding the styles from the ct-meta-box/css/jquery.timepicker.css file. Advanced Custom Fields is a very common plugin for not only developers, but many themes utilize it. I'm assuming the best solution would be to add some type of "ctc" class to the timepicker to make it's styling more unique and less prone to interference from other potentially active plugins.

nathanp commented 7 years ago

If I modify the includes\libraries\ct-meta-box\ct-meta-box.php file, lines 993 and 996 to enqueue the timepicker files later by using 9999 for the load order, then it works. E.g. wp_enqueue_style( 'jquery-timepicker', trailingslashit( CTMB_URL ) . 'css/jquery.timepicker.css', false, $this->version, 9999 ); // bust cache on update

wp_enqueue_script( 'jquery-timepicker', trailingslashit( CTMB_URL ) . 'js/jquery.timepicker.min.js', false, $this->version, 9999 ); // bust cache on update

nathanp commented 7 years ago

Turns out it's just the JS file that needs to be enqueued later, not the CSS. My temporary workaround was to copy the JS file from the CTC plugin to my project, dequeue the script from the CTC Plugin, and then enqueue the script from my project.

stevengliebe commented 7 years ago

Thank you, I'll give this a look at some point.