当前位置: 首页>>代码示例>>PHP>>正文


PHP kirki_get_option函数代码示例

本文整理汇总了PHP中kirki_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP kirki_get_option函数的具体用法?PHP kirki_get_option怎么用?PHP kirki_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了kirki_get_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: google_link

 function google_link()
 {
     $fields = Kirki::fields()->get_all();
     // Early exit if no fields are found.
     if (!$fields || empty($fields)) {
         return;
     }
     // Get an array of all the google fonts
     $google_fonts = Kirki::fonts()->get_google_fonts();
     $fonts = array();
     foreach ($fields as $field) {
         if (isset($field['output'])) {
             // Check if this is a font-family control
             $is_font_family = isset($field['output']['property']) && 'font-family' == $field['output']['property'] ? true : false;
             // Check if this is a font-weight control
             $is_font_weight = isset($field['output']['property']) && 'font-weight' == $field['output']['property'] ? true : false;
             // Check if this is a font subset control
             $is_font_subset = isset($field['output']['property']) && 'font-subset' == $field['output']['property'] ? true : false;
             if ($is_font_family || $is_font_weight || $is_font_subset) {
                 // The value of this control
                 $value = kirki_get_option($field['settings_raw']);
                 if ($is_font_family) {
                     $fonts[]['font-family'] = $value;
                 } else {
                     if ($is_font_weight) {
                         $fonts[]['font-weight'] = $value;
                     } else {
                         if ($is_font_subset) {
                             $fonts[]['subsets'] = $value;
                         }
                     }
                 }
             }
         }
     }
     foreach ($fonts as $font) {
         if (isset($font['font-family'])) {
             $font_families = !isset($font_families) ? array() : $font_families;
             $font_families[] = $font['font-family'];
             if (Kirki::fonts()->is_google_font($font['font-family'])) {
                 $has_google_font = true;
             }
         }
         if (isset($font['font-weight'])) {
             $font_weights = !isset($font_weights) ? array() : $font_weights;
             $font_weights[] = $font['font-weight'];
         }
         if (isset($font['subsets'])) {
             $font_subsets = !isset($font_subsets) ? array() : $font_subsets;
             $font_subsets[] = $font['subsets'];
         }
     }
     $font_families = !isset($font_families) || empty($font_families) ? false : $font_families;
     $font_weights = !isset($font_weights) || empty($font_weights) ? '400' : $font_weights;
     $font_subsets = !isset($font_subsets) || empty($font_subsets) ? 'all' : $font_subsets;
     if (!isset($has_google_font) || !$has_google_font) {
         $font_families = false;
     }
     return $font_families ? Kirki::fonts()->get_google_font_uri($font_families, $font_weights, $font_subsets) : false;
 }
开发者ID:rsantellan,项目名称:wordpress-ecommerce,代码行数:60,代码来源:class-kirki-scripts-frontend-google-fonts.php

示例2: test_kirki_get_option

 public function test_kirki_get_option()
 {
     $this->add_theme_mod_field();
     $this->assertEquals('foo', kirki_get_option('the_mod_option'));
     set_theme_mod('the_mod_option', 'bar');
     $this->assertEquals('bar', kirki_get_option('the_mod_option'));
 }
开发者ID:1bigidea,项目名称:kirki,代码行数:7,代码来源:test-deprecated.php

示例3: tg_related_products_args

function tg_related_products_args($args)
{
    //Check if display related products
    $tg_shop_related_products = kirki_get_option('tg_shop_related_products');
    if (!empty($tg_shop_related_products)) {
        $args['posts_per_page'] = 3;
        // 4 related products
        $args['columns'] = 3;
        // arranged in 2 columns
    } else {
        $args['posts_per_page'] = 0;
    }
    return $args;
}
开发者ID:rsantellan,项目名称:wordpress-ecommerce,代码行数:14,代码来源:woocommerce.php

示例4: kirki_artOuro_custom_css

/**
 * Custom CSS
 */
function kirki_artOuro_custom_css()
{
    // Early exit if Kirki is not installed
    if (!function_exists('kirki_get_option')) {
        return;
    }
    // Add custom CSS for layouts
    $css = '';
    if ('full' == kirki_get_option('layout')) {
        $css .= '#primary{width:100%;}';
    } elseif ('left-sidebar' == kirki_get_option('layout')) {
        $css .= '#primary{float:right;}#secondary{float:left;}';
    }
    wp_add_inline_style('artOuro-style', $css);
}
开发者ID:GuiHarrison,项目名称:siteArtOuro,代码行数:18,代码来源:theme-customizer.php

