• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP sh_set函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sh_widget_init

function sh_widget_init()
{
    global $wp_registered_sidebars;
    $theme_options = _WSH()->option();
    //if( class_exists( 'SH_About_Us' ) )register_widget( 'SH_About_Us' );
    if (class_exists('SH_Contact_Info')) {
        register_widget('SH_Contact_Info');
    }
    if (class_exists('SH_Contact_Form')) {
        register_widget('SH_Contact_Form');
    }
    register_sidebar(array('name' => esc_html__('Default Sidebar', SH_NAME), 'id' => 'default-sidebar', 'description' => esc_html__('Widgets in this area will be shown on the right-hand side.', SH_NAME), 'class' => '', 'before_widget' => '<div id="%1$s" class="widget clearfix %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title clearfix"><h3>', 'after_title' => '</h3></div>'));
    register_sidebar(array('name' => esc_html__('Footer Sidebar', SH_NAME), 'id' => 'footer-sidebar', 'description' => esc_html__('Widgets in this area will be shown on the footer.', SH_NAME), 'class' => '', 'before_widget' => '<div id="%1$s" class="clearfix %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>'));
    if (!is_object(_WSH())) {
        return;
    }
    $sidebars = sh_set(sh_set($theme_options, 'dynamic_sidebar'), 'dynamic_sidebar');
    foreach (array_filter((array) $sidebars) as $sidebar) {
        if (sh_set($sidebar, 'topcopy')) {
            continue;
        }
        $name = sh_set($sidebar, 'sidebar_name');
        if (!$name) {
            continue;
        }
        $slug = sh_slug($name);
        register_sidebar(array('name' => $name, 'id' => $slug, 'before_widget' => '<div class="widget">', 'after_widget' => "</div>", 'before_title' => '<div class="widget-title"><h3><span class="divider"></span>', 'after_title' => '</h3></div>'));
    }
    update_option('wp_registered_sidebars', $wp_registered_sidebars);
}
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:30,代码来源:functions.php


示例2: sh_admin_custom_scripts

function sh_admin_custom_scripts()
{
    global $pagenow;
    if ($pagenow == 'themes.php' && sh_set($_GET, 'page') == SH_NAME . '_option' || sh_set($_REQUEST, 'action') == 'vp_ajax_wp_genuine_theme_options_save') {
        wp_enqueue_script('vp-metabox', get_template_directory_uri() . '/includes/vafpress/public/js/metabox.min.js', '', '', true);
    }
}
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:7,代码来源:loader.php


示例3: launch

 function launch()
 {
     $theme_options = _WSH()->option();
     $theme_options_url = admin_url('themes.php?page=' . SH_NAME . '_option');
     $this->purchase_code = sh_set($theme_options, 'sh_purchase_code');
     $this->purchase_user = sh_set($theme_options, 'sh_purchase_user');
     if (function_exists('wp_get_theme')) {
         $this->theme_data = wp_get_theme(get_option('template'));
         $this->theme_version = $this->theme_data->Version;
     } else {
         $this->theme_data = get_theme_data(get_template_directory() . '/style.css');
         $this->theme_version = $this->theme_data['Version'];
     }
     $this->theme_base = get_option('template');
     if (!$this->purchase_code && !$this->purchase_user) {
         $this->errors[] = sprintf(__('<strong>%s Theme Notice:</strong> Please enter a valid <a href="%s">purchase code and themeforest username</a> to get automatic theme update', SH_NAME), $this->theme_data['Name'], $theme_options_url);
     }
     add_action('admin_notices', array($this, '_admin_notice'));
     if ($this->errors) {
         return;
     }
     /**************************************************/
     //Uncomment below to find the theme slug that will need to be setup on the api server
     //var_dump($theme_base);
     add_filter('pre_set_site_transient_update_themes', array($this, 'check_for_update'));
     // Take over the Theme info screen on WP multisite
     add_filter('themes_api', array($this, 'my_theme_api_call'), 10, 3);
     if (is_admin()) {
         $this->current = get_transient('update_themes');
     }
 }
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:31,代码来源:update_theme.php


示例4: vc_theme_vc_row

