本文整理汇总了PHP中_WSH函数的典型用法代码示例。如果您正苦于以下问题:PHP _WSH函数的具体用法?PHP _WSH怎么用?PHP _WSH使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_WSH函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vc_theme_vc_row
function vc_theme_vc_row($atts, $content = null)
{
extract(shortcode_atts(array('el_class' => '', '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;
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 ($container && !$boxed) {
return '<section class="' . $css_class . '" ' . $style . ' >
<div class="container">
<div class="general-row">
' . wpb_js_remove_wpautop($content) . '
</div>
</div>
</section>
<div class="clearfix"></div>' . "\n";
}
return '<section class="' . $css_class . ' general-row" ' . $style . ' >
' . wpb_js_remove_wpautop($content) . '
</section>
<div class="clearfix"></div>' . "\n";
}
示例2: 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);
}
示例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');
}
}
示例4: wp_footer
function wp_footer()
{
$analytics = sh_set(_WSH()->option(), 'footer_analytics');
if ($analytics) {
?>
<script type="text/javascript">
<?php
echo $analytics;
?>
</script>
<?php
}
}
示例5: __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');
}
示例6: __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();
}
示例7: 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
}
}
示例8: shortcode_output
function shortcode_output($atts, $contents = null, $base, $current = array())
{
if (!$current) {
return;
}
$current = sh_set($this->keys, $base);
extract(shortcode_atts($this->create_atts($current), $atts));
$file = 'includes/modules/shortcodes/' . str_replace('sh_', '', $base) . '.php';
$output = (include _WSH()->includes($file));
return $output;
//if( file_exists( $this->_s_dir.$file ) ) include( $this->_s_dir.$file );
//else include( $this->_dir.$file );
}
示例9: __construct
function __construct()
{
require_once get_template_directory() . '/includes/helpers/libpaypal.php';
$this->_settings = get_option(SH_NAME);
$theme_options = _WSH()->option();
//Create the authentication
$pp_type = sh_set($theme_options, 'paypal_type') == 'sandbox' ? true : false;
$auth = new PaypalAuthenticaton(sh_set($theme_options, 'paypal_username'), sh_set($theme_options, 'paypal_api_username'), sh_set($theme_options, 'paypal_api_password'), sh_set($theme_options, 'paypal_api_signature'), $pp_type);
//Create the paypal object
$this->_paypal = new Paypal($auth);
$this->_paypal_settings = new PaypalSettings();
$this->_paypal_settings->allowMerchantNote = true;
$this->_paypal_settings->logNotifications = true;
//the base url
$this->return_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
示例10: sh_theme_color_scheme
function sh_theme_color_scheme($color = '')
{
$dir = SH_TH_ROOT;
include_once $dir . '/includes/thirdparty/lessc.inc.php';
if (!$color) {
$color = _WSH()->option('custom_color_scheme');
}
if (!$color) {
return;
}
$less = new lessc();
$less->setVariables(array("color" => $color));
// create a new cache object, and compile
$cache = $less->cachedCompile(_WSH()->includes("/css/color.less"));
return $cache['compiled'];
file_put_contents(_WSH()->includes('/css/colors.css'), $cache["compiled"]);
}
示例11: tweets
function tweets()
{
if (!class_exists('Codebird')) {
include_once 'codebird.php';
}
$cb = new Codebird();
$method = sh_set($_GET, 'method');
$theme_options = _WSH()->option();
//printr($theme_options);
$api = sh_set($theme_options, 'twitter_api');
$api_secret = sh_set($theme_options, 'twitter_api_secret');
$token = sh_set($theme_options, 'twitter_token');
$token_secret = sh_set($theme_options, 'twitter_token_secret');
if (!$api && $api_secret) {
_e('Please provide tiwtter api information to fetch feed', SH_NAME);
exit;
}
$cb->setConsumerKey($api, $api_secret);
$cb->setToken($token, $token_secret);
$resp = array();
$reply = (array) $cb->statuses_userTimeline(array('count' => sh_set($_GET, 'number'), 'screen_name' => sh_set($_GET, 'screen_name')));
if (isset($reply['httpstatus'])) {
unset($reply['httpstatus']);
}
foreach ($reply as $k => $v) {
//if( $k == 'httpstatus' ) continue;
$time = human_time_diff(strtotime(sh_set($v, 'created_at')), current_time('timestamp')) . __(' ago', SH_NAME);
$text = preg_replace('@(https?://([-\\w\\.]+[-\\w])+(:\\d+)?(/([\\w/_\\.#-]*(\\?\\S+)?[^\\.\\s])?)?)@', '<a href="$1" target="_blank">$1</a>', sh_set($v, 'text'));
if (sh_set($_POST, 'template') === 'lead') {
echo '<i class="fa fa-twitter"></i>' . $text . ' <a href="#"> ' . $time . '</a>';
} else {
$res[$k]['date'] = $time;
//array('date'=>$time, 'tweet'=>$text);
$res[$k]['tweet'] = $text;
//echo
//'<li><span></span><p>'.$text.' <a href="#">'.__(' about ', SH_NAME).$time.'</a></p></li>';
}
}
//printr($res);
echo json_encode($res);
}
示例12: post
function post()
{
_load_class('validation', 'helpers', true);
$t = _WSH();
$settings = $t->option();
$message = '';
foreach ($this->fields as $f) {
$field_name = sh_set($f, 'name');
$validation = array();
$placehold = sh_set($f, 'placeholder');
foreach (sh_set($f, 'validation') as $valid) {
$validation[] = $valid;
}
/** set validation rules for contact form */
$t->validation->set_rules($field_name, '<strong>' . sh_set($f, 'placeholder') . '</strong>', implode('|', $validation));
$message .= "{$placehold}\t" . $t->validation->post($field_name) . "\r\n";
}
if (sh_set($_POST, 'form_secret') !== $this->_old_hash) {
$t->validation->_error_array['form_secret'] = __('There is form validation error or spamming issue', SH_NAME);
}
if ($t->validation->run() !== FALSE && empty($t->validation->_error_array)) {
$contact_to = sh_set($this->meta, 'form_email') ? sh_set($this->meta, 'form_email') : get_option('admin_email');
$headers = 'From: ' . get_option('name') . ' <' . get_option('admin_email') . '>' . "\r\n";
wp_mail($contact_to, sprintf(__('%s - Form Submitted', SH_NAME), get_the_title($this->id)), $message, $headers);
$response = sh_set($this->meta, 'form_success_msg') ? $this->meta['form_success_msg'] : sprintf(__('Form is successfully submitted, we\'ll response you shortly.', SH_NAME), $name);
return "<div id='success_page' class=\"alert-success\">" . "<h1>" . __("Successful", SH_NAME) . "</h1>" . "<p>" . $response . "</p>" . "</div>";
} else {
$messages = '';
if (is_array($t->validation->_error_array)) {
foreach ($t->validation->_error_array as $msg) {
$messages .= '<div class="alert error_message alert-error">
<p>' . __('Error! ', SH_NAME) . $msg . '</p>
</div>';
}
}
return $messages;
}
return '';
}
示例13: sh_get_font_settings
function sh_get_font_settings($FontSettings = array(), $StyleBefore = '', $StyleAfter = '')
{
$i = 1;
$settings = _WSH()->option();
$Style = '';
foreach ($FontSettings as $k => $v) {
if ($i == 1 || $i == 5) {
$Style .= sh_set($settings, $k) ? $v . ':' . sh_set($settings, $k) . 'px;' : '';
} else {
$Style .= sh_set($settings, $k) ? $v . ':' . sh_set($settings, $k) . ';' : '';
}
$i++;
}
return !empty($Style) ? $StyleBefore . $Style . $StyleAfter : '';
}
示例14: array
<?php
$options = array();
$options[] = array('id' => '_sh_tax_seo_settings', 'types' => array('category', 'post_tag'), 'title' => __('SEO Settings', SH_NAME), 'priority' => 'high', 'template' => array(array('type' => 'toggle', 'name' => 'seo_status', 'label' => __('Enable SEO', SH_NAME)), array('type' => 'textbox', 'name' => 'title', 'label' => __('Meta Title', SH_NAME)), array('type' => 'textarea', 'name' => 'description', 'label' => __('Meta Description', SH_NAME), 'default' => ''), array('type' => 'textarea', 'name' => 'keywords', 'label' => __('Meta Keywords', SH_NAME), 'default' => '')));
$options[] = array('id' => _WSH()->set_term_key('category'), 'types' => array('category', 'post_tag'), 'title' => __('Post Category Settings', SH_NAME), 'priority' => 'high', 'template' => array(array('type' => 'textbox', 'name' => 'header_title', 'label' => __('Header Title', SH_NAME)), array('type' => 'upload', 'name' => 'header_img', 'label' => __('Header image', SH_NAME)), array('type' => 'radioimage', 'name' => 'view', 'label' => __('Page View', SH_NAME), 'items' => array(array('value' => 'grid', 'label' => __('Grid View', SH_NAME), 'img' => get_template_directory_uri() . '/includes/vafpress/public/img/grid-alt.png'), array('value' => 'list', 'label' => __('List View', SH_NAME), 'img' => get_template_directory_uri() . '/includes/vafpress/public/img/list3.png'))), array('type' => 'radioimage', 'name' => 'layout', 'label' => __('Page Layout', SH_NAME), 'items' => array(array('value' => 'left', 'label' => __('Left Sidebar', SH_NAME), 'img' => get_template_directory_uri() . '/includes/vafpress/public/img/2cl.png'), array('value' => 'right', 'label' => __('Right Sidebar', SH_NAME), 'img' => get_template_directory_uri() . '/includes/vafpress/public/img/2cr.png'), array('value' => 'full', 'label' => __('Full Width', SH_NAME), 'img' => get_template_directory_uri() . '/includes/vafpress/public/img/1col.png'))), array('type' => 'select', 'name' => 'sidebar', 'label' => __('Sidebar', SH_NAME), 'default' => '', 'items' => sh_get_sidebars(true))));
$options[] = array('id' => _WSH()->set_term_key('category'), 'types' => array('product_cat', 'product_tag'), 'title' => __('Post Category Settings', SH_NAME), 'priority' => 'high', 'template' => array(array('type' => 'textbox', 'name' => 'header_title', 'label' => __('Header Title', SH_NAME)), array('type' => 'upload', 'name' => 'header_img', 'label' => __('Header image', SH_NAME)), array('type' => 'radioimage', 'name' => 'layout', 'label' => __('Page Layout', SH_NAME), 'items' => array(array('value' => 'left', 'label' => __('Left Sidebar', SH_NAME), 'img' => get_template_directory_uri() . '/includes/vafpress/public/img/2cl.png'), array('value' => 'right', 'label' => __('Right Sidebar', SH_NAME), 'img' => get_template_directory_uri() . '/includes/vafpress/public/img/2cr.png'), array('value' => 'full', 'label' => __('Full Width', SH_NAME), 'img' => get_template_directory_uri() . '/includes/vafpress/public/img/1col.png'))), array('type' => 'select', 'name' => 'sidebar', 'label' => __('Sidebar', SH_NAME), 'default' => '', 'items' => sh_get_sidebars(true))));
return $options;
/**
* EOF
*/
示例15: body_id
function body_id()
{
$options = _WSH()->option();
$boxed = sh_set($options, 'boxed_layout');
$boxed_layout = $boxed && !$nobg ? ' id="boxed" ' : '';
echo $boxed_layout;
}