示例5: test

 public function test()
 {
     $this->assertEquals(kirki_get_option(), Kirki::get_option());
     $this->assertEquals(kirki_sanitize_hex('#ffffff'), Kirki_Color::sanitize_hex('#ffffff'));
     $this->assertEquals(kirki_get_rgb('#ffffff'), Kirki_Color::get_rgb('#ffffff'));
     $this->assertEquals(kirki_get_rgba('#ffffff'), Kirki_Color::get_rgba('#ffffff'));
     $this->assertEquals(kirki_get_brightness('#ffffff'), Kirki_Color::get_brightness('#ffffff'));
     $font_registry = Kirki_Toolkit::fonts();
     $this->assertEquals(Kirki_Fonts::get_all_fonts(), $font_registry->get_all_fonts());
     $this->assertEquals(Kirki_Fonts::get_font_choices(), $font_registry->get_font_choices());
     $this->assertEquals(Kirki_Fonts::is_google_font('foo'), $font_registry->is_google_font('foo'));
     $this->assertEquals(Kirki_Fonts::get_google_font_uri(array('foo')), $font_registry->get_google_font_uri(array('foo')));
     $this->assertEquals(Kirki_Fonts::get_google_font_subsets(), $font_registry->get_google_font_subsets());
     $this->assertEquals(Kirki_Fonts::choose_google_font_variants('Roboto'), $font_registry->choose_google_font_variants('Roboto'));
     $this->assertEquals(Kirki_Fonts::get_standard_fonts(), $font_registry->get_standard_fonts());
     $this->assertEquals(Kirki_Fonts::get_font_stack('foo'), $font_registry->get_font_stack('foo'));
     $this->assertEquals(Kirki_Fonts::sanitize_font_choice('foo'), $font_registry->sanitize_font_choice('foo'));
     $this->assertEquals(Kirki_Fonts::get_google_fonts(), $font_registry->get_google_fonts());
 }
开发者ID:quintenm,项目名称:maresthema-2016,代码行数:19,代码来源:test-deprecated.php

示例6: display_element

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     if ($this->counter == 3) {
         $tg_retina_logo = kirki_get_option('tg_retina_logo');
         if (!empty($tg_retina_logo)) {
             $output .= '<li class="menu-item menu-item-type-custom menu-item-object-custom" id="menu-item-image" style="display: none !important"> ';
             $output .= '<a href="' . home_url() . '" style="vertical-align: middle;line-height: 18px;padding-top: 13px;padding-bottom: 13px;">';
             $output .= '<img src="' . esc_url($tg_retina_logo) . '" alt="' . esc_attr(get_bloginfo('name')) . '" width="154"/>';
             $output .= '</a></li>';
         }
     }
     $id_field = $this->db_fields['id'];
     //var_dump($this->counter);
     if (!empty($children_elements[$element->{$id_field}])) {
         $element->classes[] = 'arrow';
         //enter any classname you like here!
     }
     Walker_Nav_Menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
     $this->counter++;
 }
开发者ID:rsantellan,项目名称:wordpress-ecommerce,代码行数:20,代码来源:menu.lib.php

示例7: gently_social_links

/**
 * Display social icons which are set in customizer.
 */