function vc_theme_vc_row($atts, $content = null)
{
    extract(shortcode_atts(array('el_class' => '', 'el_id' => '', 'bg_image' => '', 'bg_color' => '', 'bg_image_repeat' => '', 'font_color' => '', 'padding' => '', 'margin_bottom' => '', 'container' => '', 'css' => ''), $atts));
    $atts['base'] = '';
    wp_enqueue_style('js_composer_front');
    wp_enqueue_script('wpb_composer_front_js');
    wp_enqueue_style('js_composer_custom_css');
    $vc_row = new WPBakeryShortCode_VC_Row($atts);
    $el_class = $vc_row->getExtraClass($el_class);
    $output = '';
    $css_class = $el_class;
    $id = sh_set($atts, 'el_id') ? ' id="' . $atts['el_id'] . '"' : '';
    if ($css) {
        $css_class .= vc_shortcode_custom_css_class($css, ' ') . ' ';
    }
    $style = $vc_row->buildStyle($bg_image, $bg_color, $bg_image_repeat, $font_color, $padding, $margin_bottom);
    //$boxed = sh_set( _WSH()->option(), 'boxed_layout' );
    //if( $css_class) exit($css_class);
    if ($container) {
        return '<section class="section ' . $css_class . '" ' . $style . $id . ' >
		<div class="container">
			<div class="general-row">
				' . wpb_js_remove_wpautop($content) . '
			</div>
		</div>
	<div class="clearfix"></div>
	</section>
	' . "\n";
    }
    return '<section class="section ' . $css_class . ' general-row" ' . $style . $id . ' >
		' . wpb_js_remove_wpautop($content) . '
	<div class="clearfix"></div>
	</section>
	' . "\n";
}
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:35,代码来源:vc_map.php


示例5: updateNavMenuItem

 function updateNavMenuItem($menu_id, $menu_item_db_id, $args)
 {
     $isTopLevel = $args['menu-item-parent-id'] == 0 ? true : false;
     $sidebar = '';
     if (!$isTopLevel) {
         $parent_id = $args['menu-item-parent-id'];
         $parent_status = get_post_meta($parent_id, '_menu_item_status', true);
         update_post_meta($menu_item_db_id, '_menu_item_status', $parent_status);
     } else {
         $status = 'inactive';
         if (isset($_POST['megamenu_status'][$menu_item_db_id]) && $_POST['megamenu_status'][$menu_item_db_id] == 'active') {
             $status = 'active';
         }
         update_post_meta($menu_item_db_id, '_menu_item_status', $status);
     }
     //printr($_POST);
     if ($isTopLevel) {
         /** Store other fields*/
         update_post_meta($menu_item_db_id, '_sh_menu_columns', sh_set(sh_set($_POST, '_sh_menu_columns'), $menu_item_db_id, 2));
     }
     if (isset($_POST['_sh_menu_sidebar'][$menu_item_db_id]) && !empty($_POST['_sh_menu_sidebar'][$menu_item_db_id])) {
         $sidebar = $_POST['_sh_menu_sidebar'][$menu_item_db_id];
     }
     update_post_meta($menu_item_db_id, '_sh_menu_sidebar', $sidebar);
     update_post_meta($menu_item_db_id, '_sh_menu_item_submenu_type', sh_set(sh_set($_POST, 'menu_item_submenu_type'), $menu_item_db_id, 'default_dropdown'));
 }
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:26,代码来源:mega_menu.php


示例6: get_term_meta

 function get_term_meta($id = '', $key = '')
 {
     global $post, $post_type;
     $id = $id ? $id : sh_set($post, 'ID');
     $key = $key ? $key : '_sh_' . $post_type . '_settings';
     $meta = get_post_meta($id, $key, true);
     return $meta ? $meta : false;
 }
开发者ID:kevintrogers,项目名称:justbkause,代码行数:8,代码来源:base.php


示例7: maintainance

 function maintainance()
 {
     $options = _WSH()->option();
     if (sh_set($options, 'maintainance_status')) {
         $m_page = sh_set($options, 'maintainance_page');
         if ($m_page && !is_user_logged_in() && !is_page($m_page)) {
             wp_redirect(get_permalink($m_page));
         }
     }
 }
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:10,代码来源:functions.php


