PluginProbe
Fable Extra / trunk
Fable Extra vtrunk
1.0.13 trunk 1.0.10 1.0.11 1.0.12 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9
fable-extra / fable-extra.php

fable-extra.php in Fable Extra trunk, at fable-extra.php

118 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Fable Extra
4 Plugin URI:
5 Description: Used for WP Fable Themes.
6 Version: 1.0.13
7 Author: WP Fable
8 Author URI: https://wpfable.com/
9 Tested up to: 7.0
10 Requires at least: 5.2
11 License: GPLv3 or later
12 License URI: http://www.gnu.org/licenses/gpl.html
13 Requires PHP: 5.6
14 Text Domain: fable-extra
15 */
16
17 // Block direct access to the main plugin file.
18 defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
19 // Path/URL to root of this plugin, with trailing slash.
20 if ( ! defined( 'WPFE_PATH' ) ) {
21 define( 'WPFE_PATH', plugin_dir_path( __FILE__ ) );
22 }
23 if ( ! defined( 'WPFE_URL' ) ) {
24 define( 'WPFE_URL', plugin_dir_url( __FILE__ ) );
25 }
26
27
28 if( !function_exists('fable_extra_init') ){
29 function fable_extra_init(){
30 require_once('inc/controls/fable-customize-upgrade-control.php');
31 /**
32 * Get Activated Theme
33 */
34 $fable_axtra_activated_theme = wp_get_theme(); // gets the current theme
35 // Shopire Theme
36 if( 'Shopire' == $fable_axtra_activated_theme->name || 'Shopire Child' == $fable_axtra_activated_theme->name){
37 require WPFE_PATH . 'inc/themes/shopire/shopire.php';
38 }
39
40 // MiniCart Theme
41 if( 'MiniCart' == $fable_axtra_activated_theme->name){
42 require WPFE_PATH . 'inc/themes/minicart/minicart.php';
43 }
44
45 // EazyShop Theme
46 if( 'EazyShop' == $fable_axtra_activated_theme->name){
47 require WPFE_PATH . 'inc/themes/eazyshop/eazyshop.php';
48 }
49
50 // EasyBuy Theme
51 if( 'EasyBuy' == $fable_axtra_activated_theme->name){
52 require WPFE_PATH . 'inc/themes/easybuy/easybuy.php';
53 }
54
55 // eKart Theme
56 if( 'eKart' == $fable_axtra_activated_theme->name){
57 require WPFE_PATH . 'inc/themes/ekart/ekart.php';
58 }
59
60 // ShopWay Theme
61 if( 'ShopWay' == $fable_axtra_activated_theme->name){
62 require WPFE_PATH . 'inc/themes/shopway/shopway.php';
63 }
64
65 // BuyCart Theme
66 if( 'BuyCart' == $fable_axtra_activated_theme->name){
67 require WPFE_PATH . 'inc/themes/buycart/buycart.php';
68 }
69
70 // eShopKit Theme
71 if( 'eShopKit' == $fable_axtra_activated_theme->name){
72 require WPFE_PATH . 'inc/themes/eshopkit/eshopkit.php';
73 }
74
75 // ShopZone Theme
76 if( 'ShopZone' == $fable_axtra_activated_theme->name){
77 require WPFE_PATH . 'inc/themes/shopzone/shopzone.php';
78 }
79 }
80 add_action( 'init', 'fable_extra_init' );
81 }
82
83
84 if( !function_exists('fable_extra_woo_feature') ){
85 function fable_extra_woo_feature(){
86 if(class_exists( 'woocommerce' )):
87 $fable_extra_activated_theme = wp_get_theme(); // gets the current theme
88 $fable_extra_themes = array('Shopire','Shopire Child','MiniCart','EazyShop','EasyBuy','eKart','ShopWay','BuyCart','eShopKit','ShopZone');
89 if (in_array($fable_extra_activated_theme->name, $fable_extra_themes)){
90 $woo_features = array(
91 'compare-wishlist',
92 'product-search',
93 'quick-view',
94 );
95
96 foreach ( $woo_features as $feature ) {
97 $feature_file = plugin_dir_path( __FILE__ ) . 'inc/woo-features/fable-extra-' . $feature . '.php';
98 if ( file_exists( $feature_file ) ) {
99 require_once $feature_file;
100 } else {
101 // Optionally, log an error or take action if file doesn't exist
102 error_log( "Feature file not found: " . $feature_file );
103 }
104 }
105 }
106 endif;
107 }
108 add_action( 'plugins_loaded', 'fable_extra_woo_feature','11' );
109 }
110
111 /**
112 * The code during plugin activation.
113 */
114 function fable_extra_activate() {
115 require_once plugin_dir_path( __FILE__ ) . 'inc/fable-extra-activator.php';
116 fable_extra_Activator::activate();
117 }
118 register_activation_hook( __FILE__, 'fable_extra_activate' );