$(document).ready(function(){
$("#hider").click(function () {
if ($("#pum-235").show()) {
$(".mfp-wrap").hide() + $(".mfp-bg").hide();
}
});
});
final class NikMaster_Products_Slider {
const VERSION = '1.0';
const MINIMUM_ELEMENTOR_VERSION = '2.0.0';
const MINIMUM_PHP_VERSION = '7.0';
private static $_instance = null;
public static function instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
public function __construct() {
add_action( 'init', [ $this, 'i18n' ] );
add_action( 'plugins_loaded', [ $this, 'init' ] );
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ], 11 );
}
public function init() {
// Check if Elementor installed and activated
if (!did_action( 'elementor/loaded')) {
add_action( 'admin_notices', [ $this, 'admin_notice_missing_main_plugin' ] );
return false;
}
// Check for required Elementor version
if (! version_compare( ELEMENTOR_VERSION, self::MINIMUM_ELEMENTOR_VERSION, '>=')) {
add_action( 'admin_notices', [ $this, 'admin_notice_minimum_elementor_version' ] );
return false;
}
// Check for required PHP version
if (version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<')) {
add_action( 'admin_notices', [ $this, 'admin_notice_minimum_php_version' ] );
return false;
}
return true;
// Add Plugin actions
add_action( 'elementor/widgets/widgets_registered', [ $this, 'init_widgets' ] );
add_action( 'elementor/controls/register', [ $this, 'register_controls' ] );
}
public function i18n() {
load_plugin_textdomain( 'nikmaster-elementor-add-on' );
}
public function admin_notice_missing_main_plugin() {
if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
$message = sprintf(
/* translators: 1: Plugin name 2: Elementor */
esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'elementor-test-addon' ),
'<strong>' . esc_html__( 'Elementor Test Addon', 'nikmaster-elementor-add-on' ) . '</strong>',
'<strong>' . esc_html__( 'Elementor', 'nikmaster-elementor-add-on' ) . '</strong>'
);
printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );
}
public function admin_notice_minimum_elementor_version() {
if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] );
$message = sprintf(
/* translators: 1: Plugin name 2: Elementor 3: Required Elementor version */
esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'nikmaster-elementor-add-on' ),
'<strong>' . esc_html__( 'Elementor', 'nikmaster-elementor-add-on' ) . '</strong>',
self::MINIMUM_ELEMENTOR_VERSION
);
printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );
}
public function admin_notice_minimum_php_version() {
if (isset( $_GET['activate'])) unset( $_GET['activate'] );
$message = sprintf(
/* translators: 1: Plugin name 2: PHP 3: Required PHP version */
esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'nikmaster-elementor-add-on' ),
'<strong>'. esc_html__( 'PHP 7.0', 'nikmaster-elementor-add-on' ). '</strong>',
self::MINIMUM_PHP_VERSION
);
printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message );
}
public function init_widgets($widgets_manager) {
// Include Widget files
require_once( __DIR__ . '/includes/widgets/widget-1.php' );
require_once( __DIR__ . '/includes/widgets/widget-2.php' );
// Register widget
$widgets_manager->register( new \Widget_1() );
$widgets_manager->register( new \Widget_2() );
}
public function register_controls( $controls_manager ) {
require_once( __DIR__ . '/includes/controls/control-1.php' );
require_once( __DIR__ . '/includes/controls/control-2.php' );
$controls_manager->register( new \Control_1() );
$controls_manager->register( new \Control_2() );
}
}