function gently_social_links()
{
    $links_string = kirki_get_option('social_links');
    $links = preg_split('/$\\R?^/m', $links_string);
    if ($links) {
        echo '<div class="social-links">';
    }
    foreach ($links as $link) {
        if (filter_var($link, FILTER_VALIDATE_URL)) {
            $link = esc_url($link);
            $color = kirki_get_option('header_icons_color_original') ? 'orig-col' : '';
            printf('<a href="%1$s" class="sc-link">
						<i class="fa %2$s" aria-hidden="true"></i>
						<span class="screen-reader-text">%3$s</span>
					</a>', $link, $color, esc_html__('Social media page', 'gently'));
        }
    }
    if ($links) {
        echo '</div>';
    }
}
开发者ID:Greg36,项目名称:Gently,代码行数:24,代码来源:social-media.php

示例8: genlty_sidebar_position

/**
 * Add sidebar position classes to body.
 *
 * @param array $classes Classes for the body element.
 *
 * @return array
 */
function genlty_sidebar_position($classes)
{
    $sidebar_pos = kirki_get_option('sidebar_position');
    if ($sidebar_pos == 'left') {
        $classes[] = 'sidebar-left';
    } else {
        $classes[] = 'sidebar-right';
    }
    $sidebar_collapse = kirki_get_option('sidebar_collapse');
    $sidebar_collapse = explode(',', $sidebar_collapse[0]);
    if (is_home() && in_array('home', $sidebar_collapse)) {
        $classes[] = 'sidebar-closed';
    } else {
        if (is_single() && in_array('single', $sidebar_collapse)) {
            $classes[] = 'sidebar-closed';
        } else {
            if (is_archive() && in_array('archive', $sidebar_collapse)) {
                $classes[] = 'sidebar-closed';
            }
        }
    }
    return $classes;
}
开发者ID:Greg36,项目名称:Gently,代码行数:30,代码来源:extras.php

示例9: kirki_get_option

/img/logo.svg" alt="Logo" class="logo-img">
						</a>
					</div>
					<!-- /logo -->
					<!-- menu para escolher portal -->
					<ul class="qualPortal">
						<li><a href="ingage.guiharrison.com/precon2">Institucional</a></li>
						<li><a class="current" href="#">Pré-fabricado de concreto</a></li>
						<li><a href="http://www.meuprecon.com.br">Venda de imóveis</a></li>
					</ul>
					<!-- /menu para escolher portal -->

					<!-- telefone -->
					<div id="telefoneHead"><h2><span>(31)</span> <?php 
if (kirki_get_option('telefone')) {
    echo kirki_get_option('telefone');
}
?>
</h2></div>

					<!-- nav
					<nav class="nav" role="navigation">
						<?php 
html5blank_nav();
?>
					</nav>
					<!-- /nav -->

				</div>
				</div>
开发者ID:GuiHarrison,项目名称:engenho-laranja,代码行数:30,代码来源:header.php

示例10: tg_masonry_gallery_func

function tg_masonry_gallery_func($atts, $content)
{
    extract(shortcode_atts(array('gallery_id' => '', 'layout' => 'wide', 'columns' => 4), $atts));
    $images_arr = get_post_meta($gallery_id, 'wpsimplegallery_gallery', true);
    $images_arr = pp_resort_gallery_img($images_arr);
    $return_html = '';
    $custom_id = time() . rand();
    if (!is_numeric($columns)) {
        $columns = 4;
    }
    $wrapper_class = '';
    $grid_wrapper_class = '';
    $column_class = '';
    switch ($columns) {
        case 2:
            $wrapper_class = 'two_cols';
            $grid_wrapper_class = 'classic2_cols';
            $column_class = 'one_half gallery2';
            break;
        case 3:
            $wrapper_class = 'three_cols';
            $grid_wrapper_class = 'classic3_cols';
            $column_class = 'one_third gallery3';
            break;
        case 4:
            $wrapper_class = 'four_cols';
            $grid_wrapper_class = 'classic4_cols';
            $column_class = 'one_fourth gallery4';
            break;
    }
    if (!empty($images_arr)) {
        if ($layout == 'contain') {
            $return_html .= '<div class="standard_wrapper">';
        }
        $return_html .= '<div id="' . $custom_id . '" class="portfolio_filter_wrapper gallery ' . esc_attr($wrapper_class) . ' ' . esc_attr($layout) . '" data-columns="' . esc_attr($columns) . '">';
        wp_enqueue_script("script-gallery-grid" . $custom_id, get_template_directory_uri() . "/templates/script-gallery-grid.php?id=" . $custom_id, false, THEMEVERSION, true);
        foreach ($images_arr as $key => $image) {
            $image_url = wp_get_attachment_image_src($image, 'original', true);
            $small_image_url = wp_get_attachment_image_src($image, 'gallery_masonry', true);
            $image_caption = get_post_field('post_excerpt', $image);
            $image_alt = get_post_meta($image, '_wp_attachment_image_alt', true);
            $tg_lightbox_enable_caption = kirki_get_option('tg_lightbox_enable_caption');
            $return_html .= '<div class="element grid  ' . esc_attr($grid_wrapper_class) . '">';
            $return_html .= '<div class="' . esc_attr($column_class) . ' static filterable gallery_type animated' . esc_attr($key + 1) . '">';
            $return_html .= '<a class="fancy-gallery" href="' . esc_url($image_url[0]) . '" ';
            if (!empty($tg_lightbox_enable_caption)) {
                $return_html .= 'title="' . esc_attr($image_caption) . '" ';
            }
            $return_html .= '>';
            $return_html .= '<img src="' . esc_url($small_image_url[0]) . '" alt="' . esc_attr($image_alt) . '"/>';
            $return_html .= '</a>';
            $return_html .= '</div>';
            $return_html .= '</div>';
        }
        $return_html .= '</div>';
        if ($layout == 'contain') {
            $return_html .= '</div>';
        }
    } else {
        $return_html .= __('Empty gallery item. Please make sure you have upload image to it or check the short code.', PLUGINDOMAIN);
    }
    return $return_html;
}
开发者ID:rsantellan,项目名称:wordpress-ecommerce,代码行数:63,代码来源:tg-shortcode.php

示例11: get_term_by

    //Get portfolio category page template
    $obj_term = get_term_by('slug', $term, 'portfoliosets');
    $term_meta = get_option("taxonomy_term_{$obj_term->term_id}");
    $tg_page_template = $term_meta['portfoliosets_template'];
    if (file_exists(get_template_directory() . "/" . $tg_page_template . ".php")) {
        get_template_part($tg_page_template);
    } else {
        get_template_part("portfolio-2-contained");
    }
    exit;
} elseif ($post_type == 'galleries') {
    //Get gallery category page template
    $obj_term = get_term_by('slug', $term, 'gallerycat');
    $term_meta = get_option("taxonomy_term_{$obj_term->term_id}");
    $tg_page_template = $term_meta['gallerycat_template'];
    if (file_exists(get_template_directory() . "/" . $tg_page_template . ".php")) {
        get_template_part($tg_page_template);
    } else {
        get_template_part("gallery-archive-2-contained");
    }
    exit;
} else {
    //Get archive page layout setting
    $tg_blog_archive_layout = kirki_get_option('tg_blog_archive_layout');
    $located = locate_template($tg_blog_archive_layout . '.php');
    if (!empty($located)) {
        get_template_part($tg_blog_archive_layout);
    } else {
        echo 'Error can\'t find page template you selected';
    }
}
开发者ID:rsantellan,项目名称:wordpress-ecommerce,代码行数:31,代码来源:archive.php

