tabs.php
58 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: Kirki Tabs |
| 4 | * Plugin URI: https://www.themeum.com |
| 5 | * Description: Tab control for Kirki Customizer Framework. |
| 6 | * Version: 1.1 |
| 7 | * Author: Themeum |
| 8 | * Author URI: https://www.themeum.com |
| 9 | * License: GPL-3.0 |
| 10 | * License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=control%20tab |
| 11 | * Text Domain: kirki-tabs |
| 12 | * Domain Path: /languages |
| 13 | * |
| 14 | * @package kirki-tabs |
| 15 | */ |
| 16 | |
| 17 | defined( 'ABSPATH' ) || exit; |
| 18 | |
| 19 | if ( ! function_exists( 'kirki_load_tab_control' ) ) { |
| 20 | |
| 21 | /** |
| 22 | * Load tab control inside "plugins_loaded" hook. |
| 23 | * This is necessary to check if Kirki plugin is installed. |
| 24 | */ |
| 25 | function kirki_load_tab_control() { |
| 26 | |
| 27 | // Stop, if Kirki is not installed. |
| 28 | if ( ! defined( 'KIRKI_VERSION' ) ) { |
| 29 | return; |
| 30 | } |
| 31 | |
| 32 | // Stop, if Kirki controls are already loaded. |
| 33 | if ( defined( 'KIRKI_CONTROLS_VERSION' ) ) { |
| 34 | return; |
| 35 | } |
| 36 | |
| 37 | // Stop, if Kirki Tabs is already installed. |
| 38 | if ( class_exists( '\Kirki\Tabs\Init' ) ) { |
| 39 | return; |
| 40 | } |
| 41 | |
| 42 | if ( ! function_exists( 'get_plugin_data' ) ) { |
| 43 | require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 44 | } |
| 45 | |
| 46 | $plugin_data = get_plugin_data( __FILE__ ); |
| 47 | |
| 48 | define( 'KIRKI_TAB_VERSION', $plugin_data['Version'] ); |
| 49 | define( 'KIRKI_TAB_PLUGIN_FILE', __FILE__ ); |
| 50 | |
| 51 | new \Kirki\Tabs\Init(); |
| 52 | |
| 53 | } |
| 54 | |
| 55 | add_action( 'plugins_loaded', 'kirki_load_tab_control' ); |
| 56 | |
| 57 | } |
| 58 |