示例8: bistro_slider

 function bistro_slider()
 {
     $settings = (include get_template_directory() . '/includes/resource/post_types.php');
     foreach ($options as $k => $v) {
         $labels = $this->labels(sh_set($v, 'labels'), sh_set($v, 'label_args'));
         $rewrite = array('slug' => sh_set($v, 'slug'), 'with_front' => true, 'pages' => true, 'feeds' => false);
         $args = $this->args(array('labels' => $labels, 'supports' => sh_set($v, 'supports'), 'rewrite' => $rewrite));
         $args = wp_parse_args(sh_set($v, 'args'), $args);
         register_post_type($k, $args);
     }
 }
开发者ID:kevintrogers,项目名称:justbkause,代码行数:11,代码来源:post_types.php


示例9: withArray

 public static function withArray($arr = array(), $class_name = null)
 {
     if (is_null($class_name)) {
         $instance = new self();
     } else {
         $instance = new $class_name();
     }
     $instance->_basic_make($arr);
     $instance->_fields = sh_set($arr, 'fields');
     $instance->_alchemy = new VP_MetaBox_Alchemy1(array('id' => $instance->get_name(), 'template' => array(array('type' => 'group', 'repeating' => true, 'name' => $instance->get_name(), 'title' => $instance->get_label(), 'fields' => $instance->_fields))));
     return $instance;
 }
开发者ID:kevintrogers,项目名称:justbkause,代码行数:12,代码来源:builder.php


示例10: create_atts

 function create_atts($array = array())
 {
     //$contents = '';
     $atts = array();
     foreach ($array['params'] as $arr) {
         if ($arr['param_name'] == 'content') {
             continue;
         }
         $atts[$arr['param_name']] = sh_set($arr, 'default') ? sh_set($arr, 'default') : '';
     }
     return $atts;
 }
开发者ID:kevintrogers,项目名称:justbkause,代码行数:12,代码来源:shortcodes.php


示例11: __construct

 function __construct()
 {
     // Hook into the 'init' action
     //add_action( 'init', array($this, 'taxonomies'), 0 );
     $theme_option = _WSH()->option();
     $this->team_cat_slug = sh_set($theme_option, 'team_category_permalink', 'team_category');
     $this->services_cat_slug = sh_set($theme_option, 'services_category_permalink', 'services_category');
     $this->projects_cat_slug = sh_set($theme_option, 'projects_category_permalink', 'projects_category');
     $this->gallery_cat_slug = sh_set($theme_option, 'gallery_category_permalink', 'gallery_category');
     $this->testimonials_cat_slug = sh_set($theme_option, 'testimonial_category_permalink', 'testimonials_category');
     $this->faq_cat_slug = sh_set($theme_option, 'faq_category_permalink', 'faq_category');
     $this->taxonomies();
 }
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:13,代码来源:taxonomies.php


示例12: __construct

 function __construct()
 {
     // Hook into the 'init' action
     add_action('init', array($this, 'taxonomies'), 0);
     $theme_option = _WSH()->option();
     $this->team_cat_slug = sh_set($theme_option, 'team_category_permalink', 'team_category');
     $this->projects_cat_slug = sh_set($theme_option, 'projects_category_permalink', 'projects_category');
     $this->causes_cat_slug = sh_set($theme_option, 'causes_category_permalink', 'causes_category');
     $this->events_cat_slug = sh_set($theme_option, 'events_category_permalink', 'events_category');
     $this->gallery_cat_slug = sh_set($theme_option, 'gallery_category_permalink', 'gallery_category');
     $this->testimonials_cat_slug = sh_set($theme_option, 'testimonials_category_permalink', 'testimonials_category');
     $this->donars_cat_slug = sh_set($theme_option, 'donars_category_permalink', 'donars_category');
 }
开发者ID:kevintrogers,项目名称:justbkause,代码行数:13,代码来源:taxonomies.php


示例13: wp_footer

    function wp_footer()
    {
        $analytics = sh_set(_WSH()->option(), 'footer_analytics');
        if ($analytics) {
            ?>
			<script type="text/javascript">
                <?php 
            echo $analytics;
            ?>
            </script>
        <?php 
        }
    }
开发者ID:kevintrogers,项目名称:justbkause,代码行数:13,代码来源:enqueue.php


示例14: wp_footer

    function wp_footer()
    {
        $theme_options = _WSH()->option();
        if (sh_set($theme_options, 'footer_analytics')) {
            ?>
			<script type="text/javascript">
                <?php 
            echo sh_set($theme_options, 'footer_analytics');
            ?>
            </script>
        <?php 
        }
    }
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:13,代码来源:enqueue.php