示例12: get_header

*	Get current page id
**/
if (!is_null($post) && isset($page_obj->ID)) {
    $current_page_id = $page_obj->ID;
}
get_header();
global $page_content_class;
$page_content_class = 'wide';
//Include custom header feature
get_template_part("/templates/template-header");
?>

<!-- Begin content -->
<?php 
//Get number of portfolios per page
$tg_portfolio_items = kirki_get_option('tg_portfolio_items');
//Get all portfolio items for paging
global $wp_query;
if (is_front_page()) {
    $paged = get_query_var('page') ? get_query_var('page') : 1;
} else {
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
}
$query_string = 'paged=' . $paged . '&orderby=menu_order&order=ASC&post_type=portfolios&numberposts=-1&suppress_filters=0&posts_per_page=' . $tg_portfolio_items;
if (!empty($term)) {
    $ob_term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
    $custom_tax = $wp_query->query_vars['taxonomy'];
    $query_string .= '&posts_per_page=-1&' . $custom_tax . '=' . $term;
}
query_posts($query_string);
//Include project filterable options
开发者ID:rsantellan,项目名称:wordpress-ecommerce,代码行数:31,代码来源:portfolio-4-wide-classic.php

示例13: header

<?php

header("Content-Type: text/css");
$absolute_path = __FILE__;
$path_to_file = explode('wp-content', $absolute_path);
$path_to_wp = $path_to_file[0];
require_once $path_to_wp . '/wp-load.php';
//Check if hide portfolio navigation
$pp_portfolio_single_nav = get_option('pp_portfolio_single_nav');
if (empty($pp_portfolio_single_nav)) {
    ?>
.portfolio_nav { display:none; }
<?php 
}
$tg_fixed_menu = kirki_get_option('tg_fixed_menu');
if (!empty($tg_fixed_menu)) {
    ?>
.top_bar.fixed
{
	position: fixed;
	animation-name: fadeIn;
	-webkit-animation-name: fadeIn;	
	animation-duration: 0.5s;	
	-webkit-animation-duration: 0.5s;
	visibility: visible !important;
}
<?php 
}
?>

<?php 
开发者ID:rsantellan,项目名称:wordpress-ecommerce,代码行数:31,代码来源:animated-css.php

