OwlCyberSecurity - MANAGER
Edit File: pearl-medical-framework.php
<?php /** * @link http://themeforest.net/user/pearlthemes * @package pearl-medical-framework * * @wordpress-plugin * Plugin Name: MedicalGuide Framework * Plugin URI: http://www.pearlthemes.com * Description: Pearl Medical Framework plugin provides Doctors, Services, Testimonials and Gallery post types with related functionality. * Version: 3.0.1 * Requires at least: 6.0 * Tested up to: 6.5.2 * Requires PHP: 7.4 * Author: PearlThemes * Author URI: http://themeforest.net/user/pearlthemes * Text Domain: pearl-medical-framework * Domain Path: /languages */ // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { die; } /** * The code that runs during plugin activation. * This action is documented in includes/class-pearl-medical-framework-activator.php */ function activate_pearl_medical_framework() { require_once plugin_dir_path( __FILE__ ) . 'includes/class-pearl-medical-framework-activator.php'; Pearl_Medical_Framework_Activator::activate(); } /** * The code that runs during plugin deactivation. * This action is documented in includes/class-pearl-medical-framework-deactivator.php */ function deactivate_pearl_medical_framework() { require_once plugin_dir_path( __FILE__ ) . 'includes/class-pearl-medical-framework-deactivator.php'; Pearl_Medical_Framework_Deactivator::deactivate(); } register_activation_hook( __FILE__, 'activate_pearl_medical_framework' ); register_deactivation_hook( __FILE__, 'deactivate_pearl_medical_framework' ); /** * The core plugin class that is used to define internationalization, * admin-specific hooks, and public-facing site hooks. */ require plugin_dir_path( __FILE__ ) . 'includes/class-pearl-medical-framework.php'; /** * Begins execution of the plugin. * * Since everything within the plugin is registered via hooks, * then kicking off the plugin from this point in the file does * not affect the page life cycle. * * @since 1.0.0 */ function run_pearl_medical_framework() { $plugin = new Pearl_Medical_Framework(); $plugin->run(); } run_pearl_medical_framework(); /** * Visual Composer elements * * @since 1.0.0 */ add_action( 'init', 'pearl_load_page_builder_elements' ); function pearl_load_page_builder_elements() { if ( MG_Helper::is_design_variation( 'modern' ) ) { if ( is_plugin_active( 'elementor/elementor.php' ) ) { require_once( plugin_dir_path( __FILE__ ) . 'elementor/elementor-config.php' ); } else { add_action( 'admin_notices', 'pearl_elementor_not_loaded' ); } } else { if ( class_exists( 'Vc_Manager' ) ) { require_once( plugin_dir_path( __FILE__ ) . 'visual-composer/shortcodes/shortcodes.php' ); require_once( plugin_dir_path( __FILE__ ) . 'visual-composer/vc_row_edit.php' ); } else { add_action( 'admin_notices', 'pearl_vc_not_loaded' ); } } } function pearl_vc_not_loaded() { printf( '<div class="error"><p>%s</p></div>', esc_html__( 'Sorry, you cannot use MedicalGuide theme elements because Visual Composer plugin is not activated.', 'pearl-medical-framework' ) ); } function pearl_elementor_not_loaded() { printf( '<div class="error"><p>%s</p></div>', esc_html__( 'Sorry, you cannot use MedicalGuide theme elements because Elementor plugin is not activated.', 'pearl-medical-framework' ) ); } class MG_Helper { private static $default_variation = null; public static function is_design_variation( $variation ) { return $variation === self::get_default_variation(); } public static function get_default_variation() { // TODO: make it a class data variable instead of method. if ( self::$default_variation === null ) { self::$default_variation = get_option( 'pearl_design_variation', 'default' ); } return self::$default_variation; } public static function get_color_schemes() { // TODO: this is a modern variation specific helper think to add only when needed. $color_schemes = array( 'indigo', 'stone', 'red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'violet', 'purple', 'fuchsia', 'pink', 'rose', ); return $color_schemes; } }