本文整理汇总了PHP中is_woocommerce_active函数的典型用法代码示例。如果您正苦于以下问题:PHP is_woocommerce_active函数的具体用法?PHP is_woocommerce_active怎么用?PHP is_woocommerce_active使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_woocommerce_active函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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'));
}
}
开发者ID:Qualitair,项目名称:ecommerce,代码行数:11,代码来源:woocommerce-xero.php
示例2: ux_woocommerce_version_check
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;
}
开发者ID:allurewebsolutions,项目名称:wordpress-starter-kit,代码行数:10,代码来源:global.php
示例3: rtwoo_gitlab_woo_check
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;
}
}
开发者ID:rtCamp,项目名称:integrate-woocommerce-gitlab,代码行数:11,代码来源:index.php
示例4: __construct
/**
* 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;
}
开发者ID:wir,项目名称:woocommerce-geolocation-based-products,代码行数:25,代码来源:woocommerce-geolocation-based-products.php
示例5: add_my_sidebars
/**
* 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>'));
}
开发者ID:virendrayadav,项目名称:mutare,代码行数:47,代码来源:register-sidebars.php
示例6: __construct
/**
* 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;
}
开发者ID:NerdyDillinger,项目名称:ovrride,代码行数:23,代码来源:woocommerce-gateway-paypal-pro.php
示例7: __construct
/**
* 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'));
}
}
开发者ID:jfitzsimmons,项目名称:soundtrackforspace,代码行数:27,代码来源:woocommerce-gateway-paypal-pro.php
示例8: woothemes_queue_update
* @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.
*
开发者ID:keshvenderg,项目名称:cloudshop,代码行数:31,代码来源:customer-csv-import.php
示例9: init_hooks
/**
* 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'));
}
}
开发者ID:lilweirdward,项目名称:blofishwordpress,代码行数:22,代码来源:woocommerce-square.php
示例10: remove_user_from_post
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);
}
开发者ID:RiaanKnoetze,项目名称:sensei,代码行数:42,代码来源:class-woothemes-sensei-learners.php
示例11: woocommerce_inactive_notice
/**
* 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
}
}
开发者ID:slavic18,项目名称:cats,代码行数:33,代码来源:woocommerce-subscriptions.php
示例12: bloginfo
" 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>
开发者ID:bogdandobritoiu,项目名称:aripi,代码行数:31,代码来源:header.php
示例13: useWoo
function useWoo()
{
$ret = is_woocommerce_active() && $this->options['use_woo'] == 'on' ? true : false;
return $ret;
}
开发者ID:laiello,项目名称:suitex,代码行数:5,代码来源:loginx_functions.php
示例14: ot_get_option
<?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');
开发者ID:virendrayadav,项目名称:mutare,代码行数:31,代码来源:titlearea.php
示例15: init_advanced_notifications
/**
* init_advanced_notifications function.
*
* @access public
* @return void
*/
function init_advanced_notifications()
{
if (is_woocommerce_active()) {
include_once 'classes/class-wc-advanced-notifications.php';
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:12,代码来源:advanced-notifications.php
示例16: get_row_data
/**
* 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;
}
开发者ID:RiaanKnoetze,项目名称:sensei,代码行数:82,代码来源:class-woothemes-sensei-learners-main.php
示例17: register
/**
* 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&quo
|
请发表评论