Last active
October 6, 2020 05:14
-
-
Save wpmudev-sls/3e1555c285135893c835d011af58fc08 to your computer and use it in GitHub Desktop.
[Forminator] - Fix conflict with theme Realestate.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: [Forminator] - Fix conflict with theme Realestate. | |
* Description: [Forminator] - Fix conflict with theme Realestate. | |
* Jira: SLS-469 | |
* Author: Thobk @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} elseif ( defined( 'WP_CLI' ) && WP_CLI ) { | |
return; | |
} | |
add_action( 'wp_enqueue_scripts', 'wpmudev_forminator_fix_confict_theme_realestate', 100 ); | |
function wpmudev_forminator_fix_confict_theme_realestate(){ | |
if( defined('REALESTATE7_SL_THEME_VERSION') && defined('FORMINATOR_PRO') ){ | |
// fix conflict with NiceSelect. | |
if(!is_page_template('template-idx.php') || !is_page_template('template-idx-full-width.php')) { | |
wp_dequeue_script( 'ctSelect' ); | |
// wp_enqueue_script('ctSelect', get_template_directory_uri() . '/js/ct.select.js', array('jquery'), '1.0', false); | |
$custom_script = '!function(e){e(function(){let t=e("select:not(.forminator-select)");t.niceSelect(),t.niceSelect("update")})}(window.jQuery);'; | |
wp_add_inline_script( 'ctNiceSelect', $custom_script ); | |
} | |
$custom_css = '#ui-datepicker-div[class*="forminator-calendar"] thead{background:0 0}#ui-datepicker-div[class*="forminator-calendar"] .ui-widget-header,#ui-datepicker-div[class*="forminator-calendar"].ui-widget-content{height:auto!important;background:0 0!important}#ui-datepicker-div[class*="forminator-calendar"] .ui-state-default{height:auto!important}'; | |
wp_add_inline_style( 'layout', $custom_css ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment