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


PHP yit_get_option函数代码示例

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


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

示例1: load_options_font

    /**
     * Load Google Fonts stylesheets
     *
     * @return void
     * @since 1.0.0
     */
    public function load_options_font() {
        $theme_options_fonts = yit_get_option_by( 'type', 'typography' );
        $google_fonts = yit_get_google_fonts();
        $google_fonts = array_map( 'stripslashes', ( array ) $google_fonts->items );

        foreach( $theme_options_fonts as $option ) {
            $option_value = yit_get_option( $option['id'] );


            if ( ! array_key_exists( 'family', $option_value ) ) {
                continue;
            }

            if( $option_value['family'] != $option['std']['family'] ) {
                $family = $option_value['family'];
            } else {
                $family = $option['std']['family'];
            }

            if( in_array( $family, $google_fonts ) ) {
                //yit_enqueue_style( 600, 'font-' . sanitize_title( preg_replace( '/:(.*)?/', '', $option['std']['family'] ) ), yit_ssl_url( '//fonts.googleapis.com/css?family=' . $option['std']['family'] ) );
                yit_add_google_font( $family );
            }
        }
    }
开发者ID:simonsays88,项目名称:costa,代码行数:31,代码来源:Font.php

示例2: widget

    function widget( $args, $instance ) {
        extract( $args );   
        
        /* Impostazioni di default del widget */
        $defaults = array( 
            'title' => __( 'Categories', 'yit' ),
            'show_count' => 1
        );
        
        $instance = wp_parse_args( (array) $instance, $defaults ); 

        $title = apply_filters('widget_title', $instance['title'] );
        
        echo $before_widget;
        echo $before_title . $title . $after_title;
        
        echo '<ul id="almost_all_categories_widget">';
            $cat_params = Array(
                    'hide_empty'    =>  FALSE,
                    'title_li'      =>  '',
                    'show_count'    =>  $instance['show_count']
                );                                                  
            $exclude = maybe_unserialize( yit_get_option( 'blog-cats-exclude' ) );
            if( ! empty( $exclude[2] ) ){
                $cat_params['exclude'] = array_map('trim', $exclude[2] );
            }
            wp_list_categories( $cat_params );
        echo '</ul>';
        echo $after_widget;
    }                     
开发者ID:simonsays88,项目名称:costa,代码行数:30,代码来源:almost_all_categories.php

示例3: display

	/**
	 * Load and print the correspondent field type.
	 * 
	 * @param @field
	 * @return string
	 */
	public static function display( $value, $dep ) {            
		ob_start(); ?>
			<div id="<?php echo $value['id_container'] ?>" <?php if($dep): ?>data-field="<?php echo $dep['field'] ?>" data-dep="<?php echo $dep['dep'] ?>" data-value="<?php echo $dep['value'] ?>" <?php endif ?>class="yit_options rm_option rm_input rm_text rm_connectedlist">
                <div class="option">
                    <label for="<?php echo $value['id'] ?>"><?php echo $value['name'] ?></label>

					<?php $yit_option = json_decode( stripslashes( yit_get_option( $value['id'] ) ), true ); ?>
					<?php $value['lists'] = is_array($yit_option) ? $yit_option : $value['lists']; ?>

					<?php foreach( $value['lists'] as $list=>$options ): ?>
					<div class="list_container">
						<h4><?php echo $value['heads'][$list] ?></h4>
						<ul id="list_<?php echo $list ?>" class="connectedSortable" data-list="<?php echo $list ?>">
							<?php foreach( $options as $option=>$label ): ?>
	                    		<li data-option="<?php echo $option ?>" class="ui-state-default"><?php echo $label ?></li>
	                    	<?php endforeach ?>
	                    </ul>
                    </div>
					<?php endforeach ?>
					<input type="hidden" name="<?php yit_field_name( $value['id'] ) ?>" id="<?php echo $value['id'] ?>" value='<?php echo yit_get_option( $value['id'] ) ?>' />
                </div>
                <div class="description">
                    <?php echo $value['desc'] ?>
                </div>
                <div class="clear"></div>
            </div>
        <?php
		return ob_get_clean();
	}
开发者ID:simonsays88,项目名称:costa,代码行数:35,代码来源:Connectedlist.php

