本文整理汇总了PHP中stm_option函数的典型用法代码示例。如果您正苦于以下问题:PHP stm_option函数的具体用法?PHP stm_option怎么用?PHP stm_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stm_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @param array $args Widget arguments.
* @param array $instance Saved values from database.
*/
public function widget($args, $instance)
{
$title = apply_filters('widget_title', $instance['title']);
$args['before_title'] = '<h5 class="stm_subscribe_title">';
$args['after_title'] = '</h5>';
echo $args['before_widget'];
if (!empty($title)) {
echo $args['before_title'] . esc_html($title) . $args['after_title'];
}
$html = '';
$mailchimp_key = stm_option('mailchimp_api_key');
$mailchimp_list = stm_option('mailchimp_list_id');
if ($mailchimp_key and $mailchimp_list) {
$html .= '<form action="/" class="stm_subscribe_' . time() . '">';
$html .= '<div class="stm_mailchimp_unit">';
$html .= '<div class="form-group">';
$html .= '<input type="email" name="email" class="form-control stm_subscribe_email" required/>';
$html .= '</div>';
$html .= '<button class="button"><span class="h5">' . __('Subscribe', 'stm_domain') . '</span></button>';
$html .= '<div class="stm_subscribe_preloader">Please wait...</div>';
$html .= '</div>';
$html .= '</form>';
$html .= '
<script type="text/javascript">
jQuery(document).ready( function($){
$(".stm_subscribe_' . time() . '").on(\'submit\', function (e) {
e.preventDefault;
var $this = $(this);
$(".stm_subscribe_preloader").addClass("loading");
$.ajax({
type: \'POST\',
data: \'action=stm_subscribe&email=\' + $($this).find(".stm_subscribe_email").val(),
dataType: \'json\',
url: ajaxurl,
success: function (json) {
if (json[\'success\']) {
$($this).replaceWith(\'<div class="success_message">\' + json[\'success\'] + \'</div>\');
}
if (json[\'error\']) {
alert(json[\'error\']);
}
$(".stm_subscribe_preloader").removeClass("loading");
}
});
return false;
});
})
</script>
';
} else {
$html .= __('Error API', 'stm_domain');
}
echo balanceTags($html, true);
echo $args['after_widget'];
}
示例2: generatePayment
function generatePayment($data, $event = false)
{
if ($event) {
$participant_id = $event;
$amount = get_post_meta($data['event_id'], 'event_price', true);
$return['result'] = true;
$paypalEmail = stm_option('paypal_email');
$returnUrl = home_url();
$items['item_name'] = get_the_title($data['event_id']);
$items['item_number'] = $data['event_id'];
$items['amount'] = $amount;
$items = http_build_query($items);
$return = 'https://' . paypal_url() . '/cgi-bin/webscr?cmd=_xclick&business=' . $paypalEmail . '&' . $items . '&no_shipping=1&no_note=1¤cy_code=' . stm_option('currency') . '&bn=PP%2dBuyNowBF&charset=UTF%2d8&invoice=' . $participant_id . '&return=' . $returnUrl . '&rm=2¬ify_url=' . $returnUrl;
}
return $return;
}
示例3: stm_option
<?php
$blog_sidebar_position = stm_option('blog_sidebar_position', 'none');
if (!empty($_GET['sidebar_position']) and $_GET['sidebar_position'] == 'right') {
$blog_sidebar_position = 'right';
} elseif (!empty($_GET['sidebar_position']) and $_GET['sidebar_position'] == 'left') {
$blog_sidebar_position = 'left';
} elseif (!empty($_GET['sidebar_position']) and $_GET['sidebar_position'] == 'none') {
$blog_sidebar_position = 'none';
}
$blog_col_layout = 'col-md-4 col-sm-6 col-xs-12';
if ($blog_sidebar_position != 'none') {
$blog_col_layout = 'col-md-6 col-sm-6 col-xs-12 blog-cols-sidebar';
}
?>
<div class="<?php
echo $blog_col_layout;
?>
">
<div class="post_list_content_unit">
<?php
if (has_post_thumbnail()) {
?>
<div>
<div class="post_list_featured_image">
<a href="<?php
the_permalink();
?>
" title="<?php
_e('Watch full', STM_DOMAIN);
示例4: stm_body_class
function stm_body_class($classes)
{
$classes[] = stm_option('color_skin');
return $classes;
}
示例5: get_header
<?php
get_header();
?>
<?php
// Sidebar Gallery
$blog_sidebar_id = stm_option('gallery_sidebar');
$blog_sidebar_position = stm_option('gallery_sidebar_position', 'none');
$content_before = $content_after = $sidebar_before = $sidebar_after = '';
if (!empty($_GET['sidebar_position']) and $_GET['sidebar_position'] == 'right') {
$blog_sidebar_position = 'right';
} elseif (!empty($_GET['sidebar_position']) and $_GET['sidebar_position'] == 'left') {
$blog_sidebar_position = 'left';
} elseif (!empty($_GET['sidebar_position']) and $_GET['sidebar_position'] == 'none') {
$blog_sidebar_position = 'none';
}
if ($blog_sidebar_id) {
$blog_sidebar = get_post($blog_sidebar_id);
}
if ($blog_sidebar_position == 'right' && isset($blog_sidebar)) {
$content_before .= '<div class="row">';
$content_before .= '<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">';
$content_after .= '</div>';
// col
$sidebar_before .= '<div class="col-lg-3 col-md-3 hidden-sm hidden-xs">';
// .sidebar-area
$sidebar_after .= '</div>';
// col
$sidebar_after .= '</div>';
示例6: stm_option
}
?>
</div>
</div>
<div class="col-md-6 col-sm-4">
<div class="clearfix">
<div class="pull-right xs-pull-left">
<?php
global $stm_option;
?>
<?php
$socials = stm_option('copyright_use_social');
?>
<!-- Header top bar Socials -->
<?php
if (!empty($socials) and stm_option('copyright_use_social')) {
?>
<div class="pull-right">
<div class="copyright_socials">
<ul class="clearfix">
<?php
foreach ($stm_option['copyright_use_social'] as $key => $val) {
if (!empty($stm_option[$key]) && $val == 1) {
echo "<li><a href='{$stm_option[$key]}'><i class='fa fa-{$key}'></i></a></li>";
}
}
?>
</ul>
</div>
</div>
<?php
示例7: get_header
<?php
get_header();
?>
<?php
// Blog setup
$blog_layout = stm_option('blog_layout');
// Sidebar Blog
$blog_sidebar_id = stm_option('blog_sidebar');
$blog_sidebar_position = stm_option('blog_sidebar_position', 'none');
$content_before = $content_after = $sidebar_before = $sidebar_after = '';
// Teacher Sidebar
if (get_post_type() == 'teachers') {
$blog_sidebar_id = stm_option('teachers_sidebar');
$blog_sidebar_position = stm_option('teachers_sidebar_position', 'none');
}
if (!empty($_GET['sidebar_id'])) {
$blog_sidebar_id = intval($_GET['sidebar_id']);
}
if (!empty($_GET['sidebar_position']) and $_GET['sidebar_position'] == 'right') {
$blog_sidebar_position = 'right';
} elseif (!empty($_GET['sidebar_position']) and $_GET['sidebar_position'] == 'left') {
$blog_sidebar_position = 'left';
} elseif (!empty($_GET['sidebar_position']) and $_GET['sidebar_position'] == 'none') {
$blog_sidebar_position = 'none';
}
if (!empty($_GET['layout']) and $_GET['layout'] == 'grid') {
$blog_layout = 'grid';
}
if ($blog_sidebar_id) {
$blog_sidebar = get_post($blog_sidebar_id);
示例8: stm_option
<?php
$blog_sidebar_pos = stm_option('blog_sidebar_position');
?>
<div class="col-md-12">
<div class="post_list_content_unit">
<h2 class="post_list_item_title"><a href="<?php
the_permalink();
?>
" title="<?php
_e('View full', 'stm_domain');
?>
"><?php
esc_attr(the_title());
?>
</a></h2>
<div class="post_list_meta_unit">
<div class="date-d"><?php
echo get_the_date('d');
?>
</div>
<div class="date-m"><?php
echo get_the_date('M');
?>
</div>
<?php
$comments_num = get_comments_number(get_the_id());
?>
<?php
if ($comments_num) {
?>
示例9: stm_print_styles
function stm_print_styles()
{
$site_css = stm_option('site_css');
if ($site_css) {
$site_css .= preg_replace('/\\s+/', ' ', $site_css);
}
wp_add_inline_style('theme-style', $site_css);
}
示例10: subscribe_with_confirmation
public static function subscribe_with_confirmation($email, $merge_vars)
{
$instance = new Mailchimp(stm_option('mailchimp_api_key'));
return $instance->lists->subscribe(stm_option('mailchimp_list_id'), array("email" => $email), $merge_vars);
}
示例11: stm_option
<?php
if (is_active_sidebar('footer_bottom')) {
?>
<?php
$footer_enabled = stm_option('footer_bottom');
$widget_areas = stm_option('footer_bottom_columns');
if (!$widget_areas) {
$widget_areas = 4;
}
?>
<?php
if ($footer_enabled) {
?>
<div id="footer_bottom">
<div class="footer_widgets_wrapper">
<div class="container">
<div class="widgets <?php
echo 'cols_' . esc_attr($widget_areas);
?>
clearfix">
<?php
dynamic_sidebar('footer_bottom');
?>
</div>
</div>
</div>
</div>
<?php
示例12: get_search_query
" type="text" class="form-control search-input" value="<?php
echo get_search_query();
?>
" name="s" />
<button type="submit" class="search-submit" ><i class="fa fa-search"></i></button>
</div>
</form>
</li>
</ul>
</div>
</div>
<!-- Desktop menu -->
<div class="col-md-8 col-md-offset-1 col-sm-9 col-sm-offset-0 hidden-xs hidden-sm">
<?php
$header_margin = stm_option('menu_top_margin');
if (empty($header_margin)) {
$header_margin = 5;
}
if (!$transparent_header) {
$header_margin += 4;
}
$menu_style = 'style="margin-top:' . $header_margin . 'px;"';
?>
<div class="header_main_menu_wrapper clearfix" <?php
echo $menu_style;
?>
>
<div class="pull-right hidden-xs">
示例13: stm_option
}
?>
</ul>
</div>
</div>
<?php
}
?>
<?php
$top_bar_address = stm_option('top_bar_address');
$top_bar_address_mobile = stm_option('top_bar_address_mobile');
$top_bar_working_hours = stm_option('top_bar_working_hours');
$top_bar_working_hours_mobile = stm_option('top_bar_working_hours_mobile');
$top_bar_phone = stm_option('top_bar_phone');
$top_bar_phone_mobile = stm_option('top_bar_phone_mobile');
if ($top_bar_address || $top_bar_working_hours || $top_bar_phone) {
?>
<div class="pull-right xs-pull-left">
<ul class="top_bar_info clearfix">
<?php
if ($top_bar_working_hours) {
?>
<li <?php
if (!$top_bar_working_hours_mobile) {
?>
class="hidden-info"<?php
}
?>
><i class="fa fa-clock-o"></i> <?php
echo balanceTags($top_bar_working_hours, true);
示例14: stm_option
?>
" style="width: <?php
echo stm_option('logo_width', '246');
?>
px;" alt="<?php
bloginfo('name');
?>
"/>
<?php
if ($transparent_header) {
?>
<img class="img-responsive logo_colored_fixed hidden" src="<?php
echo esc_attr($logo_black);
?>
" style="width: <?php
echo stm_option('logo_width', '246');
?>
px;" alt="<?php
bloginfo('name');
?>
"/>
<?php
}
?>
</a>
<?php
} else {
?>
<a href="<?php
echo esc_url(home_url('/'));
?>
示例15: apply_filters
if (empty($woocommerce_loop['loop'])) {
$woocommerce_loop['loop'] = 0;
}
// Store column count for displaying the grid
if (empty($woocommerce_loop['columns'])) {
$woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
}
// Ensure visibility
if (!$product || !$product->is_visible()) {
return;
}
// Increase loop count
$woocommerce_loop['loop']++;
// Extra post classes
$classes = array();
$shop_sidebar_position = stm_option('shop_sidebar_position', 'none');
if (isset($_GET['sidebar_position']) and $_GET['sidebar_position'] == 'none') {
$shop_sidebar_position = 'none';
}
if ($shop_sidebar_position == 'none') {
$classes[] = 'col-md-3 col-sm-4 col-xs-6 course-col';
} else {
$classes[] = 'col-md-4 col-sm-4 col-xs-6 course-col';
}
if (0 == ($woocommerce_loop['loop'] - 1) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns']) {
$classes[] = 'first';
}
if (0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns']) {
$classes[] = 'last';
}
?>