示例15: publish_post

 function publish_post($post_id)
 {
     global $post;
     $post_type = sh_set($_POST, 'post_type');
     $setting = sh_set($this->_fields, $post_type);
     $types = array_merge(array('post', 'page'), array_keys($this->_fields));
     if (!in_array($post_type, $types)) {
         return;
     }
     $data = sh_set($_POST, $post_type);
     //array_intersect_key( $_POST, $setting);
     if (!$data) {
         return;
     }
     //printr($post);
     if ($post_type == 'bistro_deal') {
         update_post_meta($post_id, '_bistro_bistro_deal_date', strtotime(sh_set($data, 'end_date')));
     }
     update_post_meta($post_id, '_bistro_' . $post_type . '_settings', $data);
 }
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:20,代码来源:meta_boxes.php


示例16: sh_contact_form_submit

 function sh_contact_form_submit()
 {
     if (!count($_POST)) {
         return;
     }
     _load_class('validation', 'helpers', true);
     $t =& $GLOBALS['_sh_base'];
     //printr($t);
     $settings = get_option(SH_NAME . '_theme_options');
     /** set validation rules for contact form */
     $t->validation->set_rules('contact_name', '<strong>' . __('Name', SH_NAME) . '</strong>', 'required|min_length[4]|max_lenth[30]');
     $t->validation->set_rules('contact_email', '<strong>' . __('Email', SH_NAME) . '</strong>', 'required|valid_email');
     //$t->validation->set_rules('contact_name','<strong>'.__('Phone', SH_NAME).'</strong>', 'required|min_length[5]');
     $t->validation->set_rules('contact_message', '<strong>' . __('Message', SH_NAME) . '</strong>', 'required|min_length[10]');
     if (sh_set($settings, 'captcha_status') == 'on') {
         if (sh_set($_POST, 'contact_captcha') !== sh_set($_SESSION, 'captcha')) {
             $t->validation->_error_array['captcha'] = __('Invalid captcha entered, please try again.', SH_NAME);
         }
     }
     $messages = '';
     if ($t->validation->run() !== FALSE && empty($t->validation->_error_array)) {
         //exit('ssssss');
         $name = $t->validation->post('contact_name');
         $email = $t->validation->post('contact_email');
         $message = $t->validation->post('contact_message');
         $contact_to = sh_set($settings, 'contact_email') ? sh_set($settings, 'contact_email') : get_option('admin_email');
         $headers = 'From: ' . $name . ' <' . $email . '>' . "\r\n";
         wp_mail($contact_to, __('Contact Us Message', SH_NAME), $message, $headers);
         $message = sh_set($settings, 'success_message') ? $settings['success_message'] : sprintf(__('Thank you <strong>%s</strong> for using our Contact form! Your email was successfully sent and we will be in touch with you soon.', SH_NAME), $name);
         $messages = '<div class="alert alert-success">' . __('SUCCESS! ', SH_NAME) . $message . '</div>';
     } else {
         if (is_array($t->validation->_error_array)) {
             foreach ($t->validation->_error_array as $msg) {
                 $messages .= '<div class="alert alert-danger"><span class="red">' . __('Error! ', SH_NAME) . '</span>' . $msg . '</div>';
             }
         }
     }
     echo $messages;
     exit;
     return $messages;
 }
开发者ID:kevintrogers,项目名称:justbkause,代码行数:41,代码来源:ajax.php


示例17: sh_widget_init

