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


PHP siteorigin_setting函数代码示例

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


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

示例1: vantage_panels_panels_row_style_attributes

function vantage_panels_panels_row_style_attributes($attr, $style)
{
    if (empty($attr['style'])) {
        $attr['style'] = '';
    }
    if (!empty($style['top_border'])) {
        $attr['style'] .= 'border-top: 1px solid ' . esc_attr($style['top_border']) . '; ';
    }
    if (!empty($style['bottom_border'])) {
        $attr['style'] .= 'border-bottom: 1px solid ' . esc_attr($style['bottom_border']) . '; ';
    }
    if (!empty($style['background'])) {
        $attr['style'] .= 'background-color: ' . esc_attr($style['background']) . '; ';
    }
    if (!empty($style['background_image'])) {
        $attr['style'] .= 'background-image: url(' . esc_url($style['background_image']) . '); ';
    }
    if (!empty($style['background_image_repeat'])) {
        $attr['style'] .= 'background-repeat: repeat; ';
    }
    if (!empty($style['row_css'])) {
        $attr['style'] .= $style['row_css'];
    }
    if (isset($style['row_stretch']) && strpos($style['row_stretch'], 'full') !== false) {
        // We'll use this to prevent the jump when loading.
        $attr['class'][] = 'panel-row-style-full-width';
    }
    if (isset($style['class']) && $style['class'] == 'wide-grey' && siteorigin_setting('layout_bound') == 'full') {
        $attr['style'] .= 'padding-left: 1000px; padding-right: 1000px;';
    }
    if (empty($attr['style'])) {
        unset($attr['style']);
    }
    return $attr;
}
开发者ID:ROCK-SOLID-CN,项目名称:rock-solid-website,代码行数:35,代码来源:panels.php

示例2: siteorigin_theme_update_filter

/**
 * Add some custom SiteOrigin update information to the update_themes transient.
 *
 * This ONLY applies when the user enters a valid premium order number. A user should be aware that the updates will be
 * coming from a different source after they upgrade to the premium version.
 *
 * @param $current
 * @return mixed
 */
function siteorigin_theme_update_filter($current)
{
    $theme = basename(get_template_directory());
    $order_number = siteorigin_setting('premium_order_number');
    if (empty($order_number)) {
        return $current;
    }
    // Skip if the user has not entered an order number.
    static $request = false;
    if (empty($request)) {
        // Only keep a single instance of this request. Stops double requests.
        $request = wp_remote_get(add_query_arg(array('timestamp' => time(), 'action' => 'update_info', 'version' => SITEORIGIN_THEME_VERSION, 'order_number' => $order_number), SITEORIGIN_THEME_ENDPOINT . '/premium/' . $theme . '/'), array('timeout' => 10));
    }
    if (!is_wp_error($request) && $request['response']['code'] == 200 && !empty($request['body'])) {
        $data = unserialize($request['body']);
        if (empty($current)) {
            $current = new stdClass();
        }
        if (empty($current->response)) {
            $current->response = array();
        }
        if (!empty($data)) {
            $current->response[$theme] = $data;
        }
    }
    return $current;
}
开发者ID:simplon-emmanuelD,项目名称:Simplon-INESS,代码行数:36,代码来源:update.php

示例3: ultra_body_classes

/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function ultra_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    // Adds a class of content-none if there are no posts.
    if (!have_posts()) {
        $classes[] = 'content-none';
    }
    // Add widget-dependent classes.
    if (!is_active_sidebar('sidebar-1')) {
        $classes[] = 'one-column';
    }
    // Add a class if the sidebar is use.
    if (is_active_sidebar('sidebar-1')) {
        $classes[] = 'sidebar';
    }
    // Add a class if viewed on mobile.
    if (wp_is_mobile()) {
        $classes[] = 'mobile-device';
    }
    if (siteorigin_setting('header_tagline')) {
        $classes[] = 'tagline';
    }
    // Add a class if the page slider overlap is true.
    if (get_post_meta(get_the_ID(), 'ultra_metaslider_slider_overlap', true) == true) {
        $classes[] = 'overlap';
    }
    return $classes;
}
开发者ID:Zedash,项目名称:Ultra0.9.4,代码行数:37,代码来源:extras.php

示例4: siteorigin_north_body_classes

