本文整理汇总了PHP中is_shop_installed函数的典型用法代码示例。如果您正苦于以下问题:PHP is_shop_installed函数的具体用法?PHP is_shop_installed怎么用?PHP is_shop_installed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_shop_installed函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: yit_tab_settings_settings
/**
* Your Inspiration Themes
*
* @package WordPress
* @subpackage Your Inspiration Themes
* @author Your Inspiration Themes Team <info@yithemes.com>
*
* This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.gnu.org/licenses/gpl-3.0.txt
*/
function yit_tab_settings_settings( $items ) {
unset( $items[20], $items[21], $items[22] );
if( is_shop_installed() ) {
$items[40] = array(
'id' => 'product-seo-title',
'type' => 'text',
'name' => __( 'Products Title', 'yit' ),
'desc' => __( 'Type in the product title.', 'yit' ),
'std' => ''
);
$items[41] = array(
'id' => 'product-seo-keywords',
'type' => 'text',
'name' => __( 'Products Keywords', 'yit' ),
'desc' => __( 'Type in the product keywords.', 'yit' ),
'std' => ''
);
$items[42] = array(
'id' => 'product-seo-description',
'type' => 'text',
'name' => __( 'Products Description', 'yit' ),
'desc' => __( 'Type in the product description.', 'yit' ),
'std' => ''
);
}
return $items;
}
示例2: widget
function widget($args, $instance)
{
extract($args);
echo $before_widget;
$search_type = yit_get_option('search_type');
if (!is_shop_installed() && $search_type == 'product') {
$search_type = 'post';
}
?>
<form action="<?php
echo home_url('/');
?>
" method="get" class="search_mini">
<input type="text" name="s" id="search_mini" value="<?php
the_search_query();
?>
" placeholder="<?php
if (is_shop_installed()) {
_e('search for products', 'yit');
} else {
_e('search for...', 'yit');
}
?>
" />
<input type="hidden" name="post_type" value="<?php
echo $search_type;
?>
" />
<input type="submit" value="Search" id="mini-search-submit" />
</form>
<?php
echo $after_widget;
}
示例3: widget
/**
* widget function.
*
* @see WP_Widget
* @access public
* @param array $args
* @param array $instance
* @return void
*/
function widget($args, $instance)
{
global $woocommerce;
extract($args);
if (!is_shop_installed() || yit_get_option('shop-enable') == 'no') {
return;
}
?>
<div class="yit_cart_widget widget_shopping_cart">
<div class="cart_label">
<?php
list($cart_items, $cart_subtotal, $cart_icon, $cart_currency) = yit_get_current_cart_info();
?>
<a href="<?php
echo WC()->cart->get_cart_url();
?>
" class="cart-items" style="background: url(<?php
echo $cart_icon;
?>
) no-repeat center">
<span class="yit-mini-cart-icon">
<span class="cart-items-number"><?php
echo $cart_items;
?>
</span>
</span>
</a>
</div>
<div class="cart_wrapper" style="display:none">
<div class="widget_shopping_cart_content group">
<ul class="cart_list product_list_widget">
<li class="empty"><?php
_e('No products in the cart.', 'yit');
?>
</li>
</ul>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($){
"use strict";
$(document).on('mouseover', '.cart_label', function(){
$(this).next('.cart_wrapper').fadeIn(300);
}).on('mouseleave', '.cart_label', function(){
$(this).next('.cart_wrapper').fadeOut(300);
});
$(document)
.on('mouseenter', '.cart_wrapper', function(){ $(this).stop(true,true).show() })
.on('mouseleave', '.cart_wrapper', function(){ $(this).fadeOut(300) });
});
</script>
</div>
<?php
}
示例4: yit_unregister_widgets
/**
* Unregister widgets
*
*/
function yit_unregister_widgets($widgets)
{
$widgets = array_merge($widgets, array('WP_Widget_Recent_Comments', 'WP_Widget_Recent_Posts', 'last_post'));
if (!is_shop_installed()) {
$widgets[] = 'yit_featured_products';
}
return $widgets;
}
示例5: widget
/**
* widget function.
*
* @see WP_Widget
* @access public
* @param array $args
* @param array $instance
* @return void
*/
function widget($args, $instance)
{
global $woocommerce;
extract($args);
if (!is_shop_installed()) {
return;
}
?>
<div class="yit_cart_widget widget_shopping_cart">
<div class="cart_label">
<?php
list($cart_items, $cart_subtotal, $cart_currency) = yit_get_current_cart_info();
?>
<a href="<?php
echo $woocommerce->cart->get_cart_url();
?>
" class="cart-items">
<span class="cart-items-number"><?php
echo $cart_items;
?>
</span> <?php
echo $cart_items != 1 ? __('', 'yit') : __(' ', 'yit');
?>
</a>
</div>
<div class="cart_wrapper" style="display:none">
<div class="widget_shopping_cart_content group">
<ul class="cart_list product_list_widget">
<li class="empty"><?php
_e('Товары не добавлены', 'yit');
?>
</li>
</ul>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($){
$(document).on('mouseover', '.cart_label', function(){
$(this).next('.cart_wrapper').fadeIn(300);
}).on('mouseleave', '.cart_label', function(){
$(this).next('.cart_wrapper').fadeOut(300);
});
$(document)
.on('mouseenter', '.cart_wrapper', function(){ $(this).stop(true,true).show() })
.on('mouseleave', '.cart_wrapper', function(){ $(this).fadeOut(300) });
});
</script>
</div>
<?php
}
示例6: widget
function widget($args, $instance)
{
extract($args);
echo $before_widget;
$search_type = yit_get_option('search_type');
if (!is_shop_installed() && $search_type == 'product') {
$search_type = 'post';
}
?>
<a href="#" class="search_mini_button"></a>
<div class="search_mini_content">
<span class="dropdown_arrow"></span>
<?php
if (defined('YITH_WCAS')) {
?>
<?php
echo do_shortcode('[yith_woocommerce_ajax_search]');
?>
<?php
} else {
?>
<form action="<?php
echo home_url('/');
?>
" method="get" class="search_mini">
<input type="text" name="s" id="search_mini" value="<?php
the_search_query();
?>
" placeholder="<?php
if (is_shop_installed()) {
_e('search for products', 'yit');
} else {
_e('search for...', 'yit');
}
?>
" /><input type="submit" value="" id="mini-search-submit" />
<input type="hidden" name="post_type" value="<?php
echo $search_type;
?>
" />
</form>
<?php
}
?>
</div>
<?php
echo $after_widget;
}
示例7: widget
/**
* widget function.
*
* @see WP_Widget
* @access public
* @param array $args
* @param array $instance
* @return void
*/
function widget( $args, $instance ) {
global $woocommerce;
extract( $args );
$active = (bool) !( empty( $_REQUEST['add-to-cart'] ) || ! is_numeric( $_REQUEST['add-to-cart'] ) );
/* fix yith catalog mode */
$ywctm_hide_cart_page = false;
global $YITH_WC_Catalog_Mode;
if ( isset( $YITH_WC_Catalog_Mode ) ) {
$ywctm_hide_cart_page = method_exists( $YITH_WC_Catalog_Mode, 'check_hide_cart_checkout_pages' ) && $YITH_WC_Catalog_Mode->check_hide_cart_checkout_pages();
}
if( !is_shop_installed() || yit_get_option('shop-enable' ) == 'no' || ! function_exists('yit_get_current_cart_info') || $ywctm_hide_cart_page) return;
?>
<div class="yit_cart_widget widget_shopping_cart">
<div class="cart_label">
<?php list( $cart_items, $cart_icon, $cart_icon_dark ) = yit_get_current_cart_info(); ?>
<a href="<?php echo WC()->cart->get_cart_url(); ?>" class="cart-items" >
<span class="yit-mini-cart-icon" >
<span class="cart-items-number"><?php echo $cart_items ?></span>
</span>
<span class="yit-mini-cart-background no-dark" style="background-image: url(<?php echo $cart_icon ?>)"></span>
<span class="yit-mini-cart-background only-dark" style="background-image: url(<?php echo $cart_icon_dark ?>)"></span>
</a>
</div>
<div class="cart_wrapper <?php echo $active ? ' active' : ''; ?>" style="display:<?php echo $active ? 'block' : 'none'; ?>">
<div class="widget_shopping_cart_content group">
<?php if ( $active ) : ?>
<div class="blockUI blockOverlay" style="z-index: 1000; border: none; margin: 0px; padding: 0px; width: 100%; height: 100%; top: 0px; left: 0px; cursor: none; position: absolute; opacity: 1; background: url(<?php echo YIT_THEME_ASSETS_URL ?>/images/search.gif) 50% 50% no-repeat rgb(255, 255, 255);"></div>
<div class="blockUI blockMsg blockElement" style="z-index: 1011; display: none; position: absolute; left: 129px; top: 239px;"></div>
<?php else : ?>
<ul class="cart_list product_list_widget">
<li class="empty"><?php _e( 'No products in the cart.', 'yit' ); ?></li>
</ul>
<?php endif; ?>
</div>
</div>
</div>
<?php
}
示例8: widget
function widget($args, $instance)
{
extract($args);
echo $before_widget;
$search_for_product = apply_filters('yit_search_for_prod_label', __('search for products', 'yit'));
$search_for = apply_filters('yit_searc_for_prod_label', __('search for...', 'yit'));
$placeholder = is_shop_installed() ? $search_for_product : $search_for;
if (defined('YITH_WCAS')) {
?>
<?php
echo do_shortcode('[yith_woocommerce_ajax_search]');
?>
<?php
} else {
$search_type = yit_get_option('search_type');
if (!is_shop_installed() && $search_type == 'product') {
$search_type = 'post';
}
?>
<form action="<?php
echo home_url('/');
?>
" method="get" class="search_mini">
<input type="text" name="s" id="search_mini" value="<?php
the_search_query();
?>
" placeholder="<?php
echo $placeholder;
?>
" />
<input type="hidden" name="post_type" value="<?php
echo $search_type;
?>
" />
<input type="submit" value="<?php
_e('Search', 'yit');
?>
" id="mini-search-submit" />
</form>
<?php
}
echo $after_widget;
}
示例9: esc_attr
echo esc_attr(yit_curPageURL());
?>
"/>
<?php
if ($do_ajax == 1) {
?>
<input type="hidden" name="yit_ajax" class="yit_ajax" value="<?php
echo esc_attr($do_ajax);
?>
"
data-action="yit_contact_form_submit"/>
<?php
}
?>
<?php
if (function_exists('WC') && is_shop_installed() && is_product()) {
?>
<input type="hidden" name="yit_contact[sku]" value="<?php
echo $GLOBALS['product']->sku;
?>
"/>
<input type="hidden" name="yit_contact[product_id]" value="<?php
echo $GLOBALS['product']->id;
?>
"/>
<?php
}
?>
<input type="hidden" name="id_form" value="<?php
echo $post_id;
?>
示例10: yit_tab_sidebars_sidebars_manager_shop_sidebar
/**
* Add specific fields to the tab General -> Settings
*
* @param array $fields
* @return array
*/
function yit_tab_sidebars_sidebars_manager_shop_sidebar($fields)
{
if (!is_shop_installed()) {
return $fields;
}
$fields[25] = array('id' => 'shop-sidebar', 'type' => 'customsidebar', 'name' => __('Shop Sidebar', 'yit'), 'desc' => __('Choose if you want to show a sidebar in Shop pages and where.', 'yit'), 'std' => apply_filters('yit_shop-sidebar_std', array('layout' => 'sidebar-left', 'sidebar' => 'Shop Sidebar')), 'deps' => array('ids' => 'enable-all-custom-sidebar', 'values' => 0));
$fields[26] = array('id' => 'single-shop-sidebar', 'type' => 'customsidebar', 'name' => __('Products Detail Sidebar', 'yit'), 'desc' => __('Choose if you want to show a sidebar in products detail pages and where.', 'yit'), 'std' => apply_filters('yit_single-shop-sidebar_std', array('layout' => 'sidebar-no', 'sidebar' => 'Shop Sidebar')), 'deps' => array('ids' => 'enable-all-custom-sidebar', 'values' => 0));
return $fields;
}
示例11: wp_reset_query
}
}
//$sitemap['posts'] .= '</div>';
wp_reset_query();
}
//get archives
if (in_array('archives', $order)) {
//$sitemap['archives'] = '<div class="sitemap-archives-container span3">';
$sitemap['archives'] = '<h3>' . yit_get_option('sitemap-archive-title') . '</h3>';
$sitemap['archives'] .= '<ul>';
$sitemap['archives'] .= wp_get_archives(array('type' => yit_get_option('sitemap-archive-type'), 'limit' => yit_get_option('sitemap-archive-limit') == -1 ? '' : yit_get_option('sitemap-archive-limit'), 'show_post_count' => yit_get_option('sitemap-archive-show_post_count'), 'echo' => 0));
$sitemap['archives'] .= '</ul>';
//$sitemap['archives'] .= '</div>';
}
//get products
if (in_array('products', $order) && is_shop_installed()) {
$categories = get_terms('product_cat', array('hide_empty' => 0));
//$sitemap['products'] = '<div class="sitemap-products-container span3">';
$sitemap['products'] = '<h3>' . yit_get_option('sitemap-products-title') . '</h3>';
foreach ($categories as $category) {
//get posts in category
$args = array('post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => yit_get_option('sitemap-products-number'), 'meta_query' => array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN')), 'tax_query' => array(array('taxonomy' => 'product_cat', 'terms' => array(esc_attr($category->slug)), 'field' => 'slug', 'operator' => 'IN')));
$products = new WP_Query($args);
if (count($products->posts) > 0) {
$category_link = get_term_link($category, 'product_cat');
$sitemap['products'] .= '<h5><a href="' . $category_link . '">' . $category->name . '</a></h5>';
$sitemap['products'] .= '<ul class="cat_' . $category->term_id . ' cat">';
foreach ($products->posts as $post) {
$sitemap['products'] .= '<li><a href="' . get_permalink($post->ID) . '" title="' . sprintf(esc_attr__('Permalink to %s', 'yit'), the_title_attribute('echo=0')) . '" rel="bookmark">' . get_the_title($post->ID) . '</a></li>';
}
if (yit_get_option('sitemap-products-number') != -1) {
示例12: yit_setup_theme
/**
* Set up all theme data.
*
* @return void
* @since 1.0.0
*/
function yit_setup_theme()
{
/**
* Set up the content width value based on the theme's design.
*
* @see yit_content_width()
*
* @since Twenty Fourteen 1.0
*/
if (!isset($GLOBALS['content_width'])) {
$GLOBALS['content_width'] = apply_filters('yit-container-width-std', 1170);
}
//This theme have a CSS file for the editor TinyMCE
add_editor_style('css/editor-style.css');
//This theme support post thumbnails
add_theme_support('post-thumbnails');
//This theme uses the menus
add_theme_support('menus');
//Add default posts and comments RSS feed links to head
add_theme_support('automatic-feed-links');
//This theme support post formats
add_theme_support('post-formats', apply_filters('yit_post_formats_support', array('gallery', 'audio', 'video', 'quote')));
if (!defined('HEADER_TEXTCOLOR')) {
define('HEADER_TEXTCOLOR', '');
}
// The height and width of your custom header. You can hook into the theme's own filters to change these values.
// Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values.
define('HEADER_IMAGE_WIDTH', apply_filters('yiw_header_image_width', 1170));
define('HEADER_IMAGE_HEIGHT', apply_filters('yiw_header_image_height', 410));
// Don't support text inside the header image.
if (!defined('NO_HEADER_TEXT')) {
define('NO_HEADER_TEXT', true);
}
//This theme support custom header
add_theme_support('custom-header');
//This theme support custom backgrounds
add_theme_support('custom-backgrounds');
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list'));
// We'll be using post thumbnails for custom header images on posts and pages.
// We want them to be 940 pixels wide by 198 pixels tall.
// Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
// set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
$image_sizes = array('blog_small' => array(368, 266, true), 'blog_single_small' => array(1140, 491, true), 'blog_masonry' => array(380, 999), 'blog_big' => array(1140, 265, true), 'blog_single_big' => array(1920, 443, true), 'blog_thumb' => array(49, 49, true), 'blog_section' => array(269, 122, true), 'blog_section_mobile' => array(716, 325, true), 'portfolio_filterable' => array(360, 392, true), 'portfolio_section' => array(380, 414, true), 'portfolio_pinterest' => 360, 'portfolio_single_big' => array(1920, 596, true), 'portfolio_single_small' => array(680, 494, true), 'portfolio_single_big_placeholder' => array(1920, 362, true), 'thumb-testimonial' => array(255, 255, true));
$image_sizes = apply_filters('yit_add_image_size', $image_sizes);
foreach ($image_sizes as $id_size => $size) {
add_image_size($id_size, apply_filters('yit_' . $id_size . '_width', $size[0]), apply_filters('yit_' . $id_size . '_height', $size[1]), isset($size[2]) ? $size[2] : false);
}
//Set localization and load language file
$locale = get_locale();
$locale_file = YIT_THEME_PATH . "/languages/{$locale}.php";
if (is_readable($locale_file)) {
require_once $locale_file;
}
//remove wpml stylesheet
define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true);
if (!defined('WPLANG')) {
define('WPLANG', '');
}
if (WPLANG != '') {
load_theme_textdomain('yit', dirname(locate_template('/languages/' . WPLANG . '.mo')));
} else {
load_theme_textdomain('yit', get_template_directory() . '/languages');
}
// Add support to woocommerce
if (defined('YIT_IS_SHOP') && YIT_IS_SHOP) {
add_theme_support('woocommerce');
}
//Register menus
register_nav_menus(array('nav' => __('Main Navigation', 'yit'), 'mobile-nav' => __('Mobile Navigation', 'yit'), 'welcome-menu' => __('Welcome Menu', 'yit'), 'copyright_right' => __('Copyright Right', 'yit'), 'copyright_left' => __('Copyright Left', 'yit'), 'copyright_centered' => __('Copyright Centered', 'yit')));
//create the menu items if they don't exist
$menuname = 'Welcome Menu';
if (!wp_get_nav_menu_object($menuname)) {
if (is_shop_installed()) {
$my_account_id = get_option('woocommerce_myaccount_page_id');
if ($my_account_id) {
/* Assing my-account.php template to my-account page */
update_post_meta($my_account_id, '_wp_page_template', 'my-account.php');
$menu_id = wp_create_nav_menu($menuname);
$my_account_url = get_permalink(wc_get_page_id('myaccount'));
wp_update_nav_menu_item($menu_id, 0, array('menu-item-title' => __('My Account', 'yit'), 'menu-item-object' => 'page', 'menu-item-object-id' => get_option('woocommerce_myaccount_page_id'), 'menu-item-type' => 'post_type', 'menu-item-status' => 'publish'));
wp_update_nav_menu_item($menu_id, 0, array('menu-item-title' => __('My Orders', 'yit'), 'menu-item-classes' => 'view-order', 'menu-item-url' => wc_get_endpoint_url('view-order', '', $my_account_url), 'menu-item-status' => 'publish'));
if (!defined('YITH_WCWL')) {
wp_update_nav_menu_item($menu_id, 0, array('menu-item-title' => __('My Wishlist', 'yit'), 'menu-item-classes' => 'wishlist', 'menu-item-url' => wc_get_endpoint_url('wishlist', '', $my_account_url), 'menu-item-status' => 'publish'));
}
wp_update_nav_menu_item($menu_id, 0, array('menu-item-title' => __('Edit Address', 'yit'), 'menu-item-classes' => 'edit-address', 'menu-item-url' => wc_get_endpoint_url('edit-address', '', $my_account_url), 'menu-item-status' => 'publish'));
wp_update_nav_menu_item($menu_id, 0, array('menu-item-title' => __('Edit Account', 'yit'), 'menu-item-classes' => 'edit-account', 'menu-item-url' => wc_get_endpoint_url('edit-account', '', $my_account_url), 'menu-item-status' => 'publish'));
wp_update_nav_menu_item($menu_id, 0, array('menu-item-title' => __('Logout', 'yit'), 'menu-item-classes' => 'customer-logout', 'menu-item-url' => wc_get_endpoint_url('customer-logout', '', $my_account_url), 'menu-item-status' => 'publish'));
if (!has_nav_menu('welcome-menu')) {
$locations = get_theme_mod('nav_menu_locations');
$locations['welcome-menu'] = $menu_id;
//.........这里部分代码省略.........
示例13: yit_get_welcome_user_name
function yit_get_welcome_user_name($current_user)
{
// if firstname and last name are both not setted
if (!$current_user->user_firstname && !$current_user->user_lastname) {
if (is_shop_installed()) {
$firstname_billing = get_user_meta($current_user->ID, "billing_first_name", true);
$lastname_billing = get_user_meta($current_user->ID, "billing_last_name", true);
// if firstname and last name in billing options are both not setted
if (!$firstname_billing && !$lastname_billing) {
$user_name = $current_user->user_nicename;
} else {
$user_name = $firstname_billing . ' ' . $lastname_billing;
}
} else {
$user_name = $current_user->user_nicename;
}
} else {
$user_name = $current_user->user_firstname . ' ' . $current_user->user_lastname;
}
if ($user_name == ' ') {
$user_name = $current_user->user_login;
}
return $user_name;
}
示例14: yit_post_id
/**
* Retrieve the post id
*
* @return integer
* @since 1.0.0
*/
function yit_post_id()
{
global $post;
$post_id = 0;
if (is_posts_page()) {
$post_id = get_option('page_for_posts');
} elseif (is_shop_installed() && (is_shop() || is_product_category() || is_product_tag() || is_product_attribute())) {
$post_id = woocommerce_get_page_id('shop');
} elseif (isset($post->ID)) {
$post_id = $post->ID;
}
return $post_id;
}
示例15: yit_add_option_metabox
yit_add_option_metabox( 'yit-page-settings', __( 'SEO', 'yit' ), '_seo-keywords', 'text', $options );
yit_add_option_metabox( 'yit-post-settings', __( 'SEO', 'yit' ), '_seo-keywords', 'text', $options );
if( is_shop_installed() ) {
yit_add_option_metabox( 'yit-custom-product-settings', __( 'SEO', 'yit' ), '_seo-keywords', 'text', $options );
}
yit_metaboxes_sep( 'yit-page-settings', __( 'SEO', 'yit' ) );
$options = array(
'title' => __( 'Description', 'yit' ),
'desc' => __( 'Description for this page.', 'yit' ),
);
yit_add_option_metabox( 'yit-page-settings', __( 'SEO', 'yit' ), '_seo-description', 'text', $options );
yit_add_option_metabox( 'yit-post-settings', __( 'SEO', 'yit' ), '_seo-description', 'text', $options );
if( is_shop_installed() ) {
yit_add_option_metabox( 'yit-custom-product-settings', __( 'SEO', 'yit' ), '_seo-description', 'text', $options );
}
yit_metaboxes_sep( 'yit-page-settings', __( 'SEO', 'yit' ) );
/**
* HEADER TAB
*/
$options = array(
'title' => __( 'Slider', 'yit' ),
'options' => array( '' => __( 'Default', 'yit' ), 'none' => __( 'None', 'yit' ) ) + yit_get_sliders(),
'desc' => __( 'Select the slider that you want to use in the page.', 'yit' ),
);
yit_add_option_metabox( 'yit-page-settings', __( 'Header', 'yit' ), '_slider_name', 'select', $options );
yit_metaboxes_sep( 'yit-page-settings', __( 'Header', 'yit' ) );