示例4: add_menu_page

 /**
  * Create the theme menu in admin area
  *
  * In order to load new submenu pages just add a new class within
  * the panel/ folder in core or theme.
  *
  * @since  Version 2.0.0
  * @return void
  * @author Simone D'Amico <simone.damico@yithemes.com>
  */
 public function add_menu_page()
 {
     $logo = YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png';
     $admin_logo = yit_get_option("admin-logo-menu");
     if (isset($admin_logo) && !empty($admin_logo) && $admin_logo != "") {
         $logo = $admin_logo;
     }
     //create menu page
     add_menu_page($this->theme->Name, $this->theme->Name, 'manage_options', 'yit_panel', NULL, $logo, 61);
     //load new sub menu pages
     $submenuPaths = apply_filters('yit_panel_submenu_paths', array(YIT_THEME_PATH . '/yit/panel', YIT_CORE_PATH . '/yit/panel'));
     foreach ($submenuPaths as $path) {
         $path .= '/*.php';
         foreach ((array) glob($path) as $submenu) {
             if (!$submenu) {
                 continue;
             }
             $class = 'YIT_Panel_' . basename($submenu, '.php');
             if (!class_exists($class)) {
                 include_once $submenu;
                 $class = new $class();
                 $this->_submenuPages[$class->priority] = $class;
             }
         }
     }
 }
开发者ID:lieison,项目名称:IndustriasFenix,代码行数:36,代码来源:Panel.php

示例5: 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;
        }
开发者ID:gloomyghost,项目名称:Tip-Top-Art,代码行数:35,代码来源:search_mini.php

示例6: enqueue

 /**
  * Enqueue stylesheets with wp_enqueue_style
  *
  * @return void
  * @since 1.0.0
  */
 public function enqueue()
 {
     $subsets = yit_get_option('google_fonts_subsets');
     $subsets = $subsets ? 'subset=' . implode(',', $subsets) . '&' : '';
     $base_url = '//fonts.googleapis.com/css?' . $subsets . 'family=';
     $i = 0;
     $srcs = array($base_url);
     if (yit_ie_version() > 8 || yit_ie_version() == -1) {
         foreach ($this->fonts as $font) {
             if (strlen($srcs[$i] . $font) > 1024) {
                 $i++;
                 $srcs[$i] = $base_url;
             }
             $srcs[$i] .= $font . '|';
         }
         foreach ($srcs as $k => $src) {
             $index = count($srcs) > 1 ? '-' . ($k + 1) : '';
             wp_enqueue_style('google-fonts' . $index, rtrim(str_replace(' ', '+', $src), '|'));
         }
     } else {
         foreach ($this->fonts as $font) {
             wp_enqueue_style($font . '-font', $base_url . str_replace(' ', '+', $font));
         }
     }
 }
开发者ID:jayeshnair,项目名称:ctp,代码行数:31,代码来源:Google_font.php

示例7: yit_print_mobile_favicons

 /**
  * Print the html for mobile devices favicons.
  *
  * @return string
  * @author Andrea Frascaspata    <andrea.frascaspata@yithems.com>
  * @since 1.0.0
  */
 function yit_print_mobile_favicons()
 {
     // 144: For iPad3 with retina display:
     // 114: for first- and second-generation iPad
     //  72: For first- and second-generation iPad
     //  57: For non-Retina iPhone, iPod Touch, and Android 2.1+ devices
     $size_list = array(144, 114, 72, 57);
     $favicon_base_url = yit_get_option('general-favicon-touch');
     //yit default favicons
     if ($favicon_base_url === false || empty($favicon_base_url) || $favicon_base_url == get_template_directory_uri() . '/apple-touch-icon-144x.png') {
         foreach ($size_list as $size) {
             $favicon_url = get_template_directory_uri() . '/apple-touch-icon-' . $size . 'x.png';
             if (is_ssl()) {
                 $favicon_url = str_replace('http://', 'https://', $favicon_url);
             }
             echo '<link rel="apple-touch-icon-precomposed" sizes="' . $size . 'x' . $size . '" href="' . $favicon_url . '" />';
         }
     } else {
         foreach ($size_list as $size) {
             $size_name = 'favicon_' . $size;
             add_image_size($size_name, $size, $size, true);
             $args['src'] = $favicon_base_url;
             $args['output'] = 'url';
             $args['size'] = $size_name;
             $url = yit_image($args, false);
             echo '<link rel="apple-touch-icon-precomposed" sizes="' . $size . 'x' . $size . '" href="' . $url . '" />';
         }
     }
 }
