本文整理汇总了PHP中themerex_strpos函数的典型用法代码示例。如果您正苦于以下问题:PHP themerex_strpos函数的具体用法?PHP themerex_strpos怎么用?PHP themerex_strpos使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了themerex_strpos函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: esc_attr
<?php
$post_title_tag = $opt['style'] == 'list' ? 'li' : 'h5';
$reviewsBlock = '';
$title = '<' . esc_attr($post_title_tag) . ' class="sc_blogger_title sc_title' . (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? ' sc_accordion_title' : '') . '">' . ((!isset($opt['links']) || $opt['links']) && !in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '<a href="' . esc_url($post_data['post_link']) . '">' : '') . (themerex_substr($opt['style'], 0, 6) == 'bubble' ? '<span class="sc_title_bubble_icon ' . ($post_data['post_icon'] != '' ? ' ' . esc_attr($post_data['post_icon']) : '') . '"' . ($post_data['bubble_color'] != '' ? ' style="background-color:' . esc_attr($post_data['bubble_color']) . '"' : '') . '></span>' : '') . (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '<span class="sc_accordion_icon"></span>' : '') . esc_html($post_data['post_title']) . ((!isset($opt['links']) || $opt['links']) && !in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '</a>' : '') . '</' . esc_attr($post_title_tag) . '>' . (in_array($opt['style'], array('accordion_1', 'accordion_2', 'list')) ? '' : $reviewsBlock);
if ($opt['style'] == 'list') {
echo balanceTags($title);
} else {
$thumb = $post_data['post_thumb'] && themerex_strpos($opt['style'], 'image') !== false ? '<div class="thumb hoverIncrease">' . ($post_data['post_link'] != '' ? balanceTags($post_data['post_thumb']) . '<a href="' . esc_url($post_data['post_link']) . '"><span class="hoverIcon"></span></a>' : balanceTags($post_data['post_thumb'])) . '<span class="hoverShadow"></span></div>' : '';
$info = sc_param_is_on($opt['info']) ? '<div class="sc_blogger_info">' . (themerex_strpos($opt['style'], 'image') !== false || themerex_strpos($opt['style'], 'accordion') !== false ? '<div class="sc_blogger_more sc_button sc_button_style_global sc_button_size_medium squareButton global medium"><a title="" href="' . esc_url($post_data['post_link']) . '">' . ($opt['readmore'] ? esc_html($opt['readmore']) : __('More', 'themerex')) . '</a></div><div class="sc_blogger_author">' . __('Posted by', 'themerex') : __('by', 'themerex')) . ' <a href="' . esc_url($post_data['post_author_url']) . '" class="post_author">' . esc_html($post_data['post_author']) . '</a>' . ($opt['counters'] != 'none' ? ' <span class="separator">|</span> ' . ($opt['orderby'] == 'comments' || $opt['counters'] == 'comments' ? __('Comments', 'themerex') : __('Views', 'themerex')) . ' <span class="comments_number">' . ($opt['orderby'] == 'comments' || $opt['counters'] == 'comments' ? esc_html($post_data['post_comments']) : esc_html($post_data['post_views'])) . '</span>' : '') . (themerex_strpos($opt['style'], 'image') !== false || themerex_strpos($opt['style'], 'accordion') !== false ? '</div>' : '') . '</div>' : '';
if ($opt['dir'] == 'horizontal' && $opt['style'] != 'date') {
?>
<div class="columns1_<?php
echo esc_attr($opt['posts_visible']);
?>
column_item_<?php
echo esc_attr($opt['number']);
echo ($opt['number'] % 2 == 1 ? ' odd' : ' even') . ($opt['number'] == 1 ? ' first' : '') . ($opt['number'] == $opt['posts_on_page'] ? ' columns_last' : '') . (sc_param_is_on($opt['scroll']) ? ' sc_scroll_slide swiper-slide' : '');
?>
">
<?php
}
?>
<article class="sc_blogger_item<?php
echo (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? ' sc_accordion_item' : '') . ($opt['number'] == $opt['posts_on_page'] && !sc_param_is_on($opt['loadmore']) ? ' sc_blogger_item_last' : '') . (sc_param_is_on($opt['scroll']) && ($opt['dir'] == 'vertical' || $opt['style'] == 'date') ? ' sc_scroll_slide swiper-slide' : '');
?>
"<?php
echo $opt['dir'] == 'horizontal' && $opt['style'] == 'date' ? ' style="width:' . 100 / $opt['posts_on_page'] . '%"' : '';
?>
>
示例2: themerex_compose_styles
function themerex_compose_styles()
{
global $wp_styles, $concatenate_scripts, $compress_css, $THEMEREX_styles_collector;
if (is_admin() || get_theme_option('compose_scripts') != 'yes' || !is_object($wp_styles)) {
return;
}
//$concatenate_scripts = $compress_css = true;
$theme_url = get_template_directory_uri();
foreach ($wp_styles->queue as $style) {
if (isset($wp_styles->registered[$style]) && themerex_strpos($wp_styles->registered[$style]->src, $theme_url) === 0 && themerex_strpos($wp_styles->registered[$style]->ver, 'no-compose') === false) {
//$dir = dirname(themerex_substr($wp_styles->registered[$style]->src, themerex_strlen($wp_styles->base_url))).'/';
$dir = dirname($wp_styles->registered[$style]->src) . '/';
if (file_exists($file = get_template_directory() . themerex_substr($wp_styles->registered[$style]->src, themerex_strlen($theme_url)))) {
$css = file_get_contents($file);
if (isset($wp_styles->registered[$style]->extra['after'])) {
foreach ($wp_styles->registered[$style]->extra['after'] as $add) {
$css .= "\n" . $add . "\n";
}
}
$pos = -1;
while (($pos = themerex_strpos($css, 'url(', $pos + 1)) !== false) {
if (themerex_substr($css, $pos, 9) == 'url(data:') {
continue;
}
$shift = 0;
if (($ch = themerex_substr($css, $pos + 4, 1)) == '"' || $ch == "'") {
$shift = 1;
}
$css = themerex_substr($css, 0, $pos + 4 + $shift) . $dir . themerex_substr($css, $pos + 4 + $shift);
}
$THEMEREX_styles_collector .= "\n" . $css . "\n";
$wp_styles->done[] = $style;
}
}
}
if ($THEMEREX_styles_collector) {
echo "\n<!-- Stylesheets composer -->\n<style type=\"text/css\">\n" . $THEMEREX_styles_collector . "\n</style>\n<!-- /Stylesheets composer -->\n";
}
}
示例3: getSelectorPropertyFromCSS
function getSelectorPropertyFromCSS($css, $selector, $prop)
{
$rez = '';
if (!file_exists($css)) {
return $rez;
}
$file = file($css);
foreach ($file as $row) {
if (($pos = themerex_strpos($row, $selector)) === false) {
continue;
}
if (($pos2 = themerex_strpos($row, $prop . ':', $pos)) !== false && ($pos3 = themerex_strpos($row, ';', $pos2)) !== false && $pos2 < $pos3) {
$rez = trim(chop(themerex_substr($row, $pos2 + themerex_strlen($prop) + 1, $pos3 - $pos2 - themerex_strlen($prop) - 1)));
break;
}
}
return $rez;
}
示例4: get_theme_option
</div>
<script type="text/javascript">
var reviews_max_level = <?php
echo $maxLevel;
?>
;
var reviews_levels = "<?php
echo get_theme_option('reviews_criterias_levels');
?>
";
var reviews_vote = "<?php
echo isset($_COOKIE['reviews_vote']) ? $_COOKIE['reviews_vote'] : '';
?>
";
var allowUserReviews = <?php
echo (!$reviews_first_author || !$reviews_second_hide) && (!isset($_COOKIE['reviews_vote']) || themerex_strpos($_COOKIE['reviews_vote'], ',' . $post_id . ',') === false) && (get_theme_option('reviews_can_vote') == 'all' || is_user_logged_in()) ? 'true' : 'false';
?>
;
jQuery(document).ready(function () {
<?php
if ($use_tabs) {
?>
jQuery('.post_reviews').tabs();
<?php
}
?>
initReviews(true);
// Save user's marks
if (allowUserReviews) {
jQuery('.reviews_users_accept').click(function(e) {
示例5: getUploadsDirFromURL
function getUploadsDirFromURL($url)
{
$upload_info = wp_upload_dir();
$upload_dir = $upload_info['basedir'];
$upload_url = $upload_info['baseurl'];
$http_prefix = "http://";
$https_prefix = "https://";
if (!strncmp($url, $https_prefix, themerex_strlen($https_prefix))) {
//if url begins with https:// make $upload_url begin with https:// as well
$upload_url = str_replace($http_prefix, $https_prefix, $upload_url);
} else {
if (!strncmp($url, $http_prefix, themerex_strlen($http_prefix))) {
//if url begins with http:// make $upload_url begin with http:// as well
$upload_url = str_replace($https_prefix, $http_prefix, $upload_url);
}
}
// Check if $img_url is local.
if (false === themerex_strpos($url, $upload_url)) {
return false;
}
// Define path of image.
$rel_path = str_replace($upload_url, '', $url);
$img_path = $upload_dir . $rel_path;
return $img_path;
}
示例6: themerex_callback_view_more_posts
function themerex_callback_view_more_posts()
{
global $_REQUEST, $post, $wp_query;
if (!wp_verify_nonce($_REQUEST['nonce'], 'ajax_nonce')) {
die;
}
$response = array('error' => '', 'data' => '', 'no_more_data' => 0);
$page = $_REQUEST['page'];
$args = unserialize(stripslashes($_REQUEST['data']));
$vars = unserialize(stripslashes($_REQUEST['vars']));
if ($page > 0 && is_array($args) && is_array($vars)) {
extract($vars);
$args['page'] = $page;
$args['paged'] = $page;
$args['ignore_sticky_posts'] = 1;
if (!isset($wp_query)) {
$wp_query = new WP_Query($args);
} else {
query_posts($args);
}
$per_page = count($wp_query->posts);
$response['no_more_data'] = $page >= $wp_query->max_num_pages;
//$per_page < $ppp;
$post_number = 0;
$accent_color = '';
$response['data'] = '';
$flt_ids = array();
while (have_posts()) {
the_post();
$post_number++;
$post_args = array('layout' => in_array(themerex_substr($vars['blog_style'], 0, 7), array('classic', 'masonry', 'portfol')) ? themerex_substr($vars['blog_style'], 0, 7) : $vars['blog_style'], 'number' => $post_number, 'add_view_more' => false, 'posts_on_page' => $per_page, 'thumb_size' => $vars['blog_style'], 'thumb_crop' => themerex_strpos($vars['blog_style'], 'masonry') === false, 'strip_teaser' => false, 'parent_cat_id' => $vars['parent_cat_id'], 'sidebar' => !in_array($vars['show_sidebar_main'], array('none', 'fullwidth')), 'filters' => $vars['filters'], 'hover' => $vars['hover'], 'show' => false);
$post_data = getPostData($post_args);
$response['data'] .= showPostLayout($post_args, $post_data);
if ($vars['filters'] == 'tags') {
if (count($post_data['post_tags_list']) > 0) {
foreach ($post_data['post_tags_list'] as $tag) {
$flt_ids[$tag->term_id] = $tag->name;
}
}
}
}
$response['filters'] = $flt_ids;
} else {
$response['error'] = __('Wrong query arguments', 'themerex');
}
echo json_encode($response);
die;
}
示例7: form
/**
* Displays the widget settings controls on the widget panel.
* Make use of the get_field_id() and get_field_name() function
* when creating your form elements. This handles the confusing stuff.
*/
function form($instance)
{
/* Set up some default widget settings. */
$defaults = array('title' => '', 'post_type' => 'post', 'description' => __('Posts and Events Calendar', 'themerex'));
$instance = wp_parse_args((array) $instance, $defaults);
$title = isset($instance['title']) ? $instance['title'] : '';
$post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post';
//$types = getPostsTypesList();
$types = array('post' => __('Posts', 'themerex'));
if (class_exists('TribeEvents')) {
$types['tribe_events'] = __('Events', 'themerex');
}
?>
<p>
<label for="<?php
echo esc_attr($this->get_field_id('title'));
?>
"><?php
_e('Widget title:', 'themerex');
?>
</label>
<input id="<?php
echo esc_attr($this->get_field_id('title'));
?>
" name="<?php
echo esc_attr($this->get_field_name('title'));
?>
" value="<?php
echo esc_attr($title);
?>
" style="width:100%;" />
</p>
<p>
<label for="<?php
echo esc_attr($this->get_field_id('post_type'));
?>
_1"><?php
_e('Post type:', 'themerex');
?>
</label>
<?php
$i = 0;
foreach ($types as $type => $type_title) {
$i++;
echo '<input type="checkbox" id="' . esc_attr($this->get_field_id('post_type')) . '_' . esc_attr($i) . '" name="' . esc_attr($this->get_field_name('post_type')) . '[]" value="' . esc_attr($type) . '"' . (themerex_strpos($post_type, $type) !== false ? ' checked="checked"' : '') . '><label for="' . esc_attr($this->get_field_id('post_type')) . '_' . esc_attr($i) . '">' . esc_html($type_title) . '</label> ';
}
?>
</select>
<br><span class="description"><?php
_e('Attention! If you check both post types, please check also "Include events in main blog loop" in the menu "Events - Settings"', 'themerex');
?>
</span>
</p>
<?php
}
示例8: getPostLikes
} else {
if ($show_counters == 'likes') {
$post_counters = getPostLikes($post_id);
$post_counters_icon = 'heart-1';
} else {
if ($show_counters == 'stars' || $show_counters == 'rating') {
$post_counters = marksToDisplay(get_post_meta($post_id, $post_rating, true));
$post_counters_icon = 'star-1';
} else {
$post_counters = get_comments_number($post_id);
$post_counters_icon = 'comment-1';
}
}
}
if ($show_counters == 'stars' && $post_counters > 0) {
if (themerex_strpos($post_counters, '.') === false) {
$post_counters .= '.0';
}
if (get_custom_option('show_reviews') == 'yes') {
$output .= '<div class="summaryRating">' . getReviewsSummaryStars($post_counters, false, false) . '</div>';
}
}
}
if ($show_date || $show_counters || $show_author) {
$output .= '
<div class="post_info">
';
if ($show_date) {
$output .= '
<span class="post_date">' . $post_date . '</span>
';
示例9: sc_testimonials_item
function sc_testimonials_item($atts, $content = null)
{
if (in_shortcode_blogger()) {
return '';
}
extract(shortcode_atts(array("id" => "", "name" => "", "position" => "", "photo" => "", "email" => ""), $atts));
global $THEMEREX_sc_testimonials_count, $THEMEREX_sc_testimonials_width, $THEMEREX_sc_testimonials_height;
$THEMEREX_sc_testimonials_count++;
$photo = getAttachmentID($photo);
if (empty($photo)) {
if (!empty($email)) {
$photo = get_avatar($email, 50);
}
} else {
$photo = getResizedImageTag($photo, 50, 50);
}
$author_show = $position . $photo . $email != '';
$s = (!empty($THEMEREX_sc_testimonials_width) ? 'width:' . $THEMEREX_sc_testimonials_width . (themerex_strpos($THEMEREX_sc_testimonials_width, '%') !== false ? '' : 'px') . ';' : '') . (!empty($THEMEREX_sc_testimonials_height) ? 'height:' . $THEMEREX_sc_testimonials_height . (themerex_strpos($THEMEREX_sc_testimonials_height, '%') !== false ? '' : 'px') . ';' : '');
$c = $author_show ? ' sc_testimonials_item_author_show' : '';
//if (empty($photo)) $photo = '<img src="'.get_template_directory_uri().'/images/no-ava.png" alt="">';
return '<li' . ($id ? ' id="sc_testimonials_item_' . $id . '"' : '') . ' class="sc_testimonials_item swiper-slide' . $c . '" ' . ($s != '' ? 'style="' . $s . '"' : '') . '>' . '<div class="sc_testimonials_item_content">' . '<div class="sc_testimonials_item_quote"><span class="sc_testimonials_item_text"><span class="sc_testimonials_item_text_before">' . do_shortcode(strip_tags($content)) . '</span></span></div>' . ($author_show ? '<div class="sc_testimonials_item_author">' . ($photo != '' ? '<div class="sc_testimonials_item_avatar">' . $photo . '</div>' : '') . '<div class="sc_testimonials_item_user">' . ($name != '' ? '<span class="sc_testimonials_item_name">' . $name . '</span>' : '') . ($position != '' ? '<span class="sc_testimonials_item_position">' . $position . '</span>' : '') . '</div>' . '</div>' : '') . '</div>' . '</li>';
}
示例10: themerex_substr
<?php
global $THEMEREX_usermenu, $THEMEREX_usermenu_show;
if (empty($THEMEREX_usermenu) || !$THEMEREX_usermenu_show) {
?>
<ul id="usermenu" class="usermenu_list">
<?php
} else {
$menu = themerex_substr($THEMEREX_usermenu, 0, themerex_strlen($THEMEREX_usermenu) - 5);
$pos = themerex_strpos($menu, '<ul');
if ($pos !== false) {
$menu = themerex_substr($menu, 0, $pos + 3) . ' class="usermenu_list"' . themerex_substr($menu, $pos + 3);
}
echo str_replace('class=""', '', $menu);
}
?>
<?php
if (is_woocommerce_page() && get_custom_option('show_currency') == 'yes') {
?>
<li class="usermenu_currency">
<a href="#">$</a>
<ul>
<li><a href="#"><b>$</b> <?php
_e('Dollar', 'themerex');
?>
</a></li>
<li><a href="#"><b>€</b> <?php
_e('Euro', 'themerex');
?>
</a></li>
示例11: do_shortcode
$post_content_full = $post->post_content;
//get_the_content() not used, because it trim content up to <!-- more --> in each case!
$post_content_prepared = do_shortcode($post_content_full);
} else {
// ----------------- New way to get title, excerpt and content -----------------------
$post_title = get_the_title();
global $more;
$old_more = $more;
$more = -1;
$post_content_full = get_the_content();
$post_content_prepared = do_shortcode($post_content_full);
$more = $old_more;
$post_content = get_the_content('<span class="readmore">' . __('Read more', 'themerex') . '</span>');
$post_excerpt = has_excerpt() || $post_protected ? get_the_excerpt() : '';
if (empty($post_excerpt)) {
if (($more_pos = themerex_strpos($post_content_full, '<span id="more-')) !== false) {
$post_excerpt = themerex_substr($post_content_full, 0, $more_pos);
} else {
$post_excerpt = in_array($post_format, array('quote', 'link')) ? $post_content : get_the_excerpt();
}
}
$post_excerpt = $post_descr = str_replace('[…]', '', force_balance_tags($post_excerpt));
}
// Substitute WP [gallery] shortcode
if (get_custom_option('substitute_gallery') == 'yes') {
$post_excerpt = substituteGallery($post_excerpt, $post_id, $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h']);
$post_descr = substituteGallery($post_descr, $post_id, $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h']);
$post_content = substituteGallery($post_content, $post_id, $thumb_size[$blog_style]['w'], $thumb_size[$blog_style]['h'], 'none', true);
}
$post_title = apply_filters('the_title', $post_title);
$post_descr = apply_filters(in_array($post_format, array('quote', 'link')) ? 'the_content' : 'the_excerpt', $post_descr);
示例12: strip_tags
}
// Author marks
$output .= '<div class="sc_tabs_array">';
if ($reviews_first_author || !$reviews_second_hide) {
$field["id"] = "reviews_marks_author";
$field["descr"] = strip_tags($post_data['post_excerpt']);
$field["accept"] = false;
$marks = marksToDisplay(marksPrepare(get_custom_option('reviews_marks'), count($field['options'])));
$output .= '<div class="reviewTab" id="author-tabs">' . getReviewsMarkup($field, $marks, false, false, $reviews_first_author) . '</div>';
}
// Users marks
if (!$reviews_first_author || !$reviews_second_hide) {
$marks = marksToDisplay(marksPrepare(get_post_meta($post_data['post_id'], 'reviews_marks2', true), count($field['options'])));
$users = max(0, get_post_meta($post_data['post_id'], 'reviews_users', true));
$field["id"] = "reviews_marks_users";
$field["descr"] = sprintf(__("Summary rating from <b>%s</b> user's marks.", 'themerex'), $users) . ' ' . (!isset($_COOKIE['reviews_vote']) || themerex_strpos($_COOKIE['reviews_vote'], ',' . $post_data['post_id'] . ',') === false ? __('You can set own marks for this article - just click on stars above and press "Accept".', 'themerex') : __('Thanks for your vote!', 'themerex'));
$field["accept"] = $allowUserReviews;
$output .= '<div class="reviewTab" id="users-tabs"' . (!$output ? ' style="display: block;"' : '') . '>' . getReviewsMarkup($field, $marks, $allowUserReviews, false, !$reviews_first_author) . '</div>';
}
$output .= '</div>';
$THEMEREX_REVIEWS_RATING .= $output . '</div>';
if ($allowUserReviews) {
$THEMEREX_REVIEWS_RATING .= '
<script type="text/javascript">
var reviews_max_level = ' . $maxLevel . ';
var reviews_levels = "' . get_theme_option('reviews_criterias_levels') . '";
var reviews_vote = "' . (isset($_COOKIE['reviews_vote']) ? $_COOKIE['reviews_vote'] : '') . '";
var marks = "' . $marks . '".split(",");
var users = ' . max(0, $users) . ';
var post_id = ' . $post_data['post_id'] . ';
allowUserReviews = ' . ($allowUserReviews ? 'true' : 'false') . ';
示例13: sc_title
function sc_title($atts, $content = null)
{
extract(shortcode_atts(array("id" => "", "type" => "1", "style" => "regular", "icon" => "", "bubble_color" => "", "weight" => "", "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts));
$s = ($top !== '' ? 'margin-top:' . $top . 'px;' : '') . ($bottom !== '' ? 'margin-bottom:' . $bottom . 'px;' : '') . ($left !== '' ? 'margin-left:' . $left . 'px;' : '') . ($right !== '' ? 'margin-right:' . $right . 'px;' : '') . ($weight ? 'font-weight:' . $weight . ';' : '');
$type = min(6, max(1, $type));
$icon_file = $icon != '' && file_exists(get_template_directory() . '/images/icons/' . $icon . '.png');
return '<h' . $type . ($id ? ' id="' . $id . '"' : '') . ($style == 'underline' ? ' class="sc_title_underline"' : (themerex_strpos($style, 'bubble') !== false ? ' class="sc_title_bubble sc_title_' . $style . '"' : (themerex_strpos($style, 'icon') !== false ? ' class="sc_title_icon sc_title_' . $style . '"' : ''))) . ($s != '' ? ' style="' . $s . '"' : '') . '>' . (themerex_substr($style, 0, 6) == 'bubble' ? '<span class="sc_title_bubble_icon ' . ($icon != '' && !$icon_file ? ' icon-' . $icon : '') . '"' . ($bubble_color != '' ? ' style="background-color:' . $bubble_color . '"' : '') . '>' . ($icon_file ? '<img src="' . get_template_directory_uri() . '/images/icons/' . $icon . '.png" />' : '') . '</span>' : (themerex_substr($style, 0, 4) == 'icon' ? '<img src="' . get_template_directory_uri() . '/images/icons/' . $icon . '.png" />' . ($style == 'icon_top' ? '<br />' : '') : '')) . do_shortcode($content) . '</h' . $type . '>';
}
示例14: is_themerex_options_used
function is_themerex_options_used()
{
return is_admin() && (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'themerex_options_save' || $_REQUEST['action'] == 'themerex_options_import') || themerex_strpos($_SERVER['REQUEST_URI'], 'themerex_options') !== false || themerex_strpos($_SERVER['REQUEST_URI'], 'post-new.php') !== false || themerex_strpos($_SERVER['REQUEST_URI'], 'post.php') !== false || themerex_strpos($_SERVER['REQUEST_URI'], 'edit-tags.php') !== false && themerex_strpos($_SERVER['REQUEST_URI'], 'taxonomy=category') !== false || isset($_POST['meta_box_category_nonce']) || isset($_REQUEST['action']) && $_REQUEST['action'] == 'add-tag' && isset($_REQUEST['_wp_http_referer']) && themerex_strpos($_REQUEST['_wp_http_referer'], 'edit-tags.php') !== false && themerex_strpos($_REQUEST['_wp_http_referer'], 'taxonomy=category') !== false) || !is_admin() && (get_theme_option("allow_editor") == 'yes' && (is_single() && current_user_can('edit_posts', get_the_ID()) || is_page() && current_user_can('edit_pages', get_the_ID())));
}
示例15: themerex_get_file_dir
<?php
$post_title_tag = $opt['style'] == 'list' ? 'li' : 'h4';
require themerex_get_file_dir('/templates/page-part-reviews-summary.php');
$title = '<' . $post_title_tag . ' class="sc_blogger_title sc_title' . (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? ' sc_accordion_title' : '') . '">' . ((!isset($opt['links']) || $opt['links']) && !in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '<a href="' . $post_data['post_link'] . '">' : '') . (themerex_substr($opt['style'], 0, 6) == 'bubble' ? '<span class="sc_title_bubble_icon ' . ($post_data['post_icon'] != '' ? ' ' . $post_data['post_icon'] : '') . '"' . ($post_data['bubble_color'] != '' ? ' style="background-color:' . $post_data['bubble_color'] . '"' : '') . '></span>' : '') . (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '<span class="sc_accordion_icon"></span>' : '') . $post_data['post_title'] . ((!isset($opt['links']) || $opt['links']) && !in_array($opt['style'], array('accordion_1', 'accordion_2')) ? '</a>' : '') . '</' . $post_title_tag . '>' . (in_array($opt['style'], array('accordion_1', 'accordion_2', 'list')) ? '' : $reviewsBlock);
if ($opt['style'] == 'list') {
echo $title;
} else {
$thumb = $post_data['post_thumb'] && themerex_strpos($opt['style'], 'image') !== false ? '<div class="thumb">' . ($post_data['post_link'] != '' ? '<a href="' . $post_data['post_link'] . '">' . $post_data['post_thumb'] . '</a>' : $post_data['post_thumb']) . '</div>' : '';
$info = sc_param_is_on($opt['info']) ? '<div class="sc_blogger_info">' . (themerex_strpos($opt['style'], 'image') !== false || themerex_strpos($opt['style'], 'accordion') !== false ? '<div class="squareButton light ico sc_blogger_more"><a class="icon-link" title="" href="' . $post_data['post_link'] . '">' . ($opt['readmore'] ? $opt['readmore'] : __('More', 'themerex')) . '</a></div><div class="sc_blogger_author">' . __('Posted by', 'themerex') : __('by', 'themerex')) . ' <a href="' . $post_data['post_author_url'] . '" class="post_author">' . $post_data['post_author'] . '</a>' . ($opt['counters'] != 'none' ? ' <span class="separator">|</span> ' . ($opt['orderby'] == 'comments' || $opt['counters'] == 'comments' ? __('Comments', 'themerex') : __('Views', 'themerex')) . ' <span class="comments_number">' . ($opt['orderby'] == 'comments' || $opt['counters'] == 'comments' ? $post_data['post_comments'] : $post_data['post_views']) . '</span>' : '') . (themerex_strpos($opt['style'], 'image') !== false || themerex_strpos($opt['style'], 'accordion') !== false ? '</div>' : '') . '</div>' : '';
if ($opt['dir'] == 'horizontal' && $opt['style'] != 'date') {
?>
<div class="columns1_<?php
echo $opt['posts_visible'];
?>
column_item_<?php
echo $opt['number'];
echo ($opt['number'] % 2 == 1 ? ' odd' : ' even') . ($opt['number'] == 1 ? ' first' : '') . ($opt['number'] == $opt['posts_on_page'] ? ' columns_last' : '');
//. (sc_param_is_on($opt['scroll']) ? ' sc_scroll_slide swiper-slide' : '');
?>
">
<?php
}
?>
<article class="sc_blogger_item<?php
echo (in_array($opt['style'], array('accordion_1', 'accordion_2')) ? ' sc_accordion_item' : '') . ($opt['number'] == $opt['posts_on_page'] && !sc_param_is_on($opt['loadmore']) ? ' sc_blogger_item_last' : '');
//. (sc_param_is_on($opt['scroll']) && ($opt['dir'] == 'vertical' || $opt['style'] == 'date') ? ' sc_scroll_slide swiper-slide' : '');
?>
"<?php
echo $opt['dir'] == 'horizontal' && $opt['style'] == 'date' ? ' style="width:' . 100 / $opt['posts_on_page'] . '%"' : '';