本文整理汇总了PHP中woo_get_dynamic_values函数的典型用法代码示例。如果您正苦于以下问题:PHP woo_get_dynamic_values函数的具体用法?PHP woo_get_dynamic_values怎么用?PHP woo_get_dynamic_values使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了woo_get_dynamic_values函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: woo_projects_maybe_remove_description
/**
* Old Portfolio Layout
* @since 1.0.0
* @return void
*/
function woo_projects_maybe_remove_description()
{
$settings = woo_get_dynamic_values(array('projects_old_look' => 'false'));
if ('false' == $settings['projects_old_look']) {
return;
}
remove_action('projects_after_loop_item', 'projects_template_short_description', 10);
}
示例2: woo_load_featured_slider_js
function woo_load_featured_slider_js()
{
if (is_home()) {
//Slider settings
$settings = array('featured_speed' => '7', 'featured_hover' => 'true', 'featured_action' => 'true', 'featured_touchswipe' => 'true', 'featured_animation_speed' => '0.6', 'featured_pagination' => 'false', 'featured_nextprev' => 'true', 'featured_animation' => 'fade');
$settings = woo_get_dynamic_values($settings);
if ($settings['featured_speed'] == '0') {
$slideshow = 'false';
} else {
$slideshow = 'true';
}
if ($settings['featured_touchswipe']) {
$touchSwipe = 'true';
} else {
$touchSwipe = 'false';
}
if ($settings['featured_hover']) {
$pauseOnHover = 'true';
} else {
$pauseOnHover = 'false';
}
if ($settings['featured_action']) {
$pauseOnAction = 'true';
} else {
$pauseOnAction = 'false';
}
if (!in_array($settings['featured_animation'], array('fade', 'slide'))) {
$settings['featured_animation'] = 'fade';
}
$slideshowSpeed = (int) $settings['featured_speed'] * 1000;
// milliseconds
$animationDuration = (int) $settings['featured_animation_speed'] * 1000;
// milliseconds
$nextprev = $settings['featured_nextprev'];
$manualControls = '';
if ($settings['featured_pagination'] == 'true') {
$pagination = 'true';
} else {
$pagination = 'false';
}
if ($settings['featured_animation'] == 'slide') {
$smoothHeight = 'true';
} else {
$smoothHeight = 'false';
}
$data = array('animation' => $settings['featured_animation'], 'controlsContainer' => '.controls-container', 'smoothHeight' => $smoothHeight, 'directionNav' => $nextprev, 'controlNav' => $pagination, 'manualControls' => $manualControls, 'slideshow' => $slideshow, 'pauseOnHover' => $pauseOnHover, 'slideshowSpeed' => $slideshowSpeed, 'animationDuration' => $animationDuration, 'touch' => $touchSwipe, 'pauseOnHover' => $pauseOnHover, 'pauseOnAction' => $pauseOnAction);
wp_localize_script('featured-slider', 'woo_localized_data', $data);
wp_enqueue_script('featured-slider');
}
// End woo_load_featured_slider_js()
}
示例3: wooframework_loop_columns
function wooframework_loop_columns()
{
$settings = woo_get_dynamic_values(array('homepage_featured_products_columns' => 3));
if (is_archive() && !is_home()) {
global $woo_options;
if (!isset($woo_options['woocommerce_product_columns'])) {
$cols = 3;
} else {
$cols = $woo_options['woocommerce_product_columns'];
}
}
if (is_home() || is_front_page()) {
$cols = $settings['homepage_featured_products_columns'];
}
return intval($cols);
}
示例4: woo_featured_slider_loader
function woo_featured_slider_loader()
{
$settings = woo_get_dynamic_values(array('featured' => 'true'));
if (is_home() && $settings['featured'] == 'true') {
get_template_part('includes/featured', 'slider');
}
}
示例5: woo_top_ad
function woo_top_ad()
{
$settings = woo_get_dynamic_values(array('ad_top' => 'false', 'ad_top_adsense' => '', 'ad_top_image' => '', 'ad_top_url' => ''));
if ('true' == $settings['ad_top']) {
?>
<div id="topad">
<?php
if ('' != $settings['ad_top_adsense']) {
echo stripslashes($settings['ad_top_adsense']);
} else {
if ('' != $settings['ad_top_url'] && '' != $settings['ad_top_image']) {
$top_ad_image = $settings['ad_top_image'];
if (is_ssl()) {
$top_ad_image = str_replace('http://', 'https://', $top_ad_image);
}
?>
<a href="<?php
echo esc_url($settings['ad_top_url']);
?>
"><img src="<?php
echo esc_url($top_ad_image);
?>
" /></a>
<?php
}
}
?>
</div><!-- /#topad -->
<?php
}
}
示例6: woo_modify_magazine_homepage_query
function woo_modify_magazine_homepage_query($q)
{
if (!is_admin() && $q->is_main_query() && 0 < $q->query_vars['page_id'] && $q->query_vars['page_id'] == get_option('page_on_front') && 'template-magazine.php' == get_post_meta(intval($q->query_vars['page_id']), '_wp_page_template', true)) {
$settings = woo_get_dynamic_values(array('magazine_limit' => get_option('posts_per_page')));
$q->set('posts_per_page', intval($settings['magazine_limit']));
$q->set('paged', intval($q->query_vars['page']));
$q->parse_query();
}
return $q;
}
示例7: woo_subscribe_connect
function woo_subscribe_connect($widget = 'false', $title = '', $form = '', $social = '')
{
//Setup default variables, overriding them if the "Theme Options" have been saved.
$settings = array('connect' => 'false', 'connect_title' => __('Subscribe', 'woothemes'), 'connect_related' => 'true', 'connect_content' => __('Subscribe to our e-mail newsletter to receive updates.', 'woothemes'), 'connect_newsletter_id' => '', 'connect_mailchimp_list_url' => '', 'feed_url' => '', 'connect_rss' => '', 'connect_twitter' => '', 'connect_facebook' => '', 'connect_youtube' => '', 'connect_flickr' => '', 'connect_linkedin' => '', 'connect_delicious' => '', 'connect_rss' => '', 'connect_googleplus' => '', 'connect_dribbble' => '', 'connect_instagram' => '', 'connect_vimeo' => '', 'connect_pinterest' => '');
$settings = woo_get_dynamic_values($settings);
// Setup title
if ($widget != 'true') {
$title = $settings['connect_title'];
}
// Setup related post (not in widget)
$related_posts = '';
if ($settings['connect_related'] == "true" and $widget != "true") {
$related_posts = do_shortcode('[related_posts limit="5"]');
}
?>
<?php
if ($settings['connect'] == "true" or $widget == 'true') {
?>
<aside id="connect">
<h3><?php
if ($title) {
echo stripslashes($title);
} else {
_e('Subscribe', 'woothemes');
}
?>
</h3>
<div <?php
if ($related_posts != '') {
echo 'class="col-left"';
}
?>
>
<p><?php
if ($settings['connect_content'] != '') {
echo stripslashes($settings['connect_content']);
} else {
_e('Subscribe to our e-mail newsletter to receive updates.', 'woothemes');
}
?>
</p>
<?php
if ($settings['connect_newsletter_id'] != "" and $form != 'on') {
?>
<form class="newsletter-form<?php
if ($related_posts == '') {
echo ' fl';
}
?>
" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=<?php
echo $settings['connect_newsletter_id'];
?>
', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
<input class="email" type="text" name="email" value="<?php
_e('E-mail', 'woothemes');
?>
" onfocus="if (this.value == '<?php
_e('E-mail', 'woothemes');
?>
') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php
_e('E-mail', 'woothemes');
?>
';}" />
<input type="hidden" value="<?php
echo $settings['connect_newsletter_id'];
?>
" name="uri"/>
<input type="hidden" value="<?php
echo esc_attr(get_bloginfo('name'));
?>
" name="title"/>
<input type="hidden" name="loc" value="en_US"/>
<input class="submit button" type="submit" name="submit" value="<?php
_e('Submit', 'woothemes');
?>
" />
</form>
<?php
}
?>
<?php
if ($settings['connect_mailchimp_list_url'] != "" and $form != 'on' and $settings['connect_newsletter_id'] == "") {
?>
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup">
<form class="newsletter-form<?php
if ($related_posts == '') {
echo ' fl';
}
?>
" action="<?php
echo $settings['connect_mailchimp_list_url'];
?>
" method="post" target="popupwindow" onsubmit="window.open('<?php
echo $settings['connect_mailchimp_list_url'];
?>
', 'popupwindow', 'scrollbars=yes,width=650,height=520');return true">
//.........这里部分代码省略.........
示例8: woo_add_nav_cart_link
/**
* Optionally display a header cart link next to the navigation menu.
* @since 5.1.0
* @return void
*/
function woo_add_nav_cart_link()
{
global $woocommerce;
$settings = array('header_cart_link' => 'false', 'nav_rss' => 'false');
$settings = woo_get_dynamic_values($settings);
$class = 'nav cart fr';
if ('false' == $settings['nav_rss']) {
$class .= ' no-rss-link';
}
if (is_woocommerce_activated() && 'true' == $settings['header_cart_link']) {
?>
<ul class="<?php
echo esc_attr($class);
?>
">
<li><a class="cart-contents" href="<?php
echo esc_url($woocommerce->cart->get_cart_url());
?>
" title="<?php
esc_attr_e('View your shopping cart', 'woothemes');
?>
"><?php
echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);
?>
- <?php
echo $woocommerce->cart->get_cart_total();
?>
</a></li>
</ul>
<?php
}
}
示例9: woo_add_widget_heading
function woo_add_widget_heading($args)
{
$settings = woo_get_dynamic_values(array('homepage_features_area_heading' => '', 'homepage_testimonials_area_heading' => ''));
switch (current_filter()) {
case 'woothemes_features_args':
if (!woo_is_widget_in_sidebar('woothemes_features', 'homepage') || !is_home()) {
return $args;
}
if ('' != $settings['homepage_features_area_heading']) {
$args['before_title'] = '<span class="heading">' . esc_html($settings['homepage_features_area_heading']) . '</span>' . $args['before_title'];
}
break;
case 'woothemes_testimonials_args':
if (!woo_is_widget_in_sidebar('woothemes_testimonials', 'homepage') || !is_home()) {
return $args;
}
if ('' != $settings['homepage_testimonials_area_heading']) {
$args['before_title'] = '<span class="heading">' . esc_html($settings['homepage_testimonials_area_heading']) . '</span>' . $args['before_title'];
}
break;
default:
break;
}
return $args;
}
示例10: woo_logo
function woo_logo()
{
$settings = woo_get_dynamic_values(array('logo' => ''));
// Setup the tag to be used for the header area (`h1` on the front page and `span` on all others).
$heading_tag = 'span';
if (is_home() || is_front_page()) {
$heading_tag = 'h1';
}
// Get our website's name, description and URL. We use them several times below so lets get them once.
$site_title = get_bloginfo('name');
$site_url = home_url('/');
$site_description = get_bloginfo('description');
?>
<div id="logo">
<?php
// Website heading/logo and description text.
if ('' != $settings['logo']) {
$logo_url = $settings['logo'];
if (is_ssl()) {
$logo_url = str_replace('http://', 'https://', $logo_url);
}
echo '<a href="' . esc_url($site_url) . '" title="' . esc_attr($site_description) . '"><img src="' . esc_url($logo_url) . '" alt="' . esc_attr($site_title) . '" /></a>' . "\n";
}
// End IF Statement
echo '<' . $heading_tag . ' class="site-title"><a href="' . esc_url($site_url) . '">' . $site_title . '</a></' . $heading_tag . '>' . "\n";
if ($site_description) {
echo '<span class="site-description">' . $site_description . '</span>' . "\n";
}
?>
</div>
<?php
}
示例11: woocommerce_header_add_to_cart_fragment
function woocommerce_header_add_to_cart_fragment($fragments)
{
global $woocommerce;
$settings = array('header_cart_link' => 'false', 'nav_rss' => 'false', 'header_cart_total' => 'false');
$settings = woo_get_dynamic_values($settings);
ob_start();
?>
<a class="cart-contents" href="<?php
echo esc_url($woocommerce->cart->get_cart_url());
?>
" title="<?php
_e('View your shopping cart', 'woothemes');
?>
">
<?php
if ($settings['header_cart_total'] == 'true') {
echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);
?>
- <?php
echo $woocommerce->cart->get_cart_total();
}
?>
</a>
<?php
$fragments['a.cart-contents'] = ob_get_clean();
return $fragments;
}
示例12: woo_wooslider_business
/**
* Business Slider
* @since 5.6.0
* @return void
*/
function woo_wooslider_business()
{
global $post;
// Set default values
$settings = array('slider_biz_number' => '5', 'slider_biz_title' => 'true', 'slider_biz_slide_group' => '', 'slider_biz_order' => 'DESC', 'slider_biz_overlay' => 'bottom');
// Get slider global settings
$global_settings = woo_slider_get_global_settings();
// Merge global & slider specific options
$settings = array_merge($settings, $global_settings);
// Compare default values against Theme Options
$settings = woo_get_dynamic_values($settings);
// Translate options into something WooSlider can read
$slider_settings = apply_filters('woo_slider_business_template_settings', array('slider_type' => 'slides', 'smoothheight' => 'true', 'direction_nav' => 'true', 'control_nav' => $settings['slider_pagination'], 'pause_on_hover' => $settings['slider_hover'], 'slider_animation' => $settings['slider_effect'], 'autoslide' => $settings['slider_auto'], 'slideshow_speed' => $settings['slider_interval'], 'animation_duration' => $settings['slider_speed']));
// Setup the "Slide Group", if one is set.
$slide_page = '';
$slide_page_obj = get_term($settings['slider_biz_slide_group'], 'slide-page');
if (is_object($slide_page_obj)) {
if (isset($slide_page_obj->slug)) {
$slide_page = $slide_page_obj->slug;
}
}
// Get "Slide Group" from Page
if (isset($post->ID)) {
$stored_slide_page = get_post_meta($post->ID, '_slide-page', true);
if ('0' == $stored_slide_page) {
$slide_page = '';
}
if ('' != $stored_slide_page && '0' != $stored_slide_page) {
$slide_page_obj = get_term($stored_slide_page, 'slide-page');
if (is_object($slide_page_obj)) {
if (isset($slide_page_obj->slug)) {
$slide_page = $slide_page_obj->slug;
}
}
}
}
$slides_args = apply_filters('woo_slider_business_template_args', array('slide_page' => $slide_page, 'display_title' => $settings['slider_biz_title'], 'limit' => $settings['slider_biz_number'], 'layout' => 'text-' . $settings['slider_biz_overlay'], 'order' => $settings['slider_biz_order'], 'imageslide' => 'true', 'link_slide' => 'true', 'theme' => 'business'));
// Fire WooSlider.
wooslider($slider_settings, $slides_args);
}
示例13: woo_projects_category_nav
function woo_projects_category_nav()
{
$settings = woo_get_dynamic_values(array('projects_old_look' => 'false'));
if ('false' == $settings['projects_old_look']) {
return;
}
?>
<div class="projects-category-nav">
<?php
$args = array('hide_empty=0');
$terms = get_terms('project-category', $args);
if (!empty($terms) && !is_wp_error($terms)) {
$count = count($terms);
$term_list .= '<span class="select-category">' . __('Select a category:', 'woothemes') . '</span>';
$term_list .= '<ul>';
if (is_post_type_archive('project')) {
$class = 'class="current" ';
}
$term_list .= '<li><a ' . $class . 'href="' . esc_url(get_post_type_archive_link('project')) . '" title="' . __('View all projects', 'woothemes') . '">' . __('All', 'woothemes') . '</a></li>';
foreach ($terms as $term) {
if (is_tax('project-category', $term)) {
$class = 'class="current" ';
} else {
$class = '';
}
$term_list .= '<li><a ' . $class . 'href="' . esc_url(get_term_link($term)) . '" title="' . sprintf(__('View all post filed under %s', 'woothemes'), esc_attr($term->name)) . '">' . esc_attr($term->name) . '</a></li>';
}
$term_list .= '</ul>';
echo $term_list;
}
?>
</div>
<?php
}
示例14: woo_add_featured_slider
function woo_add_featured_slider($classes)
{
global $woo_options;
$settings = woo_get_dynamic_values(array('featured' => 'true', 'connect' => 'false'));
// Add body class if slider is enabled
if (is_home() && isset($settings['featured']) && $settings['featured'] == 'true') {
$classes[] = 'has-slider';
}
// Add the top section CSS class if we're not in the homepage
if (!is_home()) {
$classes[] = 'has-top-section';
}
if (is_single() && isset($settings['connect']) && $settings['connect'] == 'true') {
$classes[] = 'has-subscribe-connect';
}
return $classes;
}
示例15: woo_portfolio_gallery_filter
function woo_portfolio_gallery_filter($q)
{
if (is_tax('portfolio-gallery')) {
$settings = array('portfolio_posts_per_page' => get_option('posts_per_page'));
$settings = woo_get_dynamic_values($settings);
$q->set('posts_per_page', $settings['portfolio_posts_per_page']);
}
return $q;
}