开发者ID:lieison,项目名称:IndustriasFenix,代码行数:36,代码来源:head.php

示例8: display

    /**
     * Load and print the correspondent field type.
     * 
     * @param @field
     * @return string
     */
    public static function display($value, $dep)
    {
        ob_start();
        ?>
			<div id="<?php 
        echo $value['id_container'];
        ?>
" <?php 
        if ($dep) {
            ?>
data-field="<?php 
            echo $dep['field'];
            ?>
" data-dep="<?php 
            echo $dep['dep'];
            ?>
" data-value="<?php 
            echo $dep['value'];
            ?>
" <?php 
        }
        ?>
class="yit_options rm_option rm_input rm_text">
                <div class="option">
                <label for="<?php 
        echo $value['id'];
        ?>
"><?php 
        echo $value['name'];
        ?>
</label>
                <input type="text" name="<?php 
        yit_field_name($value['id']);
        ?>
" id="<?php 
        echo $value['id'];
        ?>
" value="<?php 
        echo yit_get_option($value['id']);
        ?>
" />
                <input type="submit" value="<?php 
        echo $value['submit'];
        ?>
" id="<?php 
        echo $value['id'];
        ?>
-button" class="input_button button" />
                </div>
                <div class="description">
                    <?php 
        echo $value['desc'];
        ?>
                </div>
                <div class="clear"></div>
            </div>
        <?php 
        return ob_get_clean();
    }
开发者ID:eugenehiggins,项目名称:wellnessrx,代码行数:65,代码来源:Textsubmit.php

示例9: 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 
    }
开发者ID:lieison,项目名称:IndustriasFenix,代码行数:68,代码来源:YIT_Widget_Cart.php

示例10: add_skin_css

 /**
  * Include the skin css for custom style of each skin
  */
 public function add_skin_css()
 {
     $skin = yit_get_option('skin');
     if (empty($skin)) {
         return;
     }
     yit_enqueue_style(5000, 'skin-' . $skin, YIT_THEME_CSS_URL . '/skins/' . $skin . '.css', false, array(), false, 'all', true);
 }
开发者ID:jayeshnair,项目名称:ctp,代码行数:11,代码来源:Skin.php

示例11: display

    /**
     * Load and print the correspondent field type.
     * 
     * @param @field
     * @return string
     */
    public static function display($value, $dep)
    {
        ob_start();
        ?>
			<div id="<?php 
        echo $value['id_container'];
        ?>
" <?php 
        if ($dep) {
            ?>
data-field="<?php 
            echo $dep['field'];
            ?>
" data-dep="<?php 
            echo $dep['dep'];
            ?>
" data-value="<?php 
            echo $dep['value'];
            ?>
" <?php 
        }
        ?>
class="yit_options rm_option rm_input rm_checkbox">
                <div class="option">
                    <label for="<?php 
        echo $value['id'];
        ?>
"><?php 
        echo $value['name'];
        ?>
</label>
                    <input type="checkbox" class="checkbox-inline" name="<?php 
        yit_field_name($value['id']);
        ?>
" id="<?php 
        echo $value['id'];
        ?>
" value="1" <?php 
        checked(yit_get_option($value['id']), true);
        ?>
 /> <label for="<?php 
        echo $value['id'];
        ?>
"><?php 
        echo $value['name'];
        ?>
</label>
                </div>
                <div class="description">
                    <?php 
        echo $value['desc'];
        ?>
                </div>
                <div class="clear"></div>
            </div>
        <?php 
        return ob_get_clean();
    }
开发者ID:jayeshnair,项目名称:ctp,代码行数:64,代码来源:Checkbox.php

示例12: display_page

    /**
     * Display tab html code
     * 
     * @return string
     * @since 1.0.0
     */
    public function display_page()
    {
        $skins = yit_get_model('skin')->skins;
        ?>
			<div id="skins_skins" class="yit_options rm_option rm_input rm_text">
                <div class="option">
                	<?php 
        if (!empty($skins)) {
            ?>
                    <label for="skin"><?php 
            _e('Choose a skin to use', 'yit');
            ?>
</label>
	                <div class="select_wrapper">
	                    <select name="skin" id="skin">
							<?php 
            foreach ($skins as $id => $name) {
                ?>
							<option value="<?php 
                echo $id;
                ?>
"<?php 
                selected($id, yit_get_option('skin'));
                ?>
><?php 
                echo $name;
                ?>
</option>
							<?php 
            }
            ?>
	                    </select>
	                </div>                    
					<input type="submit" value="<?php 
            _e('Apply', 'yit');
            ?>
" class="button" name="apply-skin" id="apply-skin" />
					<?php 
        } else {
            ?>
					<?php 
            _e('No skin to select.', 'yit');
            ?>
					<?php 
        }
        ?>
                </div>
                <div class="description">
					<?php 
        _e('Apply skin you want to use. This will replace some options in the theme options.', 'yit');
        ?>
                </div>
                <div class="clear"></div>
            </div>
<?php 
    }
