load_theme_textdomain( 'mk_framework', get_stylesheet_directory() . '/languages' ); } public function admin_menus() { add_menu_page( THEME_NAME, THEME_NAME, 'edit_theme_options', THEME_NAME, array( &$this, 'control_panel', ), 'dashicons-star-filled', 3 ); add_submenu_page( THEME_NAME, __( 'Control Panel', 'mk_framework' ), __( 'Control Panel', 'mk_framework' ), 'edit_theme_options', THEME_NAME, array( &$this, 'control_panel', ) ); if ( NEW_UI_LIBRARY ) { add_submenu_page( THEME_NAME, __( 'New UI', 'mk_framework' ), __( 'New UI', 'mk_framework' ), 'edit_posts', 'ui-library', array( &$this, 'ui_library', ) ); add_submenu_page( THEME_NAME, __( 'UI Page Options', 'mk_framework' ), __( 'UI Page Options', 'mk_framework' ), 'edit_posts', 'ui-page-options', array( &$this, 'ui_page_options', ) ); } } public function ui_page_options() { include_once THEME_CONTROL_PANEL . '/logic/ui-page-options.php'; } public function ui_library() { include_once THEME_CONTROL_PANEL . '/logic/ui-library.php'; } public function control_panel() { include_once THEME_CONTROL_PANEL . '/v2/layout/master.php'; } /** * Stop creating new table and delete the table for sites using older version of * Jupiter. The function will be removed from 5.9.4 * * @author Ugur Mirza ZEYREK & Bob Ulusoy & Reza Ardestani * @copyright Artbees LTD (c) * @link http://artbees.net * @since Version 5.0.0 * @since Version 5.9.3 */ public function mk_theme_setup() { $wp_get_theme = wp_get_theme(); $current_theme_version = $wp_get_theme->get( 'Version' ); if ( $current_theme_version < '5.9.3' ) { global $wpdb; global $jupiter_table_name; $jupiter_table_name = $wpdb->prefix . 'mk_components'; $wpdb->query( "DROP TABLE IF EXISTS $jupiter_table_name" ); } } /** * Compatibility check for hosting php version. * Returns error if php version is below v5.4 * * @author Bob ULUSOY & Ugur Mirza ZEYREK * @copyright Artbees LTD (c) * @link http://artbees.net * @since Version 5.0.5 * @last_update Version 5.0.7 */ public function theme_requirement_check() { if ( ! in_array( $GLOBALS['pagenow'], array( 'admin-ajax.php' ) ) ) { if ( version_compare( phpversion(), '5.4', '<' ) ) { echo '

As stated in Jupiter V5.0 Migration Note your PHP version must be above V5.4. We no longer support php legacy versions (v5.2.X, v5.3.X).

'; echo 'Read more about WordPress environment requirements.

Please contact with your hosting provider or server administrator for php version update.

Your current PHP version is ' . phpversion() . ''; wp_die(); } } } /** * Include main Theme Options class. */ private function theme_options() { include_once THEME_ADMIN . '/theme-options/class-theme-options.php'; } public function lang() { global $mk_lang; $unify_theme_option = get_option( 'mk_unify_theme_options' ); $mk_lang = ''; if ( defined( 'ICL_LANGUAGE_CODE' ) && ! $unify_theme_option ) { $mk_lang = '_' . ICL_LANGUAGE_CODE; } /* * Use this constant in child theme functions.php to unify theme options across all languages in WPML * add define('WPML_UNIFY_THEME_OPTIONS', true); */ if ( defined( 'WPML_UNIFY_THEME_OPTIONS' ) ) { $mk_lang = ''; } return $mk_lang; } /** * Include main customizer class. * * @since 5.9.4 */ private function customizer() { include_once THEME_ADMIN . '/customizer/class-mk-customizer.php'; } /** * Add tour list then include main Tour class. * * @since 5.9.6 */ private function tour() { // Add tour list. Choose short, one-word id. add_filter( 'mk_tour_list', function( $tour_list ) { $tour_list = array( 'intro' => array( 'state' => true, ), ); return $tour_list; } ); include_once THEME_ADMIN . '/tour/class-mk-tour.php'; } }