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


PHP isValidKey函数代码示例

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


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

示例1: form

    function form($instance)
    {
        if (isValidKey()) {
            $instance = wp_parse_args((array) $instance, array('title' => ''));
            $title = $instance['title'];
            $testimonial_categories = get_terms('easy-testimonial-category', 'orderby=title&hide_empty=0');
            ?>

				<p><label for="<?php 
            echo $this->get_field_id('title');
            ?>
">Title: <input class="widefat" id="<?php 
            echo $this->get_field_id('title');
            ?>
" name="<?php 
            echo $this->get_field_name('title');
            ?>
" type="text" value="<?php 
            echo esc_attr($title);
            ?>
" /></label></p>
			<?php 
        } else {
            ?>

			<p><strong>Please Note:</strong><br/> This Feature Requires Easy Testimonials Pro.</p>
			<p><a href="https://goldplugins.com/our-plugins/easy-testimonials-details/upgrade-to-easy-testimonials-pro/?utm_source=submit_testimonials_widget&utm_campaign=up
				grade" target="_blank">Upgrade to Pro</a></p>
			<?php 
        }
    }
开发者ID:virendrayadav,项目名称:bigperlus,代码行数:31,代码来源:submit_testimonial_widget.php

示例2: __construct

 function __construct()
 {
     $this->theme_array = $this->load_theme_array();
     $this->free_theme_array = $this->load_free_theme_array();
     $this->pro_theme_array = $this->load_pro_theme_array();
     $this->cycle_transitions = $this->load_cycle_transitions();
     $this->dir_path = plugin_dir_path(__FILE__);
     $this->url_path = plugin_dir_url(__FILE__);
     $this->is_pro = isValidKey();
     $this->do_export = isset($_POST['_easy_t_do_export']) && $_POST['_easy_t_do_export'] == '_easy_t_do_export' ? true : false;
     $this->cache_time = get_option('easy_t_cache_time', 900);
     //default to 15 minutes
     $this->cache_enabled = get_option('easy_t_cache_enabled', true);
     //default to true
     $this->typography_cache_key = $this->generate_typography_cache_key();
 }
开发者ID:benshez,项目名称:DreamWeddingCeremonies,代码行数:16,代码来源:config.php

示例3: form

    function form($instance)
    {
        // load config
        $curr_dir = dirname(dirname(__FILE__));
        $config_path = $curr_dir . "/lib/config.php";
        include $config_path;
        $defaults = array('title' => '', 'count' => 5, 'show_title' => 0, 'category' => '', 'use_excerpt' => 0, 'show_rating' => false, 'show_date' => false, 'width' => false, 'show_testimonial_image' => 1, 'order' => 'ASC', 'order_by' => 'date', 'show_other' => 0, 'theme' => '', 'testimonials_per_slide' => 1, 'show_pager_icons' => 1, 'transition' => 'fade', 'timer' => '5000', 'pause_on_hover' => 1, 'paused' => 0, 'prev_next' => 1, 'auto_height' => 1);
        $instance = wp_parse_args((array) $instance, $defaults);
        $title = $instance['title'];
        $count = $instance['count'];
        $testimonials_per_slide = $instance['testimonials_per_slide'];
        $show_title = $instance['show_title'];
        $show_rating = $instance['show_rating'];
        $use_excerpt = $instance['use_excerpt'];
        $category = $instance['category'];
        $show_date = $instance['show_date'];
        $width = $instance['width'];
        $show_testimonial_image = $instance['show_testimonial_image'];
        $order = $instance['order'];
        $order_by = $instance['order_by'];
        $show_other = $instance['show_other'];
        $theme = $instance['theme'];
        $testimonial_categories = get_terms('easy-testimonial-category', 'orderby=title&hide_empty=0');
        $ip = isValidKey();
        $testimonials_per_slide = $instance['testimonials_per_slide'];
        $show_pager_icons = $instance['show_pager_icons'];
        $transition = $instance['transition'];
        $timer = $instance['timer'];
        $pause_on_hover = $instance['pause_on_hover'];
        $paused = $instance['paused'];
        $prev_next = $instance['prev_next'];
        $auto_height = $instance['auto_height'];
        ?>
		<div class="gp_widget_form_wrapper">
			<p>
				<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">Widget Title:</label>
				<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo esc_attr($title);
        ?>
" />
			</p>
			
			<p>
				<label for="<?php 
        echo $this->get_field_id('theme');
        ?>
">Theme:</label><br/>
				<select name="<?php 
        echo $this->get_field_name('theme');
        ?>
" id="<?php 
        echo $this->get_field_id('theme');
        ?>
">	
					<optgroup label="Free Themes">
					<?php 
        foreach ($free_theme_array as $key => $theme_name) {
            ?>
						<option value="<?php 
            echo $key;
            ?>
" <?php 
            if ($theme == $key) {
                echo 'selected="SELECTED"';
            }
            ?>
><?php 
            echo htmlentities($theme_name);
            ?>
</option>					
					<?php 
        }
        ?>
					</optgroup>
					<?php 
        foreach ($pro_theme_array as $group_key => $theme_group) {
            ?>
						<?php 
            $group_label = $this->get_theme_group_label($theme_group);
            ?>
							<?php 
            if (!$ip) {
                ?>
							<optgroup  disabled="disabled" label="<?php 
                echo htmlentities($group_label);
                ?>
 (Pro)">
							<?php 
            } else {
                ?>
							<optgroup  label="<?php 
//.........这里部分代码省略.........
开发者ID:premsingh4github,项目名称:SAL,代码行数:101,代码来源:testimonial_cycle_widget.php

示例4: form

    function form($instance)
    {
        // load config
        $curr_dir = dirname(dirname(__FILE__));
        $config_path = $curr_dir . "/lib/config.php";
        include $config_path;
        $defaults = array('title' => '', 'count' => 5, 'show_title' => 0, 'category' => '', 'use_excerpt' => 0, 'show_rating' => false, 'show_date' => false, 'width' => false, 'show_testimonial_image' => 0, 'order' => 'ASC', 'order_by' => 'date', 'show_other' => 0, 'theme' => '');
        $instance = wp_parse_args((array) $instance, $defaults);
        $title = $instance['title'];
        $count = $instance['count'];
        $show_title = $instance['show_title'];
        $show_rating = $instance['show_rating'];
        $use_excerpt = $instance['use_excerpt'];
        $category = $instance['category'];
        $show_date = $instance['show_date'];
        $width = $instance['width'];
        $show_testimonial_image = $instance['show_testimonial_image'];
        $order = $instance['order'];
        $order_by = $instance['order_by'];
        $show_other = $instance['show_other'];
        $theme = $instance['theme'];
        $testimonial_categories = get_terms('easy-testimonial-category', 'orderby=title&hide_empty=0');
        $ip = isValidKey();
        ?>
		<div class="gp_widget_form_wrapper">
			<p>
				<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">Widget Title:</label>
				<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo esc_attr($title);
        ?>
" />
			</p>			
		
			<p>
				<label for="<?php 
        echo $this->get_field_id('theme');
        ?>
">Theme:</label><br/>
				<select name="<?php 
        echo $this->get_field_name('theme');
        ?>
" id="<?php 
        echo $this->get_field_id('theme');
        ?>
">	
					<optgroup label="Free Themes">
					<?php 
        foreach ($free_theme_array as $key => $theme_name) {
            ?>
						<option value="<?php 
            echo $key;
            ?>
" <?php 
            if ($theme == $key) {
                echo 'selected="SELECTED"';
            }
            ?>
><?php 
            echo htmlentities($theme_name);
            ?>
</option>					
					<?php 
        }
        ?>
					</optgroup>
					<?php 
        foreach ($pro_theme_array as $group_key => $theme_group) {
            ?>
						<?php 
            $group_label = $this->get_theme_group_label($theme_group);
            ?>
							<?php 
            if (!$ip) {
                ?>
							<optgroup  disabled="disabled" label="<?php 
                echo htmlentities($group_label);
                ?>
 (Pro)">
							<?php 
            } else {
                ?>
							<optgroup  label="<?php 
                echo htmlentities($group_label);
                ?>
">
							<?php 
            }
            ?>
							<?php 
            foreach ($theme_group as $key => $theme_name) {
                ?>
//.........这里部分代码省略.........
开发者ID:evdant,项目名称:firstwp,代码行数:101,代码来源:random_testimonial_widget.php

示例5: get_theme_group_label

//free and pro theme arrays are stored in config.php
include "lib/config.php";
//some functions for theme output
function get_theme_group_label($theme_group)
{
    reset($theme_group);
    $first_key = key($theme_group);
    $group_label = $theme_group[$first_key];
    if (($dash_pos = strpos($group_label, ' -')) !== FALSE && ($avatar_pos = strpos($group_label, 'Avatar')) === FALSE) {
        $group_label = substr($group_label, 0, $dash_pos);
    }
    return $group_label;
}
//check for pro
$ip = isValidKey();
//load currently selected theme
$theme = get_option('testimonials_style');
?>
		
		<form method="post" action="options.php"><?php 
if (!$ip) {
    ?>
			<p class="plugin_is_not_registered"><a href="https://goldplugins.com/our-plugins/easy-testimonials-details/upgrade-to-easy-testimonials-pro/?utm_source=themes"><?php 
    _e('Upgrade to Easy Testimonials Pro now', 'easy-testimonials');
    ?>
</a> <?php 
    _e('to unlock all 75+ themes!', 'easy-testimonials');
    ?>
 </p>
		<?php 
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:30,代码来源:theme_options.php

示例6: easy_testimonials_build_typography_css

function easy_testimonials_build_typography_css($prefix, $extra = '')
{
    $css_rule_template = ' %s: %s;';
    $output = '';
    if (!isValidKey()) {
        return $output;
    }
    /*
     * Font Family
     */
    $option_val = get_option($prefix . 'font_family', '');
    if (!empty($option_val)) {
        // strip off 'google:' prefix if needed
        $option_val = str_replace('google:', '', $option_val);
        // wrap font family name in quotes
        $option_val = '\'' . $option_val . '\'';
        $output .= sprintf($css_rule_template, 'font-family', $option_val);
    }
    /*
     * Font Size
     */
    $option_val = get_option($prefix . 'font_size', '');
    if (!empty($option_val)) {
        // append 'px' if needed
        if (is_numeric($option_val)) {
            $option_val .= 'px';
        }
        $output .= sprintf($css_rule_template, 'font-size', $option_val);
    }
    /*
     * Font Style - add font-style and font-weight rules
     * NOTE: in this special case, we are adding 2 rules!
     */
    $option_val = get_option($prefix . 'font_style', '');
    // Convert the value to 2 CSS rules, font-style and font-weight
    // NOTE: we lowercase the value before comparison, for simplification
    switch (strtolower($option_val)) {
        case 'regular':
            // not bold not italic
            $output .= sprintf($css_rule_template, 'font-style', 'normal');
            $output .= sprintf($css_rule_template, 'font-weight', 'normal');
            break;
        case 'bold':
            // bold, but not italic
            $output .= sprintf($css_rule_template, 'font-style', 'normal');
            $output .= sprintf($css_rule_template, 'font-weight', 'bold');
            break;
        case 'italic':
            // italic, but not bold
            $output .= sprintf($css_rule_template, 'font-style', 'italic');
            $output .= sprintf($css_rule_template, 'font-weight', 'normal');
            break;
        case 'bold italic':
            // bold and italic
            $output .= sprintf($css_rule_template, 'font-style', 'italic');
            $output .= sprintf($css_rule_template, 'font-weight', 'bold');
            break;
        default:
            // empty string or other invalid value, ignore and move on
            break;
    }
    /*
     * Font Color
     * RWG: Moved this after other options so that, for Stars display 
     *      we can empty $output and start over with just the font color
     *      preventing the user from accidentally doing crazy things with their stars
     */
    //RWG: if this is the Rating and extra is set to Stars, only apply the chosen color (ie, wipe out the output string and start anew -- this prevents the user from accidentally breaking their stars display)
    if ($prefix == "easy_t_rating_" && $extra == "stars") {
        $output = "";
    }
    $option_val = get_option($prefix . 'font_color', '');
    if (!empty($option_val)) {
        $output .= sprintf($css_rule_template, 'color', $option_val);
    }
    // return the completed CSS string
    return trim($output);
}
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:78,代码来源:easy-testimonials.php

示例7: form

    function form($instance)
    {
        // load config
        $curr_dir = dirname(dirname(__FILE__));
        $config_path = $curr_dir . "/lib/config.php";
        include $config_path;
        $defaults = array('title' => '', 'count' => 10, 'show_title' => 0, 'category' => '', 'use_excerpt' => 0, 'show_rating' => false, 'show_date' => false, 'cols' => 3, 'show_testimonial_image' => 0, 'order' => 'ASC', 'order_by' => 'date', 'show_other' => 0, 'theme' => '');
        $instance = wp_parse_args((array) $instance, $defaults);
        $title = $instance['title'];
        $count = $instance['count'];
        $show_title = $instance['show_title'];
        $show_rating = $instance['show_rating'];
        $use_excerpt = $instance['use_excerpt'];
        $category = $instance['category'];
        $show_date = isset($instance['show_date']) ? $instance['show_date'] : 1;
        $show_testimonial_image = isset($instance['show_testimonial_image']) ? $instance['show_testimonial_image'] : 1;
        $order = $instance['order'];
        $order_by = $instance['order_by'];
        $show_other = isset($instance['show_other']) ? $instance['show_other'] : 0;
        $theme = $instance['theme'];
        $testimonial_categories = get_terms('easy-testimonial-category', 'orderby=title&hide_empty=0');
        $cols = $instance['cols'];
        $grid_width = isset($instance['grid_width']) ? $instance['grid_width'] : '';
        $grid_spacing = isset($instance['grid_spacing']) ? $instance['grid_spacing'] : '';
        $grid_class = isset($instance['grid_class']) ? $instance['grid_class'] : '';
        $cell_width = isset($instance['cell_width']) ? $instance['cell_width'] : '';
        $responsive = isset($instance['responsive']) ? $instance['responsive'] : 1;
        $equal_height_rows = isset($instance['equal_height_rows']) ? $instance['equal_height_rows'] : 0;
        $ip = isValidKey();
        ?>

		<div class="gp_widget_form_wrapper">
			<p>
				<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">Widget Title:</label>
				<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo esc_attr($title);
        ?>
" />
			</p>			
		
			<p>
				<label for="<?php 
        echo $this->get_field_id('theme');
        ?>
">Theme:</label><br/>
				<select name="<?php 
        echo $this->get_field_name('theme');
        ?>
" id="<?php 
        echo $this->get_field_id('theme');
        ?>
">	
					<optgroup label="Free Themes">
					<?php 
        foreach ($free_theme_array as $key => $theme_name) {
            ?>

						<option value="<?php 
            echo $key;
            ?>
" <?php 
            if ($theme == $key) {
                echo 'selected="SELECTED"';
            }
            ?>
><?php 
            echo htmlentities($theme_name);
            ?>
</option>					
					<?php 
        }
        ?>

					</optgroup>
					<?php 
        foreach ($pro_theme_array as $group_key => $theme_group) {
            ?>

						<?php 
            $group_label = $this->get_theme_group_label($theme_group);
            ?>

							<?php 
            if (!$ip) {
                ?>

							<optgroup  disabled="disabled" label="<?php 
                echo htmlentities($group_label);
                ?>
 (Pro)">
							<?php 
//.........这里部分代码省略.........
开发者ID:virendrayadav,项目名称:bigperlus,代码行数:101,代码来源:testimonial_grid_widget.php

示例8:

    }
    ?>
	value="<?php 
    echo $slug;
    ?>
" <?php 
    if (get_option('testimonials_style') == $slug) {
        echo 'checked="CHECKED"';
    }
    ?>
><label for="<?php 
    echo $slug;
    ?>
"><?php 
    echo $name;
    if (!isValidKey()) {
        ?>
<br/><em>Requires PRO - Upgrade to Enable!</em><?php 
    }
    ?>
<br/><img src="<?php 
    echo plugins_url('img/easy-t-' . str_replace('_', '-', str_replace('_style', '', $slug)) . '.png', __FILE__);
    ?>
"/></label></p>
					<?php 
}
?>
					<div style="clear:both;"></div>
				</td>
			</tr>
		</table>
开发者ID:evdant,项目名称:firstwp,代码行数:31,代码来源:theme_options.php

示例9: typography_input

 function typography_input($name, $label, $description)
 {
     global $EasyT_BikeShed;
     $options = array();
     $options['name'] = $name;
     $options['label'] = $label;
     $options['description'] = $description;
     $options['google_fonts'] = true;
     $options['default_color'] = '#008800';
     $options['values'] = $this->get_typography_values($name);
     $options['disabled'] = !isValidKey();
     // typography inputs are Pro only
     $EasyT_BikeShed->typography($options);
 }
开发者ID:afifjawhary,项目名称:designcorp,代码行数:14,代码来源:easy_testimonial_options.php

示例10: easy_testimonials_build_typography_css

function easy_testimonials_build_typography_css($prefix)
{
    $css_rule_template = ' %s: %s;';
    $output = '';
    if (!isValidKey()) {
        return $output;
    }
    /*
     * Font Family
     */
    $option_val = get_option($prefix . 'font_family', '');
    if (!empty($option_val)) {
        // strip off 'google:' prefix if needed
        $option_val = str_replace('google:', '', $option_val);
        // wrap font family name in quotes
        $option_val = '\'' . $option_val . '\'';
        $output .= sprintf($css_rule_template, 'font-family', $option_val);
    }
    /*
     * Font Size
     */
    $option_val = get_option($prefix . 'font_size', '');
    if (!empty($option_val)) {
        // append 'px' if needed
        if (is_numeric($option_val)) {
            $option_val .= 'px';
        }
        $output .= sprintf($css_rule_template, 'font-size', $option_val);
    }
    /*
     * Font Color
     */
    $option_val = get_option($prefix . 'font_color', '');
    if (!empty($option_val)) {
        $output .= sprintf($css_rule_template, 'color', $option_val);
    }
    /*
     * Font Style - add font-style and font-weight rules
     * NOTE: in this special case, we are adding 2 rules!
     */
    $option_val = get_option($prefix . 'font_style', '');
    // Convert the value to 2 CSS rules, font-style and font-weight
    // NOTE: we lowercase the value before comparison, for simplification
    switch (strtolower($option_val)) {
        case 'regular':
            // not bold not italic
            $output .= sprintf($css_rule_template, 'font-style', 'normal');
            $output .= sprintf($css_rule_template, 'font-weight', 'normal');
            break;
        case 'bold':
            // bold, but not italic
            $output .= sprintf($css_rule_template, 'font-style', 'normal');
            $output .= sprintf($css_rule_template, 'font-weight', 'bold');
            break;
        case 'italic':
            // italic, but not bold
            $output .= sprintf($css_rule_template, 'font-style', 'italic');
            $output .= sprintf($css_rule_template, 'font-weight', 'normal');
            break;
        case 'bold italic':
            // bold and italic
            $output .= sprintf($css_rule_template, 'font-style', 'italic');
            $output .= sprintf($css_rule_template, 'font-weight', 'bold');
            break;
        default:
            // empty string or other invalid value, ignore and move on
            break;
    }
    // return the completed CSS string
    return trim($output);
}
开发者ID:premsingh4github,项目名称:SAL,代码行数:71,代码来源:easy-testimonials.php

示例11: form

    function form($instance)
    {
        // load config
        $curr_dir = dirname(dirname(__FILE__));
        $config_path = $curr_dir . "/lib/config.php";
        include $config_path;
        $defaults = array('title' => '', 'count' => 5, 'show_title' => 0, 'category' => '', 'use_excerpt' => 0, 'show_rating' => false, 'show_date' => false, 'width' => false, 'show_testimonial_image' => 0, 'order' => 'ASC', 'order_by' => 'date', 'show_other' => 0, 'theme' => get_option('testimonials_style', 'default_style'), 'paginate' => false, 'testimonials_per_page' => 10);
        $instance = wp_parse_args((array) $instance, $defaults);
        $title = $instance['title'];
        $count = $instance['count'];
        $show_title = $instance['show_title'];
        $show_rating = $instance['show_rating'];
        $use_excerpt = $instance['use_excerpt'];
        $category = $instance['category'];
        $show_date = $instance['show_date'];
        $width = $instance['width'];
        $show_testimonial_image = $instance['show_testimonial_image'];
        $order = $instance['order'];
        $order_by = $instance['order_by'];
        $show_other = $instance['show_other'];
        $theme = $instance['theme'];
        $paginate = $instance['paginate'];
        $testimonials_per_page = $instance['testimonials_per_page'];
        $testimonial_categories = get_terms('easy-testimonial-category', 'orderby=title&hide_empty=0');
        $ip = isValidKey();
        ?>
		<div class="gp_widget_form_wrapper">
			<p class="hide_in_popup">
				<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">Widget Title:</label>
				<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo esc_attr($title);
        ?>
" data-shortcode-hidden="1" />
			</p>			
		
			<p>
				<label for="<?php 
        echo $this->get_field_id('theme');
        ?>
">Theme:</label><br/>
				<select name="<?php 
        echo $this->get_field_name('theme');
        ?>
" id="<?php 
        echo $this->get_field_id('theme');
        ?>
">	
					<optgroup label="Free Themes">
					<?php 
        foreach ($free_theme_array as $key => $theme_name) {
            ?>
						<option value="<?php 
            echo $key;
            ?>
" <?php 
            if ($theme == $key) {
                echo 'selected="SELECTED"';
            }
            ?>
><?php 
            echo htmlentities($theme_name);
            ?>
</option>					
					<?php 
        }
        ?>
					</optgroup>
					<?php 
        foreach ($pro_theme_array as $group_key => $theme_group) {
            ?>
						<?php 
            $group_label = $this->get_theme_group_label($theme_group);
            ?>
							<?php 
            if (!$ip) {
                ?>
							<optgroup  disabled="disabled" label="<?php 
                echo htmlentities($group_label);
                ?>
 (Pro)">
							<?php 
            } else {
                ?>
							<optgroup  label="<?php 
                echo htmlentities($group_label);
                ?>
">
							<?php 
            }
            ?>
							<?php 
//.........这里部分代码省略.........
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:101,代码来源:testimonial_list_widget.php


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