| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Tabs Responsive |
| 4 |
* Version: 2.4.4 |
| 5 |
* Description: Tabs Responsive is the most easiest drag & drop Tabs builder for WordPress. You can add unlimited Tabs with unlimited color Scheme. |
| 6 |
* Author: wpshopmart |
| 7 |
* Author URI: https://www.wpshopmart.com |
| 8 |
* Plugin URI: https://www.wpshopmart.com/plugins/ |
| 9 |
*/ |
| 10 |
|
| 11 |
/** |
| 12 |
* DEFINE PATHS |
| 13 |
*/ |
| 14 |
define('wpshopmart_tabs_r_directory_path', plugin_dir_path(__FILE__)); |
| 15 |
define("wpshopmart_tabs_r_directory_url", plugin_dir_url(__FILE__)); |
| 16 |
define("wpshopmart_tabs_r_text_domain", "wpsm_tabs_r"); |
| 17 |
define('RESPONSIVE_TABS_URL', plugins_url('/', __FILE__)); |
| 18 |
define('RESPONSIVE_TABS_PLUGIN_VERSION', '2.4.1'); |
| 19 |
define('RESPONSIVE_TABS_WOOCOMMERCE_POST_TYPE', 'responsive_woo_tabs'); |
| 20 |
add_action('plugins_loaded', 'wpsm_tabs_r_tr'); |
| 21 |
function wpsm_tabs_r_tr() { |
| 22 |
load_plugin_textdomain( wpshopmart_tabs_r_text_domain, FALSE, dirname( plugin_basename(__FILE__)).'/languages/' ); |
| 23 |
} |
| 24 |
|
| 25 |
|
| 26 |
/** |
| 27 |
* Including composer autoloader globally. |
| 28 |
* |
| 29 |
* @since 3.1.0 |
| 30 |
*/ |
| 31 |
require_once wpshopmart_tabs_r_directory_path . 'autoloader.php'; |
| 32 |
|
| 33 |
|
| 34 |
/** |
| 35 |
* PLUGIN Install |
| 36 |
*/ |
| 37 |
require_once("ink/install/installation.php"); |
| 38 |
|
| 39 |
function wpsm_tabs_r_default_data() { |
| 40 |
$Settings_Array = serialize( array( |
| 41 |
"tabs_sec_title" => "yes", |
| 42 |
"show_tabs_title_icon" => "1", |
| 43 |
"show_tabs_icon_align" => "left", |
| 44 |
"enable_tabs_border" => "yes", |
| 45 |
"tabs_title_bg_clr" => "#e8e8e8", |
| 46 |
"tabs_title_icon_clr" => "#000000", |
| 47 |
"select_tabs_title_bg_clr" => "#ffffff", |
| 48 |
"select_tabs_title_icon_clr" => "#000000", |
| 49 |
"tabs_desc_bg_clr" => "#ffffff", |
| 50 |
"tabs_desc_font_clr" => "#000000", |
| 51 |
"title_size" => "14", |
| 52 |
"des_size" => "16", |
| 53 |
"font_family" => "Open Sans", |
| 54 |
"tabs_styles" =>1, |
| 55 |
"custom_css" =>"", |
| 56 |
"tabs_animation" =>"fadeIn", |
| 57 |
"tabs_alignment" =>"horizontal", |
| 58 |
"tabs_position" =>"left", |
| 59 |
"tabs_margin" =>"no", |
| 60 |
"tabs_content_margin" =>"no", |
| 61 |
) ); |
| 62 |
add_option('Tabs_R_default_Settings', $Settings_Array); |
| 63 |
} |
| 64 |
register_activation_hook( __FILE__, 'wpsm_tabs_r_default_data' ); |
| 65 |
|
| 66 |
/** |
| 67 |
* tabs responsive cpt + admin panel |
| 68 |
*/ |
| 69 |
require_once("ink/admin/menu.php"); |
| 70 |
|
| 71 |
/** |
| 72 |
* SHORTCODE |
| 73 |
*/ |
| 74 |
require_once("template/shortcode.php"); |
| 75 |
|
| 76 |
/** |
| 77 |
* WIDGET |
| 78 |
*/ |
| 79 |
require_once("ink/widget/widget.php"); |
| 80 |
|
| 81 |
// darken color code |
| 82 |
function ColorDarken($color, $dif=50){ |
| 83 |
|
| 84 |
$color = str_replace('#', '', $color); |
| 85 |
if (strlen($color) != 6){ return '000000'; } |
| 86 |
$rgb = ''; |
| 87 |
|
| 88 |
for ($x=0;$x<3;$x++){ |
| 89 |
$c = hexdec(substr($color,(2*$x),2)) - $dif; |
| 90 |
$c = ($c < 0) ? 0 : dechex($c); |
| 91 |
$rgb .= (strlen($c) < 2) ? '0'.$c : $c; |
| 92 |
} |
| 93 |
return '#'.$rgb; |
| 94 |
} |
| 95 |
|
| 96 |
// Add settings link on plugin page |
| 97 |
function wpsm_tabs_r_settings_link($links) { |
| 98 |
$settings_link = '<a href="edit.php?post_type=tabs_responsive">Settings</a>'; |
| 99 |
array_unshift($links, $settings_link); |
| 100 |
return $links; |
| 101 |
} |
| 102 |
|
| 103 |
$plugin = plugin_basename(__FILE__); |
| 104 |
add_filter("plugin_action_links_$plugin", 'wpsm_tabs_r_settings_link' ); |
| 105 |
add_action('admin_menu' , 'wpsm_tabs_r_recom_menu'); |
| 106 |
function wpsm_tabs_r_recom_menu() { |
| 107 |
$submenu = add_submenu_page('edit.php?post_type=tabs_responsive', __('More_Free_Plugins', wpshopmart_tabs_r_text_domain), __('More Free Plugins', wpshopmart_tabs_r_text_domain), 'administrator', 'wpsm_tabs_r_recom_page', 'wpsm_tabs_rrecom_page_funct'); |
| 108 |
$submenu2 = add_submenu_page('edit.php?post_type=tabs_responsive', __('Free Vs Pro', wpshopmart_tabs_r_text_domain), __('Free Vs Pro', wpshopmart_tabs_r_text_domain), 'administrator', 'wpsm_tabs_r_fvp_page', 'wpsm_tabs_r_fvp_page_funct'); |
| 109 |
|
| 110 |
//add hook to add styles and scripts for Tabs Plugin admin page |
| 111 |
add_action( 'admin_print_styles-' . $submenu, 'wpsm_tabs_r_recom_js_css' ); |
| 112 |
add_action( 'admin_print_styles-' . $submenu2, 'wpsm_tabs_r_fvp_js_css' ); |
| 113 |
} |
| 114 |
function wpsm_tabs_r_recom_js_css(){ |
| 115 |
wp_enqueue_style('wpsm_tabs_r_bootstrap_css_recom', wpshopmart_tabs_r_directory_url.'assets/css/bootstrap.css'); |
| 116 |
wp_enqueue_style('wpsm_tabs_ac_help_css', wpshopmart_tabs_r_directory_url.'assets/css/help.css'); |
| 117 |
} |
| 118 |
function wpsm_tabs_rrecom_page_funct(){ |
| 119 |
require_once('ink/admin/free.php'); |
| 120 |
} |
| 121 |
|
| 122 |
function wpsm_tabs_r_fvp_js_css(){ |
| 123 |
wp_enqueue_style('wpsm_tabs_r_settings_fvp', wpshopmart_tabs_r_directory_url.'assets/css/settings.css'); |
| 124 |
|
| 125 |
} |
| 126 |
function wpsm_tabs_r_fvp_page_funct(){ |
| 127 |
require_once('ink/admin/fvp.php'); |
| 128 |
} |
| 129 |
|
| 130 |
?> |