function sh_widget_init()
{
    register_widget("TW_featured_posts");
    register_widget("TW_Flickr");
    register_widget("TW_Contact_info");
    register_widget("TW_Contact_form");
    register_widget("TW_Twitter");
    register_widget("TW_Rise_info");
    global $wp_registered_sidebars;
    register_sidebar(array('name' => __('Default Sidebar', SH_NAME), 'id' => 'default-sidebar', 'description' => __('Widgets in this area will be shown on the right-hand side.', SH_NAME), 'class' => '', 'before_widget' => '<div class="widget animated fadeInUp in  %s" data-delay="0" data-animation="fadeInUp">', 'after_widget' => '</div>', 'before_title' => '<header class="heading"><h4>', 'after_title' => '</h4></header>'));
    register_sidebar(array('name' => __('Footer Sidebar', SH_NAME), 'id' => 'footer-sidebar', 'description' => __('Widgets in this area will be shown in Footer Area.', SH_NAME), 'class' => '', 'before_widget' => '<div class="col-md-3 col-sm-6 col-xs-12"><div class="widget %s">', 'after_widget' => '</div></div>', 'before_title' => '<div class="heading"><h4>', 'after_title' => '</h4></div>'));
    $sidebars = sh_set(sh_set(get_option(SH_NAME . '_theme_options'), 'dynamic_sidebar'), 'dynamic_sidebar');
    foreach (array_filter((array) $sidebars) as $sidebar) {
        if (sh_set($sidebar, 'topcopy')) {
            break;
        }
        $slug = sh_slug($sidebar);
        register_sidebar(array('name' => sh_set($sidebar, 'sidebar_name'), 'id' => sh_set($slug, 'sidebar_name'), 'before_widget' => '<div class="widget">', 'after_widget' => "</div>", 'before_title' => '<div class="widget-title"><h4>', 'after_title' => '</h4></div>'));
    }
    update_option('wp_registered_sidebars', $wp_registered_sidebars);
}
开发者ID:kevintrogers,项目名称:justbkause,代码行数:21,代码来源:functions.php


示例18: widget

    /** @see WP_Widget::widget */
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        ?>
		
		<div class="col-md-3 col-sm-6 col-xs-12">
		
		<?php 
        echo $before_widget;
        ?>
		
        <div class="widget_twitter">
		
		<?php 
        echo $before_title . $title . $after_title;
        ?>
		<?php 
        $number = sh_set($instance, 'number') ? esc_attr(sh_set($instance, 'number')) : 2;
        ?>

		<script type="text/javascript"> jQuery(document).ready(function($) {$('#twitter_update').tweets({screen_name: '<?php 
        echo $instance['twitter_id'];
        ?>
', number: <?php 
        echo $number;
        ?>
});});</script>
		<ul id="twitter_update" class="twitter_feed"></ul>
        </div>
		<?php 
        echo $after_widget;
        ?>
		</div>
<?php 
    }
开发者ID:kevintrogers,项目名称:justbkause,代码行数:37,代码来源:widgets.php


示例19: sh_register_dynamic_sidebar

function sh_register_dynamic_sidebar()
{
    $theme_options = get_option(SH_NAME . '_theme_options');
    $sidebars = sh_set(sh_set($theme_options, 'dynamic_sidebar'), 'dynamic_sidebar');
    if ($sidebars && is_array($sidebars)) {
        foreach ($sidebars as $sidebar) {
            if (isset($sidebar['tocopy'])) {
                continue;
            }
            register_sidebar(array('name' => $sidebar['sidebar_name'], 'id' => sh_slug($sidebar['sidebar_name']), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => "</div>", 'before_title' => '<h4 class="title"><span>', 'after_title' => '</span></h4>'));
        }
    }
}
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:13,代码来源:functions.php


示例20: _WSH

<?php

/** Template Name: Post VC*/
?>

<?php 
$meta = _WSH()->get_meta('_sh_layout_settings');
$meta1 = _WSH()->get_meta('_sh_header_settings');
$bg = sh_set($meta1, 'bg_image');
$bg = $bg ? $bg : get_template_directory_uri() . '/images/other/parallax.jpg';
$layout = sh_set($meta, 'layout', 'full');
$sidebar = sh_set($meta, 'sidebar', 'blog-sidebar');
$classes = !$layout || $layout == 'full' ? ' col-lg-12 col-md-12' : ' col-lg-9 col-md-9';
if (!sh_set($_GET, 'ajax')) {
    get_header();
    /** Update the post views counter */
    //_WSH()->post_views( true );
    ?>

<link rel="stylesheet" id="js_composer_front-css" href="http://localhost/denken/wp-content/plugins/js_composer/assets/css/js_composer.css?ver=4.7" type="text/css" media="all">



<?php 
    _sh_show_menu_by_position('above');
    ?>

<div class="page-header parallax" style="background-image: url(<?php 
    echo esc_url($bg);
    ?>
);"></div>
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:31,代码来源:tpl-vc_post.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP sha1函数代码示例发布时间:2022-05-24
下一篇:
PHP shTranslateUrl函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap