/** * The constructor */ public function __construct() { if (is_woocommerce_active() && version_compare(WC()->version, '2.2.0', '>=')) { $this->setup(); } else { add_action('admin_notices', array($this, 'notice_wc_required')); } }
function ux_woocommerce_version_check($version = '2.1') { if (function_exists('is_woocommerce_active') && is_woocommerce_active()) { global $woocommerce; if (version_compare($woocommerce->version, $version, ">=")) { return true; } } return false; }
function rtwoo_gitlab_woo_check() { if (!function_exists('woothemes_queue_update')) { require_once 'woo-includes/woo-functions.php'; } if (is_woocommerce_active()) { return true; } else { return false; } }
/** * init * * @access public * @since 1.0.0 * @return bool */ public function __construct() { self::$_this = $this; add_action('init', array($this, 'load_plugin_textdomain')); // Required functions require_once 'woo-includes/woo-functions.php'; if (is_woocommerce_active()) { if (is_admin()) { include_once 'includes/class-wc-geolocation-based-products-admin.php'; add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'action_links')); } else { include_once 'includes/class-wc-geolocation-based-products-frontend.php'; } } else { add_action('admin_notices', array($this, 'woocommerce_missing_notice')); } return true; }
/** * Register sidebars for Carpress * * @package Carpress */ function add_my_sidebars() { // blog sidebar if (function_exists('ot_get_option')) { $blog = ot_get_option('blog_layout', 'no'); } if ("no" != $blog) { register_sidebar(array('name' => _x('Blog Sidebar', 'backend', 'carpress_wp'), 'id' => 'blog-sidebar', 'description' => _x('Sidebar in the blog layout', 'backend', 'carpress_wp'), 'class' => 'blog sidebar', 'before_widget' => '<div id="%1$s" class="sidebar-item %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="lined">', 'after_title' => '<span class="bolded-line"></span></div>')); } // services sidebar if (function_exists('ot_get_option')) { $services = ot_get_option('services_layout', 'no'); } if ("no" != $services) { register_sidebar(array('name' => _x('Services Sidebar', 'backend', 'carpress_wp'), 'id' => 'services-sidebar', 'description' => _x('Sidebar in the services layout', 'backend', 'carpress_wp'), 'class' => 'services sidebar', 'before_widget' => '<div id="%1$s" class="sidebar-item %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="lined">', 'after_title' => '<span class="bolded-line"></span></div>')); } // gallery sidebar if (function_exists('ot_get_option')) { $services = ot_get_option('gallery_layout', 'no'); } if ("no" != $services) { register_sidebar(array('name' => _x('Gallery Sidebar', 'backend', 'carpress_wp'), 'id' => 'gallery-sidebar', 'description' => _x('Sidebar in the gallery layout', 'backend', 'carpress_wp'), 'class' => 'gallery sidebar', 'before_widget' => '<div id="%1$s" class="sidebar-item %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="lined">', 'after_title' => '<span class="bolded-line"></span></div>')); } // woocommerce shop sidebar if (is_woocommerce_active()) { register_sidebar(array('name' => _x('Shop Sidebar', 'backend', 'carpress_wp'), 'id' => 'shop-sidebar', 'description' => _x('Sidebar for the shop page', 'backend', 'carpress_wp'), 'class' => 'left sidebar', 'before_widget' => '<div class="sidebar-item %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="lined">', 'after_title' => '<span class="bolded-line"></span></div>')); } // contact page register_sidebar(array('name' => _x('Contact Page Sidebar', 'backend', 'carpress_wp'), 'id' => 'contact-sidebar', 'description' => _x('Sidebar on the contact us and make an appointment page', 'backend', 'carpress_wp'), 'class' => 'contact-us sidebar', 'before_widget' => '<div id="%1$s" class="sidebar-item %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="lined">', 'after_title' => '<span class="bolded-line"></span></div>')); // regular page register_sidebar(array('name' => _x('Regular Page Sidebar', 'backend', 'carpress_wp'), 'id' => 'regular-page-sidebar', 'description' => _x('Sidebar on the regular page', 'backend', 'carpress_wp'), 'class' => 'regular-page sidebar', 'before_widget' => '<div id="%1$s" class="sidebar-item %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="lined">', 'after_title' => '<span class="bolded-line"></span></div>')); // opening time above the slider register_sidebar(array('name' => _x('Opening Time in Jumbotron', 'backend', 'carpress_wp'), 'id' => 'above-slider', 'description' => _x('Widget area in the jumbotron on the homepage for opening times', 'backend', 'carpress_wp'), 'before_widget' => '<div id="%1$s" class="%2$s">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '')); // widgets at the bottom of the jumbotron register_sidebar(array('name' => _x('Jumbotron Widgets', 'backend', 'carpress_wp'), 'id' => 'jumbotron-bottom', 'description' => _x('Widget area for three widgets in the jumbotron on the homepage', 'backend', 'carpress_wp'), 'before_widget' => '<div id="%1$s" class="%2$s widget clearfix">', 'after_widget' => '</div>', 'before_title' => '', 'after_title' => '')); // home page - above maps register_sidebar(array('name' => _x('Home Page - above Google maps', 'backend', 'carpress_wp'), 'id' => 'home-above-map', 'description' => _x('Sidebar above the Google maps on the homepage', 'backend', 'carpress_wp'), 'before_widget' => '<div class="span3"><div class="%2$s">', 'after_widget' => '</div></div>', 'before_title' => '<div class="lined">', 'after_title' => '<span class="bolded-line"></span></div>')); // home page - under Google maps register_sidebar(array('name' => _x('Home Page - under Google maps', 'backend', 'carpress_wp'), 'id' => 'home-under-map', 'description' => _x('Sidebar under the Google maps on the homepage', 'backend', 'carpress_wp'), 'before_widget' => '<div class="span3"><div class="%2$s">', 'after_widget' => '</div></div>', 'before_title' => '<div class="lined">', 'after_title' => '<span class="bolded-line"></span></div>')); // footer register_sidebar(array('name' => _x('Footer', 'backend', 'carpress_wp'), 'id' => 'footer-sidebar-area', 'description' => _x('Sidebar in the dark area at the bottom of the website', 'backend', 'carpress_wp'), 'before_widget' => '<div class="span3"><div class="%2$s">', 'after_widget' => '</div></div>', 'before_title' => '<div class="lined">', 'after_title' => '<span class="bolded-line"></span></div>')); }
/** * Constructor */ public function __construct() { add_action('init', array($this, 'load_plugin_textdomain')); if (is_woocommerce_active() && class_exists('WC_Payment_Gateway')) { add_filter('woocommerce_payment_gateways', array($this, 'register_gateway')); if (is_admin()) { add_action('admin_notices', array($this, 'ssl_check')); } include 'includes/class-wc-gateway-paypal-pro.php'; include 'includes/class-wc-gateway-paypal-pro-payflow.php'; add_action('woocommerce_order_status_on-hold_to_processing', array($this, 'capture_payment')); add_action('woocommerce_order_status_on-hold_to_completed', array($this, 'capture_payment')); add_action('woocommerce_order_status_on-hold_to_cancelled', array($this, 'cancel_payment')); add_action('woocommerce_order_status_on-hold_to_refunded', array($this, 'cancel_payment')); add_action('admin_init', array($this, 'update_ssl_nag')); } else { add_action('admin_notices', array($this, 'woocommerce_missing_notice')); } return true; }
/** * Constructor */ public function __construct() { add_action('init', array($this, 'load_plugin_textdomain')); if (is_woocommerce_active() && class_exists('WC_Payment_Gateway')) { if (version_compare(get_option('woocommerce_paypal_pro_version', 0), self::VERSION, '<')) { $this->update(); } add_filter('woocommerce_payment_gateways', array($this, 'register_gateway')); if (is_admin()) { add_action('admin_notices', array($this, 'ssl_check')); } include 'includes/class-wc-gateway-paypal-pro.php'; include 'includes/class-wc-gateway-paypal-pro-payflow.php'; add_action('woocommerce_order_status_on-hold_to_processing', array($this, 'capture_payment')); add_action('woocommerce_order_status_on-hold_to_completed', array($this, 'capture_payment')); add_action('woocommerce_order_status_on-hold_to_cancelled', array($this, 'cancel_payment')); add_action('woocommerce_order_status_on-hold_to_refunded', array($this, 'cancel_payment')); add_action('admin_init', array($this, 'update_ssl_nag')); add_action('admin_notices', array($this, 'cardinal_upgrade_notice')); add_action('wp_ajax_dismiss-notice', array($this, 'dissmissable_notice_handler')); } else { add_action('admin_notices', array($this, 'woocommerce_missing_notice')); } }
* @category Importer * @copyright Copyright (c) 2012-2014, SkyVerge, Inc. * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly // Required functions if (!function_exists('woothemes_queue_update')) { require_once 'woo-includes/woo-functions.php'; } // Plugin updates woothemes_queue_update(plugin_basename(__FILE__), 'eb00ca8317a0f64dbe185c995e5ea3df', '18709'); // WC active check/is admin if (!is_woocommerce_active() || !is_admin()) { return; } // Required library classss if (!class_exists('SV_WC_Framework_Bootstrap')) { require_once 'lib/skyverge/woocommerce/class-sv-wc-framework-bootstrap.php'; } SV_WC_Framework_Bootstrap::instance()->register_plugin('2.1', __('WooCommerce Customer/Order CSV Import', 'woocommerce-customer-order-csv-import'), __FILE__, 'init_woocommerce_customer_order_csv_import'); function init_woocommerce_customer_order_csv_import() { /** * Customer/Order/Coupon CSV Import Suite Main Class. This class is responsible * for registering the importers and setting up the admin start page/menu * items. The actual import process is handed off to the various parse * and import classes. *
/** * Initializes hooks * * @access public * @since 1.0.0 * @version 1.0.0 * @return bool */ public function init_hooks() { register_deactivation_hook(__FILE__, array('WC_Square_Deactivation', 'deactivate')); if (is_woocommerce_active()) { add_filter('woocommerce_integrations', array($this, 'include_integration')); add_action('plugins_loaded', array($this, 'load_plugin_textdomain')); add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts')); add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles')); add_action('woocommerce_square_bulk_syncing_square_to_wc', array($this->wc_to_square_wp_hooks, 'disable')); add_action('admin_notices', array($this, 'is_connected_to_square')); } else { add_action('admin_notices', array($this, 'woocommerce_missing_notice')); } }
public function remove_user_from_post() { global $woothemes_sensei; $return = ''; // Security check $nonce = ''; if (isset($_POST['remove_user_from_post_nonce'])) { $nonce = esc_html($_POST['remove_user_from_post_nonce']); } if (!wp_verify_nonce($nonce, 'remove_user_from_post_nonce')) { die($return); } // Parse POST data $data = $_POST['data']; $action_data = array(); parse_str($data, $action_data); if ($action_data['user_id'] && $action_data['post_id'] && $action_data['post_type']) { $user_id = intval($action_data['user_id']); $post_id = intval($action_data['post_id']); $post_type = sanitize_text_field($action_data['post_type']); $order_id = sanitize_text_field($action_data['order_id']); $user = get_userdata($user_id); switch ($post_type) { case 'course': $removed = WooThemes_Sensei_Utils::sensei_remove_user_from_course($post_id, $user_id); if (!empty($order_id) && is_woocommerce_active()) { $order = new WC_Order($order_id); if (!empty($order)) { $order->update_status('cancelled'); } } break; case 'lesson': $removed = WooThemes_Sensei_Utils::sensei_remove_user_from_lesson($post_id, $user_id); break; } if ($removed) { $return = 'removed'; } } die($return); }
/** * Called when WooCommerce is inactive to display an inactive notice. * * @since 1.2 */ public static function woocommerce_inactive_notice() { if (current_user_can('activate_plugins')) { if (!is_woocommerce_active()) { ?> <div id="message" class="error"> <p><?php // translators: 1$-2$: opening and closing <strong> tags, 3$-4$: link tags, takes to woocommerce plugin on wp.org, 5$-6$: opening and closing link tags, leads to plugins.php in admin printf(esc_html__('%1$sWooCommerce Subscriptions is inactive.%2$s The %3$sWooCommerce plugin%4$s must be active for WooCommerce Subscriptions to work. Please %5$sinstall & activate WooCommerce »%6$s', 'woocommerce-subscriptions'), '<strong>', '</strong>', '<a href="http://wordpress.org/extend/plugins/woocommerce/">', '</a>', '<a href="' . esc_url(admin_url('plugins.php')) . '">', '</a>'); ?> </p> </div> <?php } elseif (version_compare(get_option('woocommerce_db_version'), '2.3', '<')) { ?> <div id="message" class="error"> <p><?php // translators: 1$-2$: opening and closing <strong> tags, 3$-4$: opening and closing link tags, leads to plugin admin printf(esc_html__('%1$sWooCommerce Subscriptions is inactive.%2$s This version of Subscriptions requires WooCommerce 2.3 or newer. Please %3$supdate WooCommerce to version 2.3 or newer »%4$s', 'woocommerce-subscriptions'), '<strong>', '</strong>', '<a href="' . esc_url(admin_url('plugins.php')) . '">', '</a>'); ?> </p> </div> <?php } ?> <?php } }
" alt="<?php bloginfo('name'); ?> " /></a> <?php } ?> <div class="main_navigation"> <div class="main_menu_nav_wrapper"> <?php wp_nav_menu(array('theme_location' => 'primary_menu', 'depth' => 5, 'container' => false, 'menu_class' => 'main_menu_nav')); ?> </div> <?php global $woocommerce; if (is_woocommerce_active() && sizeof($woocommerce->cart->cart_contents) > 0) { ?> <a href="<?php echo esc_url($woocommerce->cart->get_cart_url()); ?> " class="cart_button"><i class="fa fa-shopping-cart"></i><span class="count"><?php echo esc_attr($woocommerce->cart->cart_contents_count); ?> </span></a> <?php } ?> <?php if (!get_theme_mod('search_button')) { ?> <a href="#" data-toggle="modal" data-target="#show_search" class="search_button"><i class="fa fa-search"></i></a>
function useWoo() { $ret = is_woocommerce_active() && $this->options['use_woo'] == 'on' ? true : false; return $ret; }
<?php if (is_home()) { $title = ot_get_option('blog_page_title', get_bloginfo('title')); } elseif (is_category()) { $title = __('Category', 'carpress_wp') . ': ' . single_cat_title('', false); } elseif (is_tag()) { $title = __('Tag', 'carpress_wp') . ': ' . single_tag_title('', false); } elseif (is_search()) { $title = __('Search Results For', 'carpress_wp') . ' "' . get_search_query() . '"'; } elseif ('services' == get_post_type()) { $title = ot_get_option('services_page_title', __('Services', 'carpress_wp')); } elseif ('gallery' == get_post_type()) { $title = ot_get_option('gallery_page_title', __('Gallery', 'carpress_wp')); } elseif ('team' == get_post_type()) { $title = ot_get_option('team_page_title', __('Meet the Team', 'carpress_wp')); } elseif (is_woocommerce_active() && is_woocommerce()) { ob_start(); woocommerce_page_title(); $title = ob_get_contents(); ob_end_clean(); } else { $title = get_the_title(); } ?> <h1><?php echo strip_tags($title); ?> </h1> </div> <?php get_template_part('social-icons');
/** * init_advanced_notifications function. * * @access public * @return void */ function init_advanced_notifications() { if (is_woocommerce_active()) { include_once 'classes/class-wc-advanced-notifications.php'; } }
/** * Generates content for a single row of the table in the user management * screen. * * @since 1.7.0 * * @param object $item The current item * * @return void */ protected function get_row_data($item) { global $wp_version, $woothemes_sensei; switch ($this->view) { case 'learners': // in this case the item passed in is actually the users activity on course of lesson $user_activity = $item; $post_id = false; if ($this->lesson_id) { $post_id = intval($this->lesson_id); $object_type = __('lesson', 'woothemes-sensei'); $post_type = 'lesson'; } elseif ($this->course_id) { $post_id = intval($this->course_id); $object_type = __('course', 'woothemes-sensei'); $post_type = 'course'; } if ('complete' == $user_activity->comment_approved || 'graded' == $user_activity->comment_approved || 'passed' == $user_activity->comment_approved) { $status_html = '<span class="graded">' . apply_filters('sensei_completed_text', __('Completed', 'woothemes-sensei')) . '</span>'; } else { $status_html = '<span class="in-progress">' . apply_filters('sensei_in_progress_text', __('In Progress', 'woothemes-sensei')) . '</span>'; } $title = $woothemes_sensei->learners->get_learner_full_name($user_activity->user_id); $a_title = sprintf(__('Edit “%s”'), $title); // get the learners order for this course if the course was purchased $course_order_id_attribute = ''; if (is_woocommerce_active()) { $course_product_order_id = Sensei_WC::get_learner_course_active_order_id($user_activity->user_id, $post_id); if ($course_product_order_id) { $course_order_id_attribute = ' data-order_id="' . $course_product_order_id . '" '; } } /** * sensei_learners_main_column_data filter * * This filter runs on the learner management screen for a specific course. * It provides the learner row column details. * * @param array $columns{ * type string $title * type string $date_started * type string $course_status (completed, started etc) * type html $action_buttons * } */ $column_data = apply_filters('sensei_learners_main_column_data', array('title' => '<strong><a class="row-title" href="' . admin_url('user-edit.php?user_id=' . $user_activity->user_id) . '" title="' . esc_attr($a_title) . '">' . $title . '</a></strong>', 'date_started' => get_comment_meta($user_activity->comment_ID, 'start', true), 'user_status' => $status_html, 'actions' => '<a class="remove-learner button" data-user_id="' . $user_activity->user_id . '" data-post_id="' . $post_id . '" data-post_type="' . $post_type . '" ' . $course_order_id_attribute . '">' . sprintf(__('Remove from %1$s', 'woothemes-sensei'), $object_type) . '</a>'), $item, $post_id, $post_type); break; case 'lessons': $lesson_learners = WooThemes_Sensei_Utils::sensei_check_for_activity(apply_filters('sensei_learners_lesson_learners', array('post_id' => $item->ID, 'type' => 'sensei_lesson_status', 'status' => 'any'))); $title = get_the_title($item); $a_title = sprintf(__('Edit “%s”'), $title); $grading_action = ''; if (get_post_meta($item->ID, '_quiz_has_questions', true)) { $grading_action = ' <a class="button" href="' . esc_url(add_query_arg(array('page' => 'sensei_grading', 'lesson_id' => $item->ID, 'course_id' => $this->course_id), admin_url('admin.php'))) . '">' . __('Grading', 'woothemes-sensei') . '</a>'; } $column_data = apply_filters('sensei_learners_main_column_data', array('title' => '<strong><a class="row-title" href="' . admin_url('post.php?action=edit&post=' . $item->ID) . '" title="' . esc_attr($a_title) . '">' . $title . '</a></strong>', 'num_learners' => $lesson_learners, 'updated' => $item->post_modified, 'actions' => '<a class="button" href="' . esc_url(add_query_arg(array('page' => $this->page_slug, 'lesson_id' => $item->ID, 'course_id' => $this->course_id, 'view' => 'learners'), admin_url('admin.php'))) . '">' . __('Manage learners', 'woothemes-sensei') . '</a> ' . $grading_action), $item, $this->course_id); break; case 'courses': default: $course_learners = WooThemes_Sensei_Utils::sensei_check_for_activity(apply_filters('sensei_learners_course_learners', array('post_id' => $item->ID, 'type' => 'sensei_course_status', 'status' => 'any'))); $title = get_the_title($item); $a_title = sprintf(__('Edit “%s”'), $title); $grading_action = ''; if (version_compare($wp_version, '4.1', '>=')) { $grading_action = ' <a class="button" href="' . esc_url(add_query_arg(array('page' => 'sensei_grading', 'course_id' => $item->ID), admin_url('admin.php'))) . '">' . __('Grading', 'woothemes-sensei') . '</a>'; } $column_data = apply_filters('sensei_learners_main_column_data', array('title' => '<strong><a class="row-title" href="' . admin_url('post.php?action=edit&post=' . $item->ID) . '" title="' . esc_attr($a_title) . '">' . $title . '</a></strong>', 'num_learners' => $course_learners, 'updated' => $item->post_modified, 'actions' => '<a class="button" href="' . esc_url(add_query_arg(array('page' => $this->page_slug, 'course_id' => $item->ID, 'view' => 'learners'), admin_url('admin.php'))) . '">' . __('Manage learners', 'woothemes-sensei') . '</a> ' . $grading_action), $item); break; } // switch return $column_data; }
/** * This hooks into 'customize_register' (available as of WP 3.4) and allows * you to add new sections and controls to the Theme Customize screen. * * Note: To enable instant preview, we have to actually write a bit of custom * javascript. See live_preview() for more. * * @see add_action('customize_register',$func) */ public static function register($wp_customize) { // Register new settings to the WP database... $wp_customize->add_setting('carpress[theme_clr]', array('default' => '#305088')); $wp_customize->add_setting('carpress[btn_clr]', array('default' => '#f68c24')); $wp_customize->add_setting('carpress[titlearea_txt_clr]', array('default' => '#ffffff')); $wp_customize->add_setting('carpress[bodytext_clr]', array('default' => '#727272')); $wp_customize->add_setting('carpress[navbar_clr]', array('default' => '#f6f6f6')); $wp_customize->add_setting('carpress[navbar_txt_clr]', array('default' => '#777777')); // $wp_customize->add_setting( 'carpress[footer_clr]', array( 'default' => '#333333' ) ); $wp_customize->add_setting('carpress[footer_txt_clr]', array('default' => '#ffffff')); $wp_customize->add_setting('carpress[boxed]', array('default' => 'no')); $wp_customize->add_setting('maps_front_page', array('default' => 'yes')); $wp_customize->add_setting('logo_img', array('default' => trailingslashit(get_template_directory_uri()) . 'assets/images/logo.png')); $wp_customize->add_setting('logo_img_retina', array('default' => 'yes')); $wp_customize->add_setting('carpress_charset_setting', array('default' => 'latin')); $wp_customize->add_setting('carpress[favicon]', array('default' => '%s/assets/images/favicon.png')); $wp_customize->add_setting('map_type', array('default' => 'ROADMAP')); $wp_customize->add_setting('map_style', array('default' => '[{"stylers":[{"hue":"#ff1a00"},{"invert_lightness":true},{"saturation":-100},{"lightness":33},{"gamma":0.5}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#2D333C"}]}]')); $wp_customize->add_setting('zoom_level', array('default' => 7)); if (is_woocommerce_active()) { $wp_customize->add_setting('carpress[products_per_page]', array('default' => '10')); } $wp_customize->add_setting('front_title', array('default' => 'Repairing cars since 1966')); $wp_customize->add_setting('front_txt', array('default' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facilis, quae, veritatis, tenetur atque doloremque corporis similique tempora suscipit ex error aperiam eius eos esse quaerat nesciunt quisquam sunt soluta!')); $wp_customize->add_setting('front_btn_txt', array('default' => 'Read More')); $wp_customize->add_setting('front_btn_link', array('default' => 'http://www.proteusthemes.com')); $wp_customize->add_setting('front_btn_blank', array('default' => 'no')); $wp_customize->add_setting('front_bg_pattern', array('default' => 'pattern-5')); $wp_customize->add_setting('front_bg_pattern_custom', array('default' => '')); $wp_customize->add_setting('front_carousel_interval', array('default' => '5000')); $wp_customize->add_setting('front_carousel_bg', array('default' => '#000000')); $wp_customize->add_setting('front_carousel_opacity', array('default' => '0.5')); $wp_customize->add_setting('tap_to_call_number', array('default' => '1800123456')); $wp_customize->add_setting('tap_to_call_text', array('default' => 'Tap here to call us (1800-12-34-56)')); $wp_customize->add_setting('tap_to_call_visibility', array('default' => 'mobile')); // footer pattern $wp_customize->add_setting('footer_pattern_img', array('default' => '')); // breadcrumbs visibility $wp_customize->add_setting('show_breadcrumbs', array('default' => 'yes')); // main navigation sticky or static $wp_customize->add_setting('navbar_position', array('default' => 'sticky')); // add custom sections $wp_customize->add_section('customizr_front_page', array('title' => _x('Front Page & Banners', 'backend', 'carpress_wp'), 'description' => _x('Settings for the home page and title area', 'backend', 'carpress_wp'), 'priority' => 30)); $wp_customize->add_section('customizr_images', array('title' => _x('Images', 'backend', 'carpress_wp'), 'description' => _x('Images for the Carpress theme', 'backend', 'carpress_wp'), 'priority' => 30)); $wp_customize->add_section('contact_page', array('title' => _x('Contact Page', 'backend', 'carpress_wp'), 'description' => _x('Settings for contact page', 'backend', 'carpress_wp'), 'priority' => 150)); $wp_customize->add_section('other', array('title' => _x('Other', 'backend', 'carpress_wp'), 'description' => _x('Other settings for the theme', 'backend', 'carpress_wp'), 'priority' => 160)); if (is_woocommerce_active()) { $wp_customize->add_section('shop_page', array('title' => _x('Shop', 'backend', 'carpress_wp'), 'description' => _x('Settings for shop', 'backend', 'carpress_wp'), 'priority' => 50)); } // Finally, we define the control itself (which links a setting to a section and renders the HTML controls)... $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'carpress_theme_clr', array('label' => _x('Main Theme Color', 'backend', 'carpress_wp'), 'section' => 'colors', 'priority' => 1, 'settings' => 'carpress[theme_clr]'))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'carpress_btn_clr', array('label' => _x('Buttons Color', 'backend', 'carpress_wp'), 'section' => 'colors', 'priority' => 2, 'settings' => 'carpress[btn_clr]'))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'carpress_bodytext_clr', array('label' => _x('Base Text Color', 'backend', 'carpress_wp'), 'section' => 'colors', 'priority' => 3, 'settings' => 'carpress[bodytext_clr]'))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'carpress_navbar_clr', array('label' => _x('Navbar Color', 'backend', 'carpress_wp'), 'section' => 'colors', 'priority' => 5, 'settings' => 'carpress[navbar_clr]'))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'carpress_navbar_txt_clr', array('label' => _x('Navbar Text Color', 'backend', 'carpress_wp'), 'section' => 'colors', 'priority' => 6, 'settings' => 'carpress[navbar_txt_clr]'))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'carpress_titlearea_txt_clr', array('label' => _x('Color for Titles on Subpages', 'backend', 'carpress_wp'), 'section' => 'colors', 'priority' => 11, 'settings' => 'carpress[titlearea_txt_clr]'))); // $wp_customize->add_control( new WP_Customize_Color_Control( // $wp_customize, // 'carpress_footer_clr', // array( // 'label' => __( 'Footer Color' ), // 'section' => 'colors', // 'settings' => 'carpress[footer_clr]', // 'priority' => 20, // ) // ) ); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'carpress_footer_txt_clr', array('label' => _x('Footer Text Color', 'backend', 'carpress_wp'), 'section' => 'colors', 'settings' => 'carpress[footer_txt_clr]', 'priority' => 21))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_boxed', array('label' => _x('Boxed or wide version?', 'backend', 'carpress_wp'), 'section' => 'background_image', 'settings' => 'carpress[boxed]', 'type' => 'radio', 'choices' => array('no' => _x('Wide', 'backend', 'carpress_wp'), 'yes' => _x('Boxed', 'backend', 'carpress_wp'))))); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'carpress_logo_img', array('label' => _x('Logo image (recommended dimensions: 195(w) x 70(h))', 'backend', 'carpress_wp'), 'section' => 'customizr_images', 'settings' => 'logo_img'))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_logo_img_retina', array('label' => _x('Force logo to be always 70px high', 'backend', 'carpress_wp'), 'section' => 'customizr_images', 'settings' => 'logo_img_retina', 'type' => 'select', 'choices' => array('yes' => _x('Yes', 'backend', 'carpress_wp'), 'no' => _x('No', 'backend', 'carpress_wp'))))); $wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize, 'carpress_favicon', array('label' => _x('Favicon image (16 x 16 px), format .ico', 'backend', 'carpress_wp'), 'section' => 'customizr_images', 'settings' => 'carpress[favicon]'))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_map_type', array('label' => _x('Type of Google Maps', 'backend', 'carpress_wp'), 'section' => 'contact_page', 'settings' => 'map_type', 'type' => 'radio', 'choices' => array('ROADMAP' => _x('Normal map', 'backend', 'carpress_wp'), 'SATELLITE' => _x('Satellite', 'backend', 'carpress_wp'), 'HYBRID' => _x('Hybrid', 'backend', 'carpress_wp'), 'TERRAIN' => _x('Terrain', 'backend', 'carpress_wp'))))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_map_style', array('label' => _x('Style of Google Maps', 'backend', 'carpress_wp'), 'section' => 'contact_page', 'settings' => 'map_style', 'type' => 'select', 'choices' => array('[]' => _x('Default', 'backend', 'carpress_wp'), '[{"stylers":[{"hue":"#ff1a00"},{"invert_lightness":true},{"saturation":-100},{"lightness":33},{"gamma":0.5}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#2D333C"}]}]' => _x('Lunar Landscape', 'backend', 'carpress_wp'), '[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#333739"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#2ecc71"}]},{"featureType":"poi","stylers":[{"color":"#2ecc71"},{"lightness":-7}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#2ecc71"},{"lightness":-28}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#2ecc71"},{"visibility":"on"},{"lightness":-15}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#2ecc71"},{"lightness":-18}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#2ecc71"},{"lightness":-34}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"visibility":"on"},{"color":"#333739"},{"weight":0.8}]},{"featureType":"poi.park","stylers":[{"color":"#2ecc71"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"color":"#333739"},{"weight":0.3},{"lightness":10}]}]' => _x('Snazzy Maps', 'backend', 'carpress_wp'), '[{"featureType":"water","stylers":[{"color":"#021019"}]},{"featureType":"landscape","stylers":[{"color":"#08304b"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#0c4152"},{"lightness":5}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#0b434f"},{"lightness":25}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"road.arterial","elementType":"geometry.stroke","stylers":[{"color":"#0b3d51"},{"lightness":16}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#000000"},{"lightness":13}]},{"featureType":"transit","stylers":[{"color":"#146474"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#144b53"},{"lightness":14},{"weight":1.4}]}]' => _x('Midnight Commander', 'backend', 'carpress_wp'), '[{"featureType":"water","elementType":"all","stylers":[{"hue":"#252525"},{"saturation":-100},{"lightness":-81},{"visibility":"on"}]},{"featureType":"landscape","elementType":"all","stylers":[{"hue":"#666666"},{"saturation":-100},{"lightness":-55},{"visibility":"on"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"hue":"#555555"},{"saturation":-100},{"lightness":-57},{"visibility":"on"}]},{"featureType":"road","elementType":"all","stylers":[{"hue":"#777777"},{"saturation":-100},{"lightness":-6},{"visibility":"on"}]},{"featureType":"administrative","elementType":"all","stylers":[{"hue":"#cc9900"},{"saturation":100},{"lightness":-22},{"visibility":"on"}]},{"featureType":"transit","elementType":"all","stylers":[{"hue":"#444444"},{"saturation":0},{"lightness":-64},{"visibility":"off"}]},{"featureType":"poi","elementType":"labels","stylers":[{"hue":"#555555"},{"saturation":-100},{"lightness":-57},{"visibility":"off"}]}]' => _x('Hints of Gold', 'backend', 'carpress_wp'))))); // helper function function zoom_levels() { $arr = array(); for ($i = 1; $i < 25; $i++) { $arr["{$i}"] = "{$i}"; } return $arr; } $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_map_zoom', array('label' => _x('Zoom of Google Maps (more is closer view)', 'backend', 'carpress_wp'), 'section' => 'contact_page', 'settings' => 'zoom_level', 'type' => 'select', 'choices' => zoom_levels()))); if (is_woocommerce_active()) { $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_products_per_page', array('label' => _x('Number of products per page', 'backend', 'carpress_wp'), 'section' => 'shop_page', 'settings' => 'carpress[products_per_page]', 'type' => 'text'))); } // customizr_front_page $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_front_title', array('label' => _x('Title for front page (without slider)', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'front_title', 'priority' => 10))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_front_txt', array('label' => _x('Text for front page (without slider)', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'front_txt', 'priority' => 20))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_front_btn_txt', array('label' => _x('Text for link button (without slider)', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'front_btn_txt', 'priority' => 30))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_front_btn_link', array('label' => _x('Link for button (without slider)', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'front_btn_link', 'priority' => 40))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_front_btn_blank', array('label' => _x('Open link in a new page (without slider)?', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'front_btn_blank', 'type' => 'select', 'priority' => 50, 'choices' => array('no' => _x('No', 'backend', 'carpress_wp'), 'yes' => _x('Yes', 'backend', 'carpress_wp'))))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_maps_front_page', array('label' => _x('Display Google Maps on the front page?', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'maps_front_page', 'type' => 'select', 'priority' => 60, 'choices' => array('yes' => _x('Yes', 'backend', 'carpress_wp'), 'no' => _x('No', 'backend', 'carpress_wp'))))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_front_bg_pattern', array('label' => _x('Pattern for the background (without slider)', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'front_bg_pattern', 'type' => 'select', 'priority' => 70, 'choices' => array('no' => _x('No background pattern', 'backend', 'carpress_wp'), 'pattern-1' => _x('Pattern 1', 'backend', 'carpress_wp'), 'pattern-2' => _x('Pattern 2', 'backend', 'carpress_wp'), 'pattern-3' => _x('Pattern 3', 'backend', 'carpress_wp'), 'pattern-4' => _x('Pattern 4', 'backend', 'carpress_wp'), 'pattern-5' => _x('Pattern 5', 'backend', 'carpress_wp'), 'pattern-6' => _x('Pattern 6', 'backend', 'carpress_wp'))))); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'carpress_front_bg_pattern_custom', array('label' => _x('Upload custom pattern for the background (without slider)', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'front_bg_pattern_custom', 'priority' => 80))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_front_carousel_interval', array('label' => _x('Slider interval (in miliseconds, 1s = 1000ms)', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'front_carousel_interval', 'priority' => 90))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'carpress_front_carousel_bg', array('label' => _x('Slider text background color', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'front_carousel_bg', 'priority' => 100))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_front_carousel_opacity', array('label' => _x('Slider text background color opacity', 'backend', 'carpress_wp'), 'section' => 'customizr_front_page', 'settings' => 'front_carousel_opacity', 'priority' => 110, 'type' => 'select', 'choices' => array('0.0' => '0.0', '0.1' => '0.1', '0.2' => '0.2', '0.3' => '0.3', '0.4' => '0.4', '0.5' => '0.5', '0.6' => '0.6', '0.7' => '0.7', '0.8' => '0.8', '0.9' => '0.9', '1.0' => '1.0')))); // other $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_charset_setting_control', array('label' => _x('Character set for Google Fonts', 'backend', 'carpress_wp'), 'section' => 'other', 'settings' => 'carpress_charset_setting', 'type' => 'select', 'choices' => array('latin' => 'Latin', 'latin-ext' => 'Latin Extended', 'cyrillic' => 'Cyrillic', 'cyrillic-ext' => 'Cyrillic Extended')))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_tap_to_call_number', array('label' => _x('Tap to call number (will be seen on mobile phones)', 'backend', 'carpress_wp'), 'section' => 'other', 'settings' => 'tap_to_call_number'))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_tap_to_call_text', array('label' => _x('Tap to call button text (will be seen on mobile phones)', 'backend', 'carpress_wp'), 'section' => 'other', 'settings' => 'tap_to_call_text'))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_tap_to_call_visibility', array('label' => _x('Show tap to call just on mobile or also on desktop?', 'backend', 'carpress_wp'), 'section' => 'other', 'settings' => 'tap_to_call_visibility', 'type' => 'select', 'choices' => array('mobile' => _x('Mobile', 'backend', 'carpress_wp'), 'everywhere' => _x('Everywhere', 'backend', 'carpress_wp'))))); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'carpress_footer_pattern_img', array('label' => _x('Pattern image for the footer', 'backend', 'carpress_wp'), 'section' => 'other', 'settings' => 'footer_pattern_img'))); $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_show_breadcrumbs', array('label' => _x('Show breadcrumbs?', 'backend', 'carpress_wp'), 'section' => 'other', 'settings' => 'show_breadcrumbs', 'type' => 'select', 'choices' => array('yes' => _x('Yes', 'backend', 'carpress_wp'), 'no' => _x('No', 'backend', 'carpress_wp'))))); // nav $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'carpress_navbar_position', array('label' => _x('Main navbar position', 'backend', 'carpress_wp'), 'section' => 'nav', 'settings' => 'navbar_position', 'type' => 'radio', 'choices' => array('sticky' => _x('Sticky', 'backend', 'carpress_wp'), 'static' => _x('Static', 'backend', 'carpress_wp'))))); }
/** * Called when WooCommerce is inactive to display an inactive notice. * * @since 1.2 */ public static function woocommerce_inactive_notice() { if (current_user_can('activate_plugins')) { if (!is_woocommerce_active()) { ?> <div id="message" class="error"> <p><?php printf(__('%sWooCommerce Subscriptions is inactive.%s The %sWooCommerce plugin%s must be active for WooCommerce Subscriptions to work. Please %sinstall & activate WooCommerce%s', 'woocommerce-subscriptions'), '<strong>', '</strong>', '<a href="http://wordpress.org/extend/plugins/woocommerce/">', '</a>', '<a href="' . admin_url('plugins.php') . '">', ' »</a>'); ?> </p> </div> <?php } elseif (version_compare(get_option('woocommerce_db_version'), '2.1', '<')) { ?> <div id="message" class="error"> <p><?php printf(__('%sWooCommerce Subscriptions is inactive.%s This version of Subscriptions requires WooCommerce 2.1 or newer. Please %supdate WooCommerce to version 2.1 or newer%s', 'woocommerce-subscriptions'), '<strong>', '</strong>', '<a href="' . admin_url('plugins.php') . '">', ' »</a>'); ?> </p> </div> <?php } ?> <?php } }
return; } /** * Required functions */ if (!function_exists('woothemes_queue_update')) { require_once 'woo-includes/woo-functions.php'; } /** * Plugin updates */ woothemes_queue_update(plugin_basename(__FILE__), '7ac9b00a1fe980fb61d28ab54d167d0d', '18680'); /** * Check WooCommerce exists */ if (!is_woocommerce_active()) { return; } if (!class_exists('WC_Product_CSV_Import_Suite')) { /** * Main CSV Import class */ class WC_Product_CSV_Import_Suite { /** * Constructor */ public function __construct() { define('WC_PCSVIS_FILE', __FILE__); add_action('init', array($this, 'load_plugin_textdomain'));
* You should have received a copy of the GNU General Public License * along with WooCommerce Stellar Gateway. If not, see <http://www.gnu.org/licenses/>. * * @package WooCommerce Stellar * @author Prospress * @category Core */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly. /** * Required functions */ require_once 'woo-includes/woo-functions.php'; if (!is_woocommerce_active() || version_compare(get_option('woocommerce_db_version'), '2.1', '<')) { add_action('admin_notices', 'WC_Stellar::woocommerce_missing_notice'); return; } if (!class_exists('WC_Stellar')) { /** * WooCommerce Stellar main class. * * @class Stellar * @version 1.0 */ final class WC_Stellar { /** * Instance of this class. *