开发者ID:jayeshnair,项目名称:ctp,代码行数:62,代码来源:Skins.php

示例13: send_email

 public function send_email()
 {
     if (!wp_verify_nonce($_REQUEST['_nonce'], 'yit-contact-popup-nonce')) {
         die('You are not authorized!');
     }
     //yit_get_model('contact_form')->send_email();
     $contact = yit_get_option('contact-popup');
     echo do_shortcode('[contact_form name="' . $contact . '" ]');
     die;
 }
开发者ID:jayeshnair,项目名称:ctp,代码行数:10,代码来源:Contact_Popup.php

示例14: add_setting_page

 /**
  * Add Setting SubPage
  *
  * add Setting SubPage to wordpress administrator
  *
  * @return array validate input fields
  * @since    1.0
  * @author   Emanuela Castorina <emanuela.castorina@yithemes.it>
  */
 public function add_setting_page()
 {
     $logo = YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png';
     $admin_logo = function_exists('yit_get_option') ? yit_get_option('admin-logo-menu') : '';
     if (isset($admin_logo) && !empty($admin_logo) && $admin_logo != '' && $admin_logo) {
         $logo = $admin_logo;
     }
     add_menu_page('yit_plugin_panel', __('YIT Plugins', 'yit'), 'nosuchcapability', 'yit_plugin_panel', NULL, $logo, 62);
     add_submenu_page('yit_plugin_panel', $this->settings['label'], $this->settings['label'], 'manage_options', $this->settings['page'], array($this, 'yit_panel'));
     remove_submenu_page('yit_plugin_panel', 'yit_plugin_panel');
 }
开发者ID:NgocSon2412,项目名称:website_banhang,代码行数:20,代码来源:yit-plugin-subpanel.php

示例15: widget

    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $project_post_types = isset($instance['project_post_type']) ? $instance['project_post_type'] : 0;
        echo $before_widget . '<div class="border">';
        echo $before_title . $title . $after_title;
        ?>
		<!--<p><a href="#all" data-option-value="*" class="all active"><?php 
        _e('View all', 'yit');
        ?>
</a> <?php 
        _e('or filter by:', 'yit');
        ?>
</p>-->
		<p><?php 
        _e('filter by:', 'yit');
        ?>
</p>
		<?php 
        $faq = new WP_Query("post_type=faq");
        $cat_args = "taxonomy=category-faq&title_li=";
        if (!empty($instance['include'])) {
            $cat_args .= '&include=' . $instance['include'];
        }
        $cat = get_categories($cat_args);
        $allicon = yit_get_option('faq-allcategories-url');
        if (!$faq->have_posts()) {
            return false;
        }
        ?>
			<ul>
				<li><img src="<?php 
        echo $allicon ? $allicon : YIT_IMAGES_URL . '/faq/all.png';
        ?>
" /><a href="#all" data-option-value="*" class="active"><?php 
        echo apply_filters('yit_faq_filters_categories_all', __('All', 'yit'));
        ?>
</a></li>
				<?php 
        foreach ($cat as $c) {
            $thumbnail_id = get_metadata('faq_term', $c->term_id, 'thumbnail_id', true);
            $image = wp_get_attachment_url($thumbnail_id);
            echo '<li>';
            if (!empty($image)) {
                echo '<img src="' . $image . '" />';
            }
            echo '<a href="#' . urldecode(sanitize_title($c->slug)) . '" data-option-value=".' . urldecode(sanitize_title($c->slug)) . '">' . $c->name . '</a></li>';
        }
        ?>
			</ul>
		<?php 
        echo '</div>' . $after_widget;
    }
开发者ID:zgomotos,项目名称:Bazar,代码行数:54,代码来源:faq_filters.php


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