/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function siteorigin_north_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    $classes[] = 'no-js';
    $classes[] = 'css3-animations';
    $classes[] = 'responsive';
    if (is_page()) {
        $classes[] = 'page-layout-' . SiteOrigin_Settings_Page_Settings::get('layout');
        $classes[] = 'page-layout-menu-' . SiteOrigin_Settings_Page_Settings::get('menu');
        if (!SiteOrigin_Settings_Page_Settings::get('masthead_margin')) {
            $classes[] = 'page-layout-no-masthead-margin';
        }
        if (!SiteOrigin_Settings_Page_Settings::get('footer_margin')) {
            $classes[] = 'page-layout-no-footer-margin';
        }
    }
    if (!is_active_sidebar('main-sidebar')) {
        $classes[] = 'no-active-sidebar';
    }
    if (siteorigin_setting('navigation_sticky')) {
        $classes[] = 'sticky-menu';
    }
    if (wp_is_mobile()) {
        $classes[] = 'is_mobile';
    }
    return $classes;
}
开发者ID:Gonzalez74,项目名称:siteorigin-north,代码行数:36,代码来源:extras.php

示例5: vantage_body_classes

/**
 * Adds custom classes to the array of body classes.
 *
 * @since vantage 1.0
 */
function vantage_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    if (siteorigin_setting('layout_responsive')) {
        $classes[] = 'responsive';
    }
    $classes[] = 'layout-' . siteorigin_setting('layout_bound');
    $classes[] = 'no-js';
    $is_full_width_template = is_page_template('templates/template-full.php') || is_page_template('templates/template-full-notitle.php');
    if (!$is_full_width_template) {
        $wc_shop_sidebar = vantage_is_woocommerce_active() && is_shop() && is_active_sidebar('shop');
        if (!is_active_sidebar('sidebar-1') && !$wc_shop_sidebar) {
            $classes[] = 'no-sidebar';
        } else {
            $classes[] = 'has-sidebar';
        }
    }
    if (wp_is_mobile()) {
        $classes[] = 'so-vantage-mobile-device';
    }
    $mega_menu_active = function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary');
    if (siteorigin_setting('navigation_menu_search') && !$mega_menu_active) {
        $classes[] = 'has-menu-search';
    }
    if (siteorigin_setting('layout_force_panels_full')) {
        $classes[] = 'panels-style-force-full';
    }
    return $classes;
}
开发者ID:simplon-emmanuelD,项目名称:Simplon-INESS,代码行数:37,代码来源:extras.php

示例6: widget

    public function widget($args, $instance)
    {
        // outputs the content of the widget
        global $post;
        if (!empty($post)) {
        }
        echo $args['before_widget'];
        echo get_avatar(get_the_author_meta('ID'), 40);
        ?>
		<div class="author-text">
			<div class="title"><?php 
        echo esc_html(siteorigin_setting('video_by_text', __('Video By', 'focus')));
        ?>
</div>
			<div class="author"><?php 
        the_author_meta('display_name');
        ?>
</div>
		</div>
		<div class="clear"></div>
		<div class="post-info"><?php 
        focus_posted_on();
        ?>
</div>
		<?php 
        echo $args['after_widget'];
    }
开发者ID:siteorigin,项目名称:focus,代码行数:27,代码来源:widgets.php

示例7: pitch_slide_init

/**
 * Initialize Pitch's slide post type
 */
