/** * This function enqueues all styles and scripts. */ public function wp_enqueue_scripts() { // Bail if Baton Conductor isn't active if ($this->is_baton_conductor_disabled()) { return; } // Grab the Conductor Widget instance (if it exists) $conductor_widget = class_exists('Conductor') && function_exists('Conduct_Widget') ? Conduct_Widget() : false; // If Conductor isn't active or at least one Conductor Widget isn't active if (!class_exists('Conductor') || $conductor_widget && is_a($conductor_widget, 'Conductor_Widget') && !is_active_widget(false, false, $conductor_widget->id_base, true)) { // Conductor Flexbox Shim wp_enqueue_style('baton-conductor-flexbox', get_template_directory_uri() . '/css/conductor-flexbox.css', false, $this->version); } }
/** * This function checks to see if Conductor has the new flexbox display. */ public function conductor_has_flexbox_display($conductor_widget = false) { // Bail if Conductor doesn't exist if (!class_exists('Conductor') || !function_exists('Conduct_Widget')) { return false; } // If we don't have a Conductor Widget reference, grab one now $conductor_widget = !$conductor_widget ? Conduct_Widget() : $conductor_widget; // If Conductor is greater than 1.2.9 or Conductor Widget instance has the "displays" property, we can check to see if the custom display exists return (version_compare(Conductor::$version, '1.2.9', '>') || property_exists($conductor_widget, 'displays')) && isset($conductor_widget->displays['flexbox']); }