本文整理汇总了PHP中Kirki::get_option方法的典型用法代码示例。如果您正苦于以下问题:PHP Kirki::get_option方法的具体用法?PHP Kirki::get_option怎么用?PHP Kirki::get_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kirki
的用法示例。
在下文中一共展示了Kirki::get_option方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tm_polygon_body_classes
/**
* Adds custom classes to the array of body classes.
* ================================================
*
* @param array $classes Classes for the body element.
*
* @return array
*/
function tm_polygon_body_classes($classes)
{
// Adds a class of group-blog to blogs with more than 1 published author.
if (is_multi_author()) {
$classes[] = 'group-blog';
}
global $tm_polygon_custom_class;
if ($tm_polygon_custom_class) {
$classes[] = $tm_polygon_custom_class;
}
if (Kirki::get_option('tm-polygon', 'site_general_boxed') == 1) {
$classes[] = 'boxed';
}
$classes[] = Kirki::get_option('tm-polygon', 'header_type');
global $tm_polygon_page_layout_private;
if ($tm_polygon_page_layout_private != 'default' && class_exists('cmb2_bootstrap_205')) {
$tm_polygon_layout = get_post_meta(get_the_ID(), "tm_polygon_page_layout_private", true);
} else {
$tm_polygon_layout = Kirki::get_option('tm-polygon', 'page_layout');
}
$classes[] = $tm_polygon_layout;
if (defined('TM_CORE_VERSION')) {
$classes[] = 'core_' . str_replace(".", "", TM_CORE_VERSION);
}
return $classes;
}
示例2: css
/**
* The class constructor.
*
* @var string the setting ID.
* @var string theme_mod / option
* @var array an array of arrays of the output arguments.
* @var mixed a callable function.
*/
public static function css($field)
{
/**
* Make sure the field is sanitized before proceeding any further.
*/
$field = Kirki_Field::sanitize_field($field);
/**
* Get the config ID used in the Kirki class.
*/
$config_id = Kirki::get_config_id($field);
/**
* Set class vars
*/
self::$settings = $field['settings'];
self::$output = $field['output'];
self::$callback = $field['sanitize_callback'];
/**
* Get the value of this field
*/
if ('option' == Kirki::$config[$config_id]['option_type'] && '' != Kirki::$config[$config_id]['option_name']) {
self::$value = Kirki::get_option($config_id, str_replace(array(']', Kirki::$config[$config_id]['option_name'] . '['), '', $field['settings']));
} else {
self::$value = Kirki::get_option($config_id, $field['settings']);
}
/**
* Returns the styles
*/
if (!is_array(self::$value)) {
return self::styles();
}
}
示例3: infinity_js_custom_code
function infinity_js_custom_code()
{
?>
<?php
if (Kirki::get_option('infinity', 'custom_js_enable') == 1) {
?>
<?php
echo html_entity_decode(Kirki::get_option('infinity', 'custom_js'));
?>
<?php
}
?>
<?php
if (Kirki::get_option('infinity', 'nav_sticky_enable') == 1 && has_nav_menu('primary')) {
?>
<?php
if (Kirki::get_option('infinity', 'header_type') == 'header03' || Kirki::get_option('infinity', 'header_type') == 'header04') {
?>
<script>
jQuery(document).ready(function ($) {
$(".header").headroom(
{
offset: 52
}
);
});
</script>
<?php
} else {
?>
<script>
jQuery(document).ready(function ($) {
$("#site-navigation").headroom(
{
offset: 160
}
);
});
</script>
<?php
}
?>
<?php
}
}
示例4: tm_polygon_js_custom_code
function tm_polygon_js_custom_code()
{
?>
<?php
if (Kirki::get_option('tm-polygon', 'custom_js_enable') == 1) {
?>
<?php
echo html_entity_decode(Kirki::get_option('tm-polygon', 'custom_js'));
?>
<?php
}
?>
<?php
if (Kirki::get_option('tm-polygon', 'nav_sticky_enable') == 1 && has_nav_menu('primary')) {
?>
<?php
if (Kirki::get_option('tm-polygon', 'header_type') == 'header02' || Kirki::get_option('tm-polygon', 'header_type') == 'header04') {
?>
<script>
jQuery(document).ready(function ($) {
$(".sticky-menu").headroom(
{
offset: $(".site-top").innerHeight(),
}
);
});
</script>
<?php
} else {
?>
<script>
jQuery(document).ready(function ($) {
$(".sticky-menu").headroom(
{
offset: 0
}
);
});
</script>
<?php
}
?>
<?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());
}
示例6: infinity_body_classes
/**
* Adds custom classes to the array of body classes.
* ================================================
* @param array $classes Classes for the body element.
* @return array
*/
function infinity_body_classes($classes)
{
// Adds a class of group-blog to blogs with more than 1 published author.
if (is_multi_author()) {
$classes[] = 'group-blog';
}
global $infinity_custom_class;
if ($infinity_custom_class) {
$classes[] = $infinity_custom_class;
}
if (Kirki::get_option('infinity', 'site_general_boxed') == 1) {
$classes[] = 'boxed';
}
$classes[] = Kirki::get_option('infinity', 'header_type');
global $infinity_page_layout_private;
if ($infinity_page_layout_private != 'default' && class_exists('cmb2_bootstrap_205')) {
$layout = get_post_meta(get_the_ID(), "infinity_page_layout_private", true);
} else {
$layout = Kirki::get_option('infinity', 'page_layout');
}
$classes[] = $layout;
return $classes;
}
示例7: get_variables
/**
* Build the variables.
*
* @return array ('variable-name' => value)
*/
public function get_variables()
{
$variables = array();
/**
* Loop through all fields
*/
foreach (Kirki::$fields as $field) {
/**
* Check if we have variables for this field
*/
if (isset($field['variables']) && false != $field['variables'] && !empty($field['variables'])) {
/**
* Loop through the array of variables
*/
foreach ($field['variables'] as $field_variable) {
/**
* Is the variable ['name'] defined?
* If yes, then we can proceed.
*/
if (isset($field_variable['name'])) {
/**
* Sanitize the variable name
*/
$variable_name = esc_attr($field_variable['name']);
/**
* Do we have a callback function defined?
* If not then set $variable_callback to false.
*/
$variable_callback = isset($field_variable['callback']) && is_callable($field_variable['callback']) ? $field_variable['callback'] : false;
/**
* If we have a variable_callback defined then get the value of the option
* and run it through the callback function.
* If no callback is defined (false) then just get the value.
*/
if ($variable_callback) {
$variables[$variable_name] = call_user_func($field_variable['callback'], Kirki::get_option(Kirki_Field_Sanitize::sanitize_settings($field)));
} else {
$variables[$variable_name] = Kirki::get_option($field['settings']);
}
}
}
}
}
/**
* Pass the variables through a filter ('kirki/variable')
* and return the array of variables
*/
return apply_filters('kirki/variable', $variables);
}
示例8: flatbook_social_icons
/**
* Custom social network icon links
*/
function flatbook_social_icons()
{
$socials = array(array('name' => __('Facebook', 'flatbook'), 'link' => Kirki::get_option('fb', 'facebook_url'), 'icon' => 'fa-facebook-square'), array('name' => __('Twitter', 'flatbook'), 'link' => Kirki::get_option('fb', 'twitter_url'), 'icon' => 'fa-twitter-square'), array('name' => __('LinkedIn', 'flatbook'), 'link' => Kirki::get_option('fb', 'linkedin_url'), 'icon' => 'fa-linkedin-square'), array('name' => __('Dribbble', 'flatbook'), 'link' => Kirki::get_option('fb', 'dribbble_url'), 'icon' => 'fa-dribbble'), array('name' => __('Vimeo', 'flatbook'), 'link' => Kirki::get_option('fb', 'vimeo_url'), 'icon' => 'fa-vimeo-square'), array('name' => __('Flickr', 'flatbook'), 'link' => Kirki::get_option('fb', 'flickr_url'), 'icon' => 'fa-flickr'), array('name' => __('Instagram', 'flatbook'), 'link' => Kirki::get_option('fb', 'instagram_url'), 'icon' => 'fa-instagram'), array('name' => __('Pinterest', 'flatbook'), 'link' => Kirki::get_option('fb', 'pinterest_url'), 'icon' => 'fa-pinterest-square'), array('name' => __('YouTube', 'flatbook'), 'link' => Kirki::get_option('fb', 'youtube_url'), 'icon' => 'fa-youtube-square'), array('name' => __('Behance', 'flatbook'), 'link' => Kirki::get_option('fb', 'behance_url'), 'icon' => 'fa-behance-square'), array('name' => __('BitBucket', 'flatbook'), 'link' => Kirki::get_option('fb', 'bitbucket_url'), 'icon' => 'fa-bitbucket-square'), array('name' => __('GitHub', 'flatbook'), 'link' => Kirki::get_option('fb', 'github_url'), 'icon' => 'fa-github-square'), array('name' => __('Google+', 'flatbook'), 'link' => Kirki::get_option('fb', 'googleplus_url'), 'icon' => 'fa-google-plus-square'), array('name' => __('Skype', 'flatbook'), 'link' => Kirki::get_option('fb', 'skype_url'), 'icon' => 'fa-skype'), array('name' => __('Reddit', 'flatbook'), 'link' => Kirki::get_option('fb', 'reddit_url'), 'icon' => 'fa-reddit-square'), array('name' => __('Tumblr', 'flatbook'), 'link' => Kirki::get_option('fb', 'tumblr_url'), 'icon' => 'fa-tumblr-square'));
echo '<ul class="social-icons">';
foreach ($socials as $social) {
if (!empty($social['link'])) {
echo '<li>';
echo '<a href="' . $social['link'] . '" title="' . $social['name'] . '" target="_blank">';
echo '<i class="fa fa-lg ' . $social['icon'] . '"></i>';
echo '</a>';
echo '</li>';
}
}
echo '</ul>';
}
示例9: dynamic_sidebar
<?php
dynamic_sidebar("frontpage-sidebar");
?>
</div>
</div>
</div>
<!-- /sidebar-frontpage-container -->
<div class="separator"></div>
<!-- frontpageseparate-page-content-container -->
<div class="frontpageseparate-page-content-container">
<div class="large-12 columns panel">
<div class="row">
<?php
$front_page_separate_page_content_dropdown = Kirki::get_option(mc, front_page_separate_page_content_dropdown);
if ($front_page_separate_page_content_dropdown) {
$front_page_separate_page_content_dropdown_content = get_post_field('post_content', $front_page_separate_page_content_dropdown);
echo $front_page_separate_page_content_dropdown_content;
}
?>
</div>
</div>
</div>
<!-- /frontpageseparate-page-content-container -->
</div>
<?php
get_footer();
示例10: beagency_customize_save_after
/**
* Update option after Customizer save.
*/
function beagency_customize_save_after()
{
update_option('blogname', Kirki::get_option('general_site_title'));
if (Kirki::get_option('general_front_page') != '0') {
update_option('show_on_front ', 'page');
update_option('page_on_front', Kirki::get_option('general_front_page'));
update_option('page_for_posts', Kirki::get_option('general_posts_page'));
}
}
示例11: url
?>
<div class="big-title" style="background-image: url('<?php
echo esc_url($infinity_heading_image);
?>
')">
<div class="container">
<?php
the_title('<h1 class="entry-title" itemprop="headline">', '</h1>');
?>
<?php
if (function_exists('tm_bread_crumb') && Kirki::get_option('infinity', 'site_general_breadcrumb_enable') == 1) {
?>
<div class="breadcrumb">
<div class="container">
<?php
echo tm_bread_crumb(array('home_label' => Kirki::get_option('infinity', 'site_general_breadcrumb_home_text')));
?>
</div>
</div>
<?php
}
?>
</div>
</div>
<?php
}
?>
<div class="container">
<div class="row">
<?php
if ($layout == 'sidebar-content') {
示例12: shamrock_get_option
function shamrock_get_option($option)
{
return Kirki::get_option('shamrock_settings', $option);
}
示例13: wp_nav_menu
">
<div class="social">
<?php
wp_nav_menu(array('theme_location' => 'social', 'menu_id' => 'social-menu', 'container_class' => 'social-menu', 'fallback_cb' => false));
?>
</div>
</div>
<?php
}
?>
<div class="<?php
echo esc_attr($text_cl);
?>
">
<?php
echo html_entity_decode(Kirki::get_option('tm-polygon', 'copyright_layout_text'));
?>
</div>
</div>
</div>
</div><!-- .copyright -->
<?php
}
?>
</div><!-- #page -->
<?php
tha_body_bottom();
?>
<?php
wp_footer();
?>
示例14: esc_url
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package tm_polygon
*/
$tm_polygon_layout = Kirki::get_option('tm-polygon', 'site_layout');
$tm_polygon_heading_image = Kirki::get_option('tm-polygon', 'page_bg_image');
get_header();
?>
<div class="big-title" style="background-image: url('<?php
echo esc_url($tm_polygon_heading_image);
?>
')">
<div class="container">
<h1 class="entry-title" itemprop="headline"><?php
echo esc_html__('Blog', 'tm-polygon');
?>
</h1>
</div>
</div>
<div class="container">
<div class="row">
<?php
示例15: while
<?php
/**
* The footer layouts used in theme
*
* @package FlatBook
*/
$footer_widgets = Kirki::get_option('fb', 'layout_footer_widgets_display');
$blog_footer_widgets = Kirki::get_option('fb', 'blog_page_display_footer_widgets');
$single_footer_widgets = Kirki::get_option('fb', 'blog_single_display_footer_widgets');
$footer_subscribe = Kirki::get_option('fb', 'layout_footer_subscribe_display');
$blog_footer_subscribe = Kirki::get_option('fb', 'blog_page_display_footer_subscribe');
$single_footer_subscribe = Kirki::get_option('fb', 'blog_single_display_footer_subscribe');
?>
<footer id="site-footer" class="footer">
<?php
if (is_page_template('page-builder.php')) {
// IF BUILDER PAGE
if (have_rows('footer_builder')) {
while (have_rows('footer_builder')) {
the_row();
if (get_row_layout() == 'subscribe_footer') {
get_template_part('partials/footer', 'subscribe');
}
if (get_row_layout() == 'widgets_footer') {
get_template_part('partials/footer', 'widgets');
}
if (get_row_layout() == 'copyright_footer') {