本文整理汇总了PHP中vc_is_inline函数的典型用法代码示例。如果您正苦于以下问题:PHP vc_is_inline函数的具体用法?PHP vc_is_inline怎么用?PHP vc_is_inline使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vc_is_inline函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: presscore_vc_inline_editor_scripts
/**
* Visual Composer custom view scripts
*
* @since 1.0.0
*/
function presscore_vc_inline_editor_scripts()
{
if (!function_exists('vc_is_inline') || !vc_is_inline()) {
return;
}
wp_enqueue_script('vc-custom-view-by-dt', get_template_directory_uri() . '/inc/shortcodes/js/vc-custom-view.js', array(), false, true);
}
示例2: presscore_remove_puny_effect_for_vc_inline_editor
function presscore_remove_puny_effect_for_vc_inline_editor($puny_shortcodes = array())
{
if (function_exists('vc_is_inline') && vc_is_inline()) {
return array();
}
return $puny_shortcodes;
}
示例3: load_admin_static
public static function load_admin_static()
{
wp_enqueue_style('dt-vc-bridge', PRESSCORE_THEME_URI . '/inc/shortcodes/css/js_composer_bridge.css');
if (function_exists('vc_is_inline') && vc_is_inline()) {
wp_enqueue_script('vc-custom-view-by-dt', PRESSCORE_THEME_URI . '/inc/shortcodes/js/vc-custom-view.js', array(), false, true);
}
}
示例4: WT_VCSC_IsEditPagePost
function WT_VCSC_IsEditPagePost($new_edit = null)
{
global $pagenow, $typenow;
if (function_exists('vc_is_inline')) {
$vc_is_inline = vc_is_inline();
if (!vc_is_inline() && !is_admin()) {
return false;
}
} else {
$vc_is_inline = false;
if (!is_admin()) {
return false;
}
}
if ($new_edit == "edit") {
return in_array($pagenow, array('post.php'));
} else {
if ($new_edit == "new") {
return in_array($pagenow, array('post-new.php'));
} else {
if ($vc_is_inline == true) {
return true;
} else {
return in_array($pagenow, array('post.php', 'post-new.php'));
}
}
}
}
示例5: shortcode
public function shortcode($atts, $content = null)
{
extract(shortcode_atts(array('featured_images' => 'true', 'round_images' => '', 'images_width' => 60, 'images_height' => 60, 'category' => '', 'order' => '', 'orderby' => '', 'number' => 6, 'columns' => 1), $atts));
// sanitize attributes
$featured_images = apply_filters('dt_sanitize_flag', $featured_images);
$round_images = apply_filters('dt_sanitize_flag', $round_images);
$order = apply_filters('dt_sanitize_order', $order);
$orderby = apply_filters('dt_sanitize_orderby', $orderby);
$number = apply_filters('dt_sanitize_posts_per_page', $number);
$columns = absint($columns);
$images_width = absint($images_width);
$images_height = absint($images_height);
if ($category) {
$category = explode(',', $category);
$category = array_map('trim', $category);
}
$related_posts_args = array('exclude_current' => false, 'post_type' => 'post', 'taxonomy' => 'category', 'field' => 'slug', 'args' => array('posts_per_page' => $number, 'orderby' => $orderby, 'order' => $order));
if (!empty($category)) {
$related_posts_args['cats'] = $category;
$related_posts_args['select'] = 'only';
} else {
$related_posts_args['select'] = 'all';
}
$attachments_data = presscore_get_related_posts($related_posts_args);
$list_args = array('show_images' => $featured_images, 'image_dimensions' => array('w' => $images_width, 'h' => $images_height));
$posts_list = presscore_get_posts_small_list($attachments_data, $list_args);
switch ($columns) {
case 2:
$column_class = 'wf-1-2';
break;
case 3:
$column_class = 'wf-1-3';
break;
case 1:
default:
$column_class = 'wf-1';
}
$output = '';
if ($posts_list) {
foreach ($posts_list as $p) {
$output .= sprintf('<div class="wf-cell %s"><div class="borders">%s</div></div>', $column_class, $p);
}
$section_class = 'items-grid wf-container';
if ($featured_images && $round_images) {
$section_class .= ' round-images';
}
$output = '<section class="' . $section_class . '">' . $output . '</section>';
}
if (function_exists('vc_is_inline') && vc_is_inline()) {
$terms_list = presscore_get_terms_list_by_slug(array('slugs' => $category, 'taxonomy' => 'category'));
$output = '
<div class="dt_vc-shortcode_dummy dt_vc-mini_blog" style="height: 250px;">
<h5>Mini blog</h4>
<p class="text-small"><strong>Display categories:</strong> ' . $terms_list . '</p>
</div>
';
}
return $output;
}
示例6: dt_get_puny_shortcodes
/**
* Some shortcodes triks.
* From: http://www.viper007bond.com/2009/11/22/wordpress-code-earlier-shortcodes/
*/
function dt_get_puny_shortcodes()
{
$puny_shortcodes = array('dt_gap' => array(DT_Shortcode_Gap::get_instance(), 'shortcode'), 'dt_divider' => array(DT_Shortcode_Divider::get_instance(), 'shortcode'), 'dt_stripe' => array(DT_Shortcode_Stripe::get_instance(), 'shortcode'), 'dt_box' => array(DT_Shortcode_Box::get_instance(), 'shortcode'), 'dt_cell' => array(DT_Shortcode_Columns::get_instance(), 'shortcode_cell'), 'dt_code' => array(DT_Shortcode_Code::get_instance(), 'shortcode_prepare'), 'dt_toggle' => array(DT_Shortcode_Toggles::get_instance(), 'shortcode'), 'dt_item' => array(DT_Shortcode_Accordion::get_instance(), 'shortcode_item'), 'dt_benefits' => array(DT_Shortcode_Benefits::get_instance(), 'shortcode_benefits'), 'dt_benefit' => array(DT_Shortcode_Benefits::get_instance(), 'shortcode_benefit'), 'dt_progress_bars' => array(DT_Shortcode_ProgressBars::get_instance(), 'shortcode_bars'), 'dt_progress_bar' => array(DT_Shortcode_ProgressBars::get_instance(), 'shortcode_bar'), 'dt_button' => array(DT_Shortcode_Button::get_instance(), 'shortcode'), 'dt_teaser' => array(DT_Shortcode_Teaser::get_instance(), 'shortcode'), 'dt_call_to_action' => array(DT_Shortcode_CallToAction::get_instance(), 'shortcode'), 'dt_fancy_image' => array(DT_Shortcode_FancyImage::get_instance(), 'shortcode'), 'dt_list_item' => array(DT_Shortcode_List::get_instance(), 'shortcode_item'), 'dt_list' => array(DT_Shortcode_List::get_instance(), 'shortcode_list'), 'dt_quote' => array(DT_Shortcode_Quote::get_instance(), 'shortcode'), 'dt_banner' => array(DT_Shortcode_Banner::get_instance(), 'shortcode'), 'dt_accordion' => array(DT_Shortcode_Accordion::get_instance(), 'shortcode_accordion'), 'dt_text' => array(DT_Shortcode_AnimatedText::get_instance(), 'shortcode'), 'dt_social_icons' => array(DT_Shortcode_SocialIcons::get_instance(), 'shortcode_icons_content'), 'dt_social_icon' => array(DT_Shortcode_SocialIcons::get_instance(), 'shortcode_icon'), 'dt_vc_list_item' => array(DT_Shortcode_List_Vc::get_instance(), 'shortcode_item'), 'dt_vc_list' => array(DT_Shortcode_List_Vc::get_instance(), 'shortcode_list'));
if (function_exists('vc_is_inline') && vc_is_inline()) {
$puny_shortcodes = array();
}
return apply_filters('dt_get_puny_shortcodes', $puny_shortcodes);
}
示例7: initIfActive
protected function initIfActive()
{
vc_is_inline() && !defined('CONCATENATE_SCRIPTS') && define('CONCATENATE_SCRIPTS', false);
if ($this->get('vceditor') === 'true') {
$this->addFilter('the_content', 'addContentAnchor');
do_action('vc_inline_editor_page_view');
$this->addAction('wp_enqueue_scripts', 'loadIFrameJsCss');
}
}
示例8: shortcode
public function shortcode($atts, $content = null)
{
extract(shortcode_atts(array('posts' => '', 'width' => '800', 'height' => '450', 'autoplay' => 'false', 'interval' => '5000'), $atts));
// sanitize attributes
$width = absint($width);
$height = absint($height);
$interval = absint($interval);
$autoplay = apply_filters('dt_sanitize_flag', $autoplay);
$posts = array_map('trim', explode(',', $posts));
$attachments_id = array();
$selected_posts_titles = array();
if ($posts) {
// get posts by slug
foreach ($posts as $post_slug) {
$args = array('no_found_rows' => 1, 'ignore_sticky_posts' => 1, 'posts_per_page' => 1, 'post_type' => 'dt_slideshow', 'post_status' => 'publish', 'name' => $post_slug);
$dt_query = new WP_Query($args);
if ($dt_query->have_posts()) {
$dt_post = $dt_query->posts[0];
$selected_posts_titles[] = get_the_title($dt_post);
$slides_id = get_post_meta($dt_post->ID, '_dt_slider_media_items', true);
if ($slides_id) {
$attachments_id = array_merge($attachments_id, $slides_id);
}
}
}
// get fresh one
} else {
$args = array('no_found_rows' => 1, 'ignore_sticky_posts' => 1, 'posts_per_page' => 1, 'post_type' => 'dt_slideshow', 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC');
$dt_query = new WP_Query($args);
if ($dt_query->have_posts()) {
$dt_post = $dt_query->posts[0];
$selected_posts_titles[] = get_the_title($dt_post);
$slides_id = get_post_meta($dt_post->ID, '_dt_slider_media_items', true);
if ($slides_id) {
$attachments_id = array_merge($attachments_id, $slides_id);
}
}
}
if (function_exists('vc_is_inline') && vc_is_inline()) {
if (empty($selected_posts_titles)) {
$dummy_posts_titles = __('No posts selected', 'the7mk2');
} else {
$dummy_posts_titles = esc_html(join(', ', $selected_posts_titles));
}
$output = '
<div class="dt_vc-shortcode_dummy dt_vc-royal_slider" style="height: 250px;">
<h5>Royal slider</h4>
<p class="text-small"><strong>Display slider(s):</strong> ' . $dummy_posts_titles . '</p>
</div>
';
} else {
$attachments_data = presscore_get_attachment_post_data($attachments_id);
$output = presscore_get_royal_slider($attachments_data, array('width' => $width, 'height' => $height, 'autoplay' => $autoplay, 'interval' => $interval, 'class' => array('slider-simple', 'shortcode-royal-slider'), 'style' => ' style="width: 100%"'));
}
return $output;
}
示例9: wpex_is_front_end_composer
function wpex_is_front_end_composer()
{
if (!function_exists('vc_is_inline')) {
return false;
} elseif (vc_is_inline()) {
return true;
} else {
return false;
}
}
示例10: custom_css_classes_for_vc_row_and_vc_column
function custom_css_classes_for_vc_row_and_vc_column($class_string, $tag)
{
if ($tag == 'vc_row' || $tag == 'vc_row_inner') {
$class_string = str_replace('vc_row-fluid', 'wf-container', $class_string);
}
if ($tag == 'vc_column' || $tag == 'vc_column_inner') {
if (!(function_exists('vc_is_inline') && vc_is_inline())) {
$class_string = preg_replace('/vc_span(\\d{1,2})/', 'wf-cell wf-span-$1', $class_string);
}
}
return $class_string;
}
示例11: __construct
function __construct()
{
add_action('init', array($this, 'swatch_book_init'));
add_action("wp_enqueue_scripts", array($this, "register_swatch_assets"), 1);
if (function_exists('vc_is_inline')) {
if (!vc_is_inline()) {
add_shortcode('swatch_container', array($this, 'swatch_container'));
add_shortcode('swatch_item', array($this, 'swatch_item'));
}
} else {
add_shortcode('swatch_container', array($this, 'swatch_container'));
add_shortcode('swatch_item', array($this, 'swatch_item'));
}
}
示例12: __construct
function __construct()
{
add_action('admin_init', array($this, 'swatch_book_init'));
add_action('wp_enqueue_scripts', array($this, 'frontend_scripts'));
if (function_exists('vc_is_inline')) {
if (!vc_is_inline()) {
add_shortcode('swatch_container', array($this, 'swatch_container'));
add_shortcode('swatch_item', array($this, 'swatch_item'));
}
} else {
add_shortcode('swatch_container', array($this, 'swatch_container'));
add_shortcode('swatch_item', array($this, 'swatch_item'));
}
}
示例13: __construct
function __construct()
{
$this->connector_animate = '';
$this->connect_color = '';
$this->icon_style = '';
$this->icon_style = '';
add_action('admin_init', array($this, 'add_info_list'));
if (function_exists('vc_is_inline')) {
if (!vc_is_inline()) {
add_shortcode('info_list', array($this, 'info_list'));
add_shortcode('info_list_item', array($this, 'info_list_item'));
}
} else {
add_shortcode('info_list', array($this, 'info_list'));
add_shortcode('info_list_item', array($this, 'info_list_item'));
}
}
示例14: symple_skillbar_shortcode
function symple_skillbar_shortcode($atts)
{
// Parse and extract shortcode attributes
extract(shortcode_atts(array('title' => '', 'percentage' => '100', 'color' => '#6adcfa', 'class' => '', 'show_percent' => 'true'), $atts));
// Define output var
$output = '';
// Enque scripts
wp_enqueue_script('symple_skillbar');
// Inline js
if (function_exists('vc_is_inline') && vc_is_inline()) {
$output .= '<script>
jQuery(function($){
$(document).ready(function(){
$(".symple-skillbar").each(function(){
$(this).find(".symple-skillbar-bar").animate({ width: $(this).attr("data-percent") }, 800 );
});
});
});</script>';
}
// Open skillbar main wrapper
$output .= '<div class="symple-skillbar symple-clearfix ' . $class . '" data-percent="' . $percentage . '%">';
// Display title
if ($title) {
$output .= '<div class="symple-skillbar-title" style="background: ' . $color . ';"><span>' . $title . '</span></div>';
}
// Display bar
$output .= '<div class="symple-skillbar-bar" style="background: ' . $color . ';"></div>';
// Display percentage
if ($show_percent == 'true') {
$output .= '<div class="symple-skill-bar-percent">' . $percentage . '%</div>';
}
// Close main wrapper
$output .= '</div>';
// Return output
return $output;
}
示例15: portfolio_slider
/**
* Portfolio slider.
*
*/
public function portfolio_slider($attributes = array())
{
$config = Presscore_Config::get_instance();
$slider_class = array();
if ('disabled' == $config->get('sidebar_position')) {
$slider_class[] = 'full';
}
$slider_fields = array();
if ($attributes['show_title']) {
$slider_fields[] = 'title';
}
if ($attributes['meta_info']) {
$slider_fields[] = 'meta';
}
if ($attributes['show_excerpt']) {
$slider_fields[] = 'description';
}
if ($attributes['show_link']) {
$slider_fields[] = 'link';
}
if ($attributes['show_zoom']) {
$slider_fields[] = 'zoom';
}
if ($attributes['show_details']) {
$slider_fields[] = 'details';
}
$slider_style = array();
if ($attributes['margin_bottom']) {
$slider_style[] = 'margin-bottom: ' . $attributes['margin_bottom'];
}
if ($attributes['margin_top']) {
$slider_style[] = 'margin-top: ' . $attributes['margin_top'];
}
$slider_args = array('mode' => $attributes['appearance'], 'fields' => $slider_fields, 'class' => $slider_class, 'style' => implode(';', $slider_style), 'under_image_buttons' => $attributes['under_image_buttons'], 'hover_animation' => $attributes['hover_animation'], 'hover_bg_color' => $attributes['hover_bg_color'], 'hover_content_visibility' => $attributes['hover_content_visibility']);
if ($attributes['height']) {
$slider_args['height'] = $attributes['height'];
}
if ($attributes['width']) {
$slider_args['img_width'] = $attributes['width'];
}
if (function_exists('vc_is_inline') && vc_is_inline()) {
$terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => 'dt_portfolio_category'));
$output = '
<div class="dt_vc-shortcode_dummy dt_vc-portfolio_scroller" style="height: ' . $slider_args['height'] . 'px;">
<h5>Portfolio scroller</h5>
<p class="text-small"><strong>Display categories:</strong> ' . $terms_list . '</p>
</div>
';
} else {
$related_posts_args = array('exclude_current' => false, 'post_type' => 'dt_portfolio', 'taxonomy' => 'dt_portfolio_category', 'field' => 'slug', 'args' => array('posts_per_page' => $attributes['number'], 'orderby' => $attributes['orderby'], 'order' => $attributes['order']));
$related_posts_args['cats'] = $attributes['category'];
if (!empty($attributes['category'])) {
$related_posts_args['select'] = 'only';
} else {
$related_posts_args['select'] = 'all';
}
$attachments_data = presscore_get_related_posts($related_posts_args);
$output = presscore_get_fullwidth_slider_two_with_hovers($attachments_data, $slider_args);
}
return $output;
}