示例14: setting_styles

 /**
  * Get the styles for a single field.
  */
 public function setting_styles($field, $styles = '', $element = '', $property = '', $units = '', $prefix = '', $suffix = '', $callback = false)
 {
     $value = kirki_get_option($field['settings_raw']);
     $value = $callback ? call_user_func($callback, $value) : $value;
     $element = $prefix . $element;
     $units = $units . $suffix;
     // Color controls
     if ('color' == $field['type']) {
         $color = Kirki_Color::sanitize_hex($value);
         $styles[$element][$property] = $color . $units;
     } elseif ('background' == $field['type']) {
         if (isset($field['default']['color'])) {
             $color_mode = false !== strpos($field['default']['color'], 'rgba') ? 'color-alpha' : 'color';
             $value = kirki_get_option($field['settings_raw'] . '_color');
             if ('color-alpha' == $color_mode) {
                 $bg_color = kirki_sanitize_rgba($value);
             } else {
                 $bg_color = Kirki_Color::sanitize_hex($value);
             }
         }
         if (isset($field['default']['image'])) {
             $bg_image = kirki_get_option($field['settings_raw'] . '_image');
             $bg_image = esc_url_raw($bg_image);
         }
         if (isset($field['default']['repeat'])) {
             $bg_repeat = kirki_get_option($field['settings_raw'] . '_repeat');
             $bg_repeat = kirki_sanitize_bg_repeat($bg_repeat);
         }
         if (isset($field['default']['size'])) {
             $bg_size = kirki_get_option($field['settings_raw'] . '_size');
             $bg_size = kirki_sanitize_bg_size($bg_size);
         }
         if (isset($field['default']['attach'])) {
             $bg_attach = kirki_get_option($field['settings_raw'] . '_attach');
             $bg_attach = kirki_sanitize_bg_attach($bg_attach);
         }
         if (isset($field['default']['position'])) {
             $bg_position = kirki_get_option($field['settings_raw'] . '_position');
             $bg_position = kirki_sanitize_bg_position($bg_position);
         }
         if (isset($field['default']['opacity']) && $field['default']['opacity']) {
             $bg_opacity = kirki_get_option($field['settings_raw'] . '_opacity');
             $bg_opacity = kirki_sanitize_number($bg_opacity);
             if (isset($bg_color)) {
                 // If we're using an opacity other than 100, then convert the color to RGBA.
                 $bg_color = 100 != $bg_opacity ? Kirki_Color::get_rgba($bg_color, $bg_opacity) : $bg_color;
             } elseif (isset($bg_image)) {
                 $element_opacity = $bg_opacity / 100;
             }
         }
         if (isset($bg_color)) {
             $styles[$element]['background-color'] = $bg_color . $units;
         }
         if (isset($bg_image) && '' != $bg_image) {
             $styles[$element]['background-image'] = 'url("' . $bg_image . '")' . $units;
             if (isset($bg_repeat)) {
                 $styles[$element]['background-repeat'] = $bg_repeat . $units;
             }
             if (isset($bg_size)) {
                 $styles[$element]['background-size'] = $bg_size . $units;
             }
             if (isset($bg_attach)) {
                 $styles[$element]['background-attachment'] = $bg_attach . $units;
             }
             if (isset($bg_position)) {
                 $styles[$element]['background-position'] = str_replace('-', ' ', $bg_position) . $units;
             }
         }
     } elseif (array($field['output']) && isset($field['output']['property']) && in_array($field['output']['property'], array('font-family', 'font-size', 'font-weight'))) {
         $is_font_family = isset($field['output']['property']) && 'font-family' == $field['output']['property'] ? true : false;
         $is_font_size = isset($field['output']['property']) && 'font-size' == $field['output']['property'] ? true : false;
         $is_font_weight = isset($field['output']['property']) && 'font-weight' == $field['output']['property'] ? true : false;
         if ('font-family' == $property) {
             $styles[$field['output']['element']]['font-family'] = $value . $units;
         } else {
             if ('font-size' == $property) {
                 // Get the unit we're going to use for the font-size.
                 $units = empty($units) ? 'px' : $units;
                 $styles[$element]['font-size'] = $value . $units;
             } else {
                 if ('font-weight' == $property) {
                     $styles[$element]['font-weight'] = $value . $units;
                 }
             }
         }
     } else {
         $styles[$element][$property] = $value . $units;
     }
     return $styles;
 }
开发者ID:rsantellan,项目名称:wordpress-ecommerce,代码行数:93,代码来源:class-kirki-styles-frontend.php

示例15: esc_url

					<a class="bg-cor" href="<?php 
    echo esc_url(kirki_get_option('fast_link_2'));
    ?>
">
						<?php 
    echo esc_textarea($title);
    ?>
					</a>
				<?php 
}
?>
				<?php 
if ($title = kirki_get_option('fast_link_3_title')) {
    ?>
					<a class="bg-cor" href="<?php 
    echo esc_url(kirki_get_option('fast_link_3'));
    ?>
">
						<?php 
    echo esc_textarea($title);
    ?>
					</a>
				<?php 
}
?>
			</div><!-- .col-md-4 links-rapidos -->
			<div class="col-md-4 agenda">
				<header class="col-md-12">
					<h3 class="col-md-6"><?php 
_e('Agenda de Ações', 'odin');
?>
开发者ID:brasadesign,项目名称:polos-theme,代码行数:31,代码来源:infos-home.php


注:本文中的kirki_get_option函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。