static function init() { self::$_dir = str_replace('\\', '/', dirname(__FILE__)); $wp_content_dir = str_replace('\\', '/', WP_CONTENT_DIR); $relative_url = str_replace($wp_content_dir, '', self::$_dir); $wp_content_url = is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL; self::$_url = $wp_content_url . $relative_url; self::$_themepath = str_replace('\\', '/', dirname(dirname(__FILE__))); }
<?php // Load shortcodes AlfathAdmin::load_file(ADMIN_DIR . '/shortcodes/bootstrap/shortcodes', '*.php');
<?php // Helper class require_once 'class-alfath-admin.php'; // Constant definition define('THEME_PATH', AlfathAdmin::$_themepath); define('ADMIN_DIR', AlfathAdmin::$_dir); define('ADMIN_URL', AlfathAdmin::$_url); define('OPT_NAME', 'alfath_opt'); // Load loaders.php AlfathAdmin::load_file(ADMIN_DIR, 'loaders.php');
<?php // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Load Shortcodes AlfathAdmin::load_file(ADMIN_DIR . '/shortcodes/', 'shortcode.php');
<?php // Load TGM if (!class_exists('TGM_Plugin_Activation')) { require_once ADMIN_DIR . '/vendor/tgm/class-tgm-plugin-activation.php'; } // Load integrated plugins AlfathAdmin::load_file(ADMIN_DIR . '/vendor/plugins', 'plugin.php'); // Load init if (!class_exists('AlfathTgmInit')) { require_once ADMIN_DIR . '/vendor/class-alfath-tgm-init.php'; }
<?php // Load metabox only if wordpress_fieldmanager installed if (class_exists('Fieldmanager_Field')) { AlfathAdmin::load_file(ADMIN_DIR . '/metabox', 'config.php'); }
<?php // Load Framework if (!class_exists('ReduxFramework') && file_exists(ADMIN_DIR . '/option/ReduxFramework/ReduxCore/framework.php')) { require_once ADMIN_DIR . '/option/ReduxFramework/ReduxCore/framework.php'; } // Load additional config AlfathAdmin::load_file(ADMIN_DIR . '/option/configs', 'config.php'); // Redux Instance, load last if (file_exists(ADMIN_DIR . '/option/configs/class-alfath-redux-config.php')) { require_once ADMIN_DIR . '/option/configs/class-alfath-redux-config.php'; }