function pitch_slide_init()
{
    $labels = array('name' => _x('Slides', 'post type general name', 'pitch'), 'singular_name' => _x('Slide', 'post type singular name', 'pitch'), 'add_new' => _x('Add New', 'book', 'pitch'), 'add_new_item' => __('Add New Slide', 'pitch'), 'edit_item' => __('Edit Slide', 'pitch'), 'new_item' => __('New Slide', 'pitch'), 'all_items' => __('All Slide', 'pitch'), 'view_item' => __('View Slide', 'pitch'), 'search_items' => __('Search Slides', 'pitch'), 'not_found' => __('No slides found', 'pitch'), 'not_found_in_trash' => __('No slides found in Trash', 'pitch'), 'parent_item_colon' => '', 'menu_name' => __('Slides', 'pitch'));
    $args = array('labels' => $labels, 'public' => false, 'publicly_queryable' => false, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => false, 'rewrite' => false, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title', 'thumbnail', 'excerpt', 'page-attributes'), 'menu_icon' => get_template_directory_uri() . '/images/post-types/slider-small.png');
    register_post_type('slide', $args);
    add_image_size('slide', 960, siteorigin_setting('slider_height'), true);
}
开发者ID:Ksajikyan,项目名称:poiskuslug.ru,代码行数:10,代码来源:slide.php

示例8: siteorigin_north_woocommerce_enqueue_styles

function siteorigin_north_woocommerce_enqueue_styles($styles)
{
    $styles['northern-woocommerce'] = array('src' => get_template_directory_uri() . '/woocommerce.css', 'deps' => 'woocommerce-layout', 'version' => SITEORIGIN_THEME_VERSION, 'media' => 'all');
    if (function_exists('is_woocommerce') && is_woocommerce() && siteorigin_setting('responsive_disabled')) {
        unset($styles['woocommerce-smallscreen']);
    }
    return $styles;
}
开发者ID:adiraomj,项目名称:siteorigin-north,代码行数:8,代码来源:functions.php

示例9: vantage_panels_settings

/**
 * Configure the SiteOrigin page builder settings.
 * 
 * @param $settings
 * @return mixed
 */
function vantage_panels_settings($settings)
{
    $settings['home-page'] = true;
    $settings['margin-bottom'] = 35;
    $settings['home-page-default'] = 'default-home';
    $settings['responsive'] = siteorigin_setting('layout_responsive');
    return $settings;
}
开发者ID:jsan4christ,项目名称:sciencelab,代码行数:14,代码来源:panels.php

示例10: vantage_customizer_callback_site_title_size

/**
 * @param SiteOrigin_Customizer_CSS_Builder $builder
 * @param mixed $val
 * @param array $setting
 *
 * @return SiteOrigin_Customizer_CSS_Builder
 */
function vantage_customizer_callback_site_title_size($builder, $val, $setting)
{
    $mh_layout = siteorigin_setting('layout_masthead');
    if ($mh_layout == 'logo-in-menu') {
        $builder->add_css('#masthead .hgroup h1, #masthead.masthead-logo-in-menu .logo > h1', 'font-size', $val * 0.6 . 'px');
    } else {
        $builder->add_css('#masthead .hgroup h1, #masthead.masthead-logo-in-menu .logo > h1', 'font-size', $val . 'px');
    }
    return $builder;
}
开发者ID:siteorigin,项目名称:vantage,代码行数:17,代码来源:customizer.php

示例11: vantage_premium_mobile_image_setup

/**
 * Add extras sizes for adaptive images
 */
function vantage_premium_mobile_image_setup()
{
    if (siteorigin_setting('general_adaptive_images')) {
        // Add image sizes for different versions
        add_image_size('vantage-thumbnail-mobile', 330, 174, true);
        add_image_size('vantage-thumbnail-no-sidebar-mobile', 330, 116, true);
        // Add all the relevant hooks
        add_filter('wp_get_attachment_image_attributes', 'vantage_premium_filter_thumbnail_attributes', 10, 5);
    }
}
开发者ID:supahseppe,项目名称:sumar,代码行数:13,代码来源:picturefill.php

示例12: pitch_project_init

/**
 * Initialize the project type
 * 
 * @action init
 */
function pitch_project_init()
{
    $labels = array('name' => _x('Projects', 'post type general name', 'pitch'), 'singular_name' => _x('Project', 'post type singular name', 'pitch'), 'add_new' => _x('Add New', 'book', 'pitch'), 'add_new_item' => __('Add New Project', 'pitch'), 'edit_item' => __('Edit Project', 'pitch'), 'new_item' => __('New Project', 'pitch'), 'all_items' => __('All Projects', 'pitch'), 'view_item' => __('View Project', 'pitch'), 'search_items' => __('Search Projects', 'pitch'), 'not_found' => __('No projects found', 'pitch'), 'not_found_in_trash' => __('No projects found in Trash', 'pitch'), 'parent_item_colon' => '', 'menu_name' => __('Projects', 'pitch'));
    $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array('slug' => siteorigin_setting('project_url_slug')), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments'), 'menu_icon' => get_template_directory_uri() . '/images/post-types/project-small.png');
    register_post_type('project', $args);
    // Now register the skills taxonomy
    if (siteorigin_setting('project_tags')) {
        $labels = array('name' => __('Skills', 'pitch'), 'singular_name' => __('Skill', 'pitch'), 'search_items' => __('Search Skills', 'pitch'), 'all_items' => __('All Skills', 'pitch'), 'parent_item' => __('Parent Skill', 'pitch'), 'parent_item_colon' => __('Parent Skill:', 'pitch'), 'edit_item' => __('Edit Skill', 'pitch'), 'update_item' => __('Update Skill', 'pitch'), 'add_new_item' => __('Add New Skill', 'pitch'), 'new_item_name' => __('New Skill Name', 'pitch'), 'menu_name' => __('Skill', 'pitch'));
        register_taxonomy('skill', 'project', array('hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => 'skill')));
    }
}
开发者ID:Ksajikyan,项目名称:poiskuslug.ru,代码行数:16,代码来源:project.php

示例13: vantage_metaslider_page_setting_metabox_render

function vantage_metaslider_page_setting_metabox_render($post)
{
    $metaslider = get_post_meta($post->ID, 'vantage_metaslider_slider', true);
    $is_home = $post->ID == get_option('page_on_front');
    // If we're on the home page and the user hasn't explicitly set something here use the 'home_slider' theme setting.
    if ($is_home && empty($metaslider)) {
        $metaslider = siteorigin_setting('home_slider');
    }
    // Default stretch setting to theme setting.
    $metaslider_stretch = siteorigin_setting('home_slider_stretch');
    //Include the demo slider in the options if it's the home page.
    $options = siteorigin_metaslider_get_options($is_home);
    if (metadata_exists('post', $post->ID, 'vantage_metaslider_slider_stretch')) {
        $metaslider_stretch = get_post_meta($post->ID, 'vantage_metaslider_slider_stretch', true);
    }
    ?>
	<label><strong><?php 
    _e('Display Page Meta Slider', 'vantage');
    ?>
</strong></label>
	<p>
		<select name="vantage_page_metaslider">
			<?php 
    foreach ($options as $id => $name) {
        ?>
				<option value="<?php 
        echo esc_attr($id);
        ?>
" <?php 
        selected($metaslider, $id);
        ?>
><?php 
        echo esc_html($name);
        ?>
</option>
			<?php 
    }
    ?>
		</select>
	</p>
	<p class="checkbox-wrapper">
		<input id="vantage_page_metaslider_stretch" name="vantage_page_metaslider_stretch" type="checkbox" <?php 
    checked($metaslider_stretch);
    ?>
 />
		<label for="vantage_page_metaslider_stretch"><?php 
    _e('Stretch Page Meta Slider', 'vantage');
    ?>
</label>
	</p>
	<?php 
    wp_nonce_field('save', '_vantage_metaslider_nonce');
}
开发者ID:simplon-emmanuelD,项目名称:Simplon-INESS,代码行数:53,代码来源:metaslider.php

示例14: siteorigin_mobilenav_enqueue_scripts

 /**
  * Enqueue everything for the mobile navigation.
  *
  * @action wp_enqueue_scripts
  */
 function siteorigin_mobilenav_enqueue_scripts()
 {
     wp_enqueue_script('siteorigin-mobilenav', get_template_directory_uri() . '/inc/mobilenav/js/mobilenav' . SITEORIGIN_THEME_JS_PREFIX . '.js', array('jquery'), SITEORIGIN_THEME_VERSION);
     $text = array('navigate' => __('Menu', 'vantage'), 'back' => __('Back', 'vantage'), 'close' => __('Close', 'vantage'));
     if (siteorigin_setting('navigation_responsive_menu_text')) {
         $text['navigate'] = siteorigin_setting('navigation_responsive_menu_text');
     }
     $text = apply_filters('siteorigin_mobilenav_text', $text);
     $search = array('url' => get_home_url(), 'placeholder' => __('Search', 'vantage'));
     $search = apply_filters('siteorigin_mobilenav_search', $search);
     wp_localize_script('siteorigin-mobilenav', 'mobileNav', array('search' => $search, 'text' => $text, 'nextIconUrl' => get_template_directory_uri() . '/inc/mobilenav/images/next.png'));
     wp_enqueue_style('siteorigin-mobilenav', get_template_directory_uri() . '/inc/mobilenav/css/mobilenav.css', array(), SITEORIGIN_THEME_VERSION);
 }
开发者ID:siteorigin,项目名称:vantage,代码行数:18,代码来源:mobilenav.php

示例15: ultra_body_classes

/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function ultra_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    // Adds a class of content-none if there are no posts.
    if (!have_posts()) {
        $classes[] = 'content-none';
    }
    // Add widget-dependent classes.
    if (!is_active_sidebar('sidebar-1')) {
        $classes[] = 'one-column';
    }
    // Add a class if the sidebar is use.
    if (is_active_sidebar('sidebar-1')) {
        $classes[] = 'sidebar';
    }
    // Add the layout bound dependent classes.
    if (siteorigin_setting('layout_bound') == 'full') {
        $classes[] = 'full';
    }
    if (siteorigin_setting('layout_bound') == 'boxed') {
        $classes[] = 'boxed';
    }
    // Add a class if responsive layout is enabled.
    if (siteorigin_setting('layout_responsive')) {
        $classes[] = 'resp';
    }
    // Add a class if responsive top bar is enabled.
    if (siteorigin_setting('navigation_responsive_top_bar')) {
        $classes[] = 'resp-top-bar';
    }
    // Add a class if viewed on mobile.
    if (wp_is_mobile()) {
        $classes[] = 'mobile-device';
    }
    // Add a class if the tagline is enabled.
    if (siteorigin_setting('header_tagline')) {
        $classes[] = 'tagline';
    }
    // Add a class if the page slider overlap is true.
    if (get_post_meta(get_the_ID(), 'ultra_metaslider_slider_overlap', true) == true || is_front_page() && is_home() && siteorigin_setting('home_slider') != 'none' && siteorigin_setting('home_header_overlaps') == true) {
        $classes[] = 'overlap';
    }
    return $classes;
}
开发者ID:conao,项目名称:huso-theme,代码行数:53,代码来源:extras.php


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