本文整理汇总了PHP中vcex_inline_js函数的典型用法代码示例。如果您正苦于以下问题:PHP vcex_inline_js函数的具体用法?PHP vcex_inline_js怎么用?PHP vcex_inline_js使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vcex_inline_js函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$button_data = array();
if ($button_hover_bg_color) {
$button_data[] = 'data-hover-background="' . $button_hover_bg_color . '"';
}
if ($button_hover_color) {
$button_data[] = 'data-hover-color="' . $button_hover_color . '"';
}
$button_data = implode(' ', $button_data);
// Button Style
$border_color = 'outline' == $button_style ? $button_color : '';
$button_style = vcex_inline_style(array('background' => $button_bg_color, 'color' => $button_color, 'letter_spacing' => $button_letter_spacing, 'font_size' => $button_size, 'padding' => $button_padding, 'border_radius' => $button_border_radius, 'font_weight' => $button_weight, 'border_color' => $border_color));
}
}
// Load inline js for the front-end composer
if (!empty($inline_js)) {
vcex_inline_js($inline_js);
}
?>
<div class="<?php
echo $wrapper_classes;
?>
"<?php
vcex_unique_id($unique_id);
?>
>
<?php
// Display plan
if ($plan) {
?>
示例2: vcex_parallax_bg
function vcex_parallax_bg($atts)
{
// Extract attributes
extract($atts);
// Make sure parallax is enabled
if (empty($vcex_parallax)) {
return;
}
// Return if a video is defined
if (!empty($video_bg) && 'none' != $video_bg) {
return;
}
// Sanitize $bg_image
$bg_image = !empty($atts['parallax_image']) ? wp_get_attachment_url($atts['parallax_image']) : $bg_image;
// Background image is obviously required
if (empty($bg_image)) {
return;
}
// Load inline js
vcex_inline_js(array('parallax'));
// Sanitize data
$parallax_style = !empty($parallax_style) ? $parallax_style : 'fixed-no-repeat';
$parallax_speed = !empty($parallax_speed) ? abs($parallax_speed) : '0.2';
$parallax_direction = !empty($parallax_direction) ? $parallax_direction : 'top';
// Classes
$classes = array('wpex-parallax-bg');
$classes[] = $parallax_style;
if (!$parallax_mobile) {
$classes[] = 'not-mobile';
}
$classes = apply_filters('wpex_parallax_classes', $classes);
$classes = implode(' ', $classes);
// Add style
$style = 'style="background-image: url(' . $bg_image . ');"';
// Attributes
$attributes = 'data-direction="' . $parallax_direction . '" data-velocity="-' . $parallax_speed . '"';
?>
<div class="<?php
echo $classes;
?>
" <?php
echo $style;
?>
<?php
echo $attributes;
?>
></div>
<?php
}
示例3: vcex_inline_js
$wrap_classes[] = 'wpex-data-hover';
$wrap_data[] = 'data-hover-color="' . $color_hover . '"';
}
if ($background_hover) {
if (!isset($wrap_classes['wpex-data-hover'])) {
$wrap_classes['wpex-data-hover'] = 'wpex-data-hover';
}
$wrap_classes[] = 'transition-all';
$wrap_data[] = 'data-hover-background="' . $background_hover . '"';
}
if ('true' == $hover_white_text) {
$wrap_classes[] = 'wpex-hover-white-text';
}
// Inline js
if ($color_hover || $background_hover) {
vcex_inline_js('data_hover');
}
// Inner style
$inner_style_attr = vcex_inline_style(array('border_color' => $inner_bottom_border_color));
// Icon output
if ($icon = vcex_get_icon_class($atts, 'icon')) {
// Enqueue needed icon font
if ('fontawesome' != $icon_type) {
vcex_enqueue_icon_font($icon_type);
}
// Icon style
$icon_style_attr = vcex_inline_style(array('color' => $icon_color));
// Icon output
$icon_output = '<div class="vcex-icon-wrap vcex-icon-position-' . $icon_position . '"' . $icon_style_attr . '><span class="' . $icon . '"></span></div>';
// Add icon to heading
if ('left' == $icon_position) {
示例4: get_terms
// Get terms
if ($parent_terms) {
$terms = get_terms($taxonomy, array('parent' => 0));
} else {
$terms = get_terms($taxonomy);
}
// Get term thumbnails
$term_data = wpex_get_term_data();
// Define post type based on the taxonomy
$taxonomy = get_taxonomy($taxonomy);
$post_type = $taxonomy->object_type[0];
// Grid classes
$grid_classes = array('vcex-terms-grid', 'wpex-row', 'clr');
if ('masonry' == $grid_style) {
$grid_classes[] = 'vcex-isotope-grid';
vcex_inline_js('isotope');
}
if ($columns_gap) {
$grid_classes[] = 'gap-' . $columns_gap;
}
if ($visibility) {
$grid_classes[] = $visibility;
}
if ($classes) {
$grid_classes[] = vcex_get_extra_class($classes);
}
$grid_classes = implode(' ', $grid_classes);
// Entry classes
$entry_classes = array('vcex-terms-grid-entry', 'clr');
if ('masonry' == $grid_style) {
$entry_classes[] = 'vcex-isotope-entry';
示例5: switch
// Link to nothing
$link = '#';
}
// CUSTOM LIGHTBOX GALLERY END - TOTAL SETTINGS
switch ($onclick) {
case 'img_link_large':
if ('external_link' === $source) {
$link = $custom_src;
} elseif (function_exists('wpex_get_lightbox_image')) {
$link = wpex_get_lightbox_image($img_id);
} else {
$link = wp_get_attachment_image_src($img_id, 'large');
$link = $link[0];
}
// Add class for Total theme
vcex_inline_js('ilightbox_single');
wpex_enqueue_ilightbox_skin();
$a_attrs['class'] = 'wpex-lightbox';
break;
case 'link_image':
wp_enqueue_script('prettyphoto');
wp_enqueue_style('prettyphoto');
$a_attrs['class'] = 'prettyphoto';
$a_attrs['rel'] = 'prettyPhoto[rel-' . get_the_ID() . '-' . rand() . ']';
// backward compatibility
if (vc_has_class('prettyphoto', $el_class)) {
// $link is already defined
} else {
if ('external_link' === $source) {
$link = $custom_src;
} else {
示例6: extract
* @version 3.0.0
*/
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
// Not needed in admin ever
if (is_admin()) {
return;
}
// Get and extract shortcode attributes
extract(vc_map_get_attributes($this->getShortcode(), $atts));
// Sanitize data
$number = isset($number) ? intval($number) : '45';
// Inline js
vcex_inline_js('milestone');
// Wrapper Classes
$wrap_classes = array('vcex-milestone', 'clr');
if ('true' == $animated || 'yes' == $animated) {
$wrap_classes[] = 'vcex-animated-milestone';
}
if ($classes) {
$wrap_classes[] = vcex_get_extra_class($classes);
}
if ($visibility) {
$wrap_classes[] = $visibility;
}
if ($css_animation) {
$wrap_classes[] = $this->getCSSAnimation($css_animation);
}
if ($hover_animation) {
示例7: wpex_get_social_button_class
}
if ($hover_color) {
$attributes .= ' data-hover-color="' . $hover_color . '"';
}
// Link Classes
if ($style) {
$a_classes = wpex_get_social_button_class($style);
} else {
$a_classes = 'vcex-social-link';
}
if ($width || $height) {
$a_classes .= ' no-padding';
}
if ($hover_bg || $hover_color) {
$a_classes .= ' wpex-data-hover';
vcex_inline_js(array('data_hover'));
}
if ($hover_animation) {
$a_classes .= ' ' . wpex_hover_animation_class($hover_animation);
vcex_enque_style('hover-animations');
}
if ($css) {
$a_classes .= ' ' . vc_shortcode_custom_css_class($css);
}
?>
<div class="<?php
echo $wrap_classes;
?>
"<?php
echo $wrap_style;
示例8: vc_map_get_attributes
<?php
/*** IMPORTANT: Do not edit this file, bad things will happen! ***/
// Declare vars
$el_class = $full_height = $full_width = $equal_height = $flex_row = $columns_placement = $content_placement = $parallax = $parallax_image = $css = $el_id = $video_bg = $video_bg_url = $video_bg_parallax = '';
$output = $after_output = '';
// Get vc attributes
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
// TOTAL => Parse attributes (used for Total theme fallbacks and deprecated params)
$atts = vcex_parse_row_atts($atts);
// Extract shortcode atts
extract($atts);
// Load VC js
wp_enqueue_script('wpb_composer_front_js');
// TOTAL => Inline js
vcex_inline_js('row_equal_columns');
// TOTAL => START Wrap classes
$total_wrap_classes = array('wpex-vc-row-wrap', 'clr');
if (!empty($max_width)) {
$total_wrap_classes[] = 'max-width-' . $max_width;
}
if (!empty($match_column_height) && 'yes' == $match_column_height) {
$total_wrap_classes[] = 'wpex-vc-row-columns-match-height';
} else {
// Used in front-end editor to reset equal heights
if (vc_is_inline()) {
$total_wrap_classes[] = 'wpex-vc-row-reset-columns-match-height';
}
}
if (!empty($full_width)) {
$total_wrap_classes[] = 'wpex-vc-row-' . $full_width;
示例9: vcex_inline_js
<?php
/**
* Title Push Up Overlay
*
* @package Total WordPress Theme
* @subpackage Partials
* @version 3.3.0
*/
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
// Only used for inside position
if ('inside_link' != $position) {
return;
}
// Add javascript for the VC
vcex_inline_js('overlay_popup_title');
?>
<div class="overlay-title-push-up theme-overlay">
<span class="title"><?php
the_title();
?>
</span>
</div>
示例10: extract
// Define non-vc attributes
$atts['post_type'] = 'testimonials';
$atts['taxonomy'] = 'testimonials_category';
$atts['tax_query'] = '';
// Extract shortcode atts
extract(vc_map_get_attributes($this->getShortcode(), $atts));
// Posts per page
$posts_per_page = $count;
// Build the WordPress query
$wpex_query = vcex_build_wp_query($atts);
// Output posts
if ($wpex_query->have_posts()) {
// Define and sanitize variables
$slideshow = vc_is_inline() ? 'false' : $slideshow;
// Load js
vcex_inline_js(array('slider_pro'));
// Add Style - OLD deprecated params.
$wrap_style = '';
if (!$css) {
$wrap_style = array();
if (isset($atts['background'])) {
$wrap_style['background_color'] = $atts['background'];
}
if (isset($atts['background_image'])) {
$wrap_style['background_image'] = wp_get_attachment_url($atts['background_image']);
}
if (isset($atts['padding_top'])) {
$wrap_style['padding_top'] = $atts['padding_top'];
}
if (isset($atts['padding_bottom'])) {
$wrap_style['padding_bottom'] = $atts['padding_bottom'];
示例11: extract
// Define vars
$atts['post_type'] = 'product';
$atts['taxonomy'] = 'product_cat';
$atts['tax_query'] = '';
// Extract attributes
extract($atts);
// Build the WordPress query
$wpex_query = vcex_build_wp_query($atts);
// Output posts
if ($wpex_query->have_posts()) {
// Disable auto play if there is only 1 post
if ('1' == count($wpex_query->posts)) {
$auto_play = false;
}
// Output js for front-end editor
vcex_inline_js('carousel');
// Load lightbox skin
if ('lightbox' == $thumbnail_link) {
vcex_enque_style('ilightbox');
}
// Prevent auto play in visual composer
if (wpex_is_front_end_composer()) {
$auto_play = 'false';
}
// Overlay Style
if (empty($overlay_style)) {
$overlay_style = 'none';
} else {
$overlay_style = $overlay_style;
}
// Item Margin
示例12: vc_map_get_attributes
$atts['include_categories'] = $atts['term_slug'];
}
// Get and extract shortcode attributes
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
// Define vars
$atts['post_type'] = 'post';
$atts['taxonomy'] = 'category';
$atts['tax_query'] = '';
// Extract attributes
extract($atts);
// Build the WordPress query
$wpex_query = vcex_build_wp_query($atts);
//Output posts
if ($wpex_query->have_posts()) {
// Inline JS for front-end composer
vcex_inline_js(array('carousel', 'ilightbox'));
// Sanitize & declare variables
$overlay_style = $overlay_style ? $overlay_style : 'none';
// IMPORTANT: Fallback required from VC update when params are defined as empty
// AKA - set things to enabled by default
$media = !$media ? 'true' : $media;
$title = !$title ? 'true' : $title;
$date = !$date ? 'true' : $date;
$excerpt = !$excerpt ? 'true' : $excerpt;
// Disable auto play if there is only 1 post
if ('1' == count($wpex_query->posts)) {
$auto_play = false;
}
// Prevent auto play in visual composer
if (vc_is_inline()) {
$auto_play = 'false';
示例13: vcex_inline_js
if ($wrap_style) {
$wrap_style = ' style="' . $wrap_style . '"';
}
// Media classes
$media_classes = 'vcex-teaser-media';
if ('three' == $style || 'four' == $style) {
$media_classes .= ' no-margin';
}
// Content classes
$content_classes = 'vcex-teaser-content clr';
if ('three' == $style || 'four' == $style) {
$content_classes .= ' wpex-padding-20';
}
// Match Height Inline JS
if (vc_is_inline() && false !== strpos($classes, 'equal-height-content')) {
vcex_inline_js('equal_height_content');
}
?>
<div class="<?php
echo $wrap_classes;
?>
"<?php
vcex_unique_id($unique_id);
echo $wrap_style;
?>
>
<?php
// Video
if ($video) {
示例14: wpex_image_hover_classes
if ($img_hover_style && 'true' != $equal_heights) {
$image_classes[] = wpex_image_hover_classes($img_hover_style);
}
// Image URL
if ($image_url || 'image' == $image_lightbox) {
// Standard URL
$link = vc_build_link($image_url);
$a_href = isset($link['url']) ? $link['url'] : '';
$a_title = isset($link['title']) ? $link['title'] : '';
$a_target = isset($link['target']) ? $link['target'] : '';
$a_target = in_array($a_target, array('blank', '_blank')) ? ' target="_blank' : '';
// Image lightbox
$data_attributes = '';
if ($image_lightbox) {
vcex_enque_style('ilightbox');
vcex_inline_js('ilightbox');
if ('image' == $image_lightbox) {
$image_classes[] = 'wpex-lightbox';
$data_attributes .= ' data-type="image"';
} elseif ('url' == $image_lightbox) {
$image_classes[] = ' wpex-lightbox';
$data_attributes .= ' data-type="iframe"';
$data_attributes .= ' data-options="width:1920,height:1080"';
} elseif ('auto-detect' == $image_lightbox) {
$image_classes[] = ' wpex-lightbox-autodetect';
} elseif ('video_embed' == $image_lightbox) {
$a_href = wpex_sanitize_data($a_href, 'embed_url');
$image_classes[] = ' wpex-lightbox';
$data_attributes .= ' data-type="iframe"';
$data_attributes .= ' data-options="width:1920,height:1080"';
} elseif ('html5' == $image_lightbox) {
示例15: extract
<?php
// Shortcode params
extract(shortcode_atts(array('title' => '', 'image' => '', 'link' => '', 'img_size' => 'full', 'img_link_large' => false, 'img_link' => '', 'img_link_target' => '_self', 'alignment' => '', 'el_class' => '', 'css_animation' => '', 'img_hover' => '', 'img_caption' => '', 'rounded_image' => '', 'img_filter' => '', 'style' => '', 'border_color' => '', 'css' => '', 'lightbox_video' => '', 'lightbox_custom_img' => '', 'lightbox_gallery' => '', 'lightbox_iframe_type' => '', 'lightbox_video_html5_webm' => '', 'lightbox_dimensions' => ''), $atts));
// Add lightbox script for front end
if (function_exists('vcex_inline_js')) {
vcex_inline_js(array('ilightbox'));
}
// Output var
$output = '';
// Link
if ($link) {
$img_link = esc_url($link);
}
// Border color
if ($border_color) {
$border_color = ' vc_box_border_' . $border_color;
}
// Data attributes
$data_attributes = '';
// Get the image ID
$img_id = preg_replace('/[^\\d]/', '', $image);
// Get image alt
if ($img_alt = get_post_meta($img_id, '_wp_attachment_image_alt', true)) {
$img_alt = 'alt="' . $img_alt . '"';
}
// The image string
$img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $style . $border_color));
// No Image so bail.
if ($img == NULL) {
$thumbnail = '<img src="' . get_template_directory_uri() . '/images/dummy-image.jpg" />';