作者:agipe
项目:wordpres
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => strtolower($smof_data['tagline_bg']), 'border' => '0px', 'bordercolor' => strtolower($smof_data['tagline_border_color']), 'button' => '', 'buttoncolor' => 'default', 'button_shape' => strtolower($smof_data['button_shape']), 'button_size' => strtolower($smof_data['button_size']), 'button_type' => strtolower($smof_data['button_type']), 'content_alignment' => 'left', 'description' => '', 'highlightposition' => 'left', 'link' => '', 'linktarget' => '_self', 'margin_bottom' => $smof_data['tagline_margin_bottom'], 'margin_top' => $smof_data['tagline_margin_top'], 'modal' => '', 'shadow' => 'no', 'shadowopacity' => '0.7', 'title' => '', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '', 'animation_offset' => Avada()->settings->get('animation_offset')), $args);
if ($defaults['modal']) {
$defaults['link'] = '#';
}
$defaults['button_type'] = strtolower($defaults['button_type']);
extract($defaults);
self::$args = $defaults;
$additional_content = '';
$styles = "<style type='text/css'>.reading-box-container-{$this->tagline_box_counter} .element-bottomshadow:before,.reading-box-container-{$this->tagline_box_counter} .element-bottomshadow:after{opacity:{$shadowopacity};}</style>";
if (isset($link) && $link && (isset($button) && $button) && self::$args['content_alignment'] != 'center') {
self::$args['button_class'] = ' fusion-desktop-button continue';
$additional_content = sprintf('<a %s><span>%s</span></a>', FusionCore_Plugin::attributes('tagline-shortcode-button'), $button);
}
if (isset($title) && $title) {
$additional_content .= sprintf('<h2>%s</h2>', $title);
}
if (isset($description) && $description) {
$additional_content .= sprintf('<div class="reading-box-description">%s</div>', $description);
}
$additional_content .= sprintf('<div class="reading-box-additional">%s</div>', do_shortcode($content));
if (isset($link) && $link && (isset($button) && $button)) {
self::$args['button_class'] = ' fusion-mobile-button';
$additional_content .= sprintf('<a %s><span>%s</span></a>', FusionCore_Plugin::attributes('tagline-shortcode-button'), $button);
}
$html = sprintf('%s<div %s><div %s>%s</div></div>', $styles, FusionCore_Plugin::attributes('tagline-shortcode'), FusionCore_Plugin::attributes('tagline-shortcode-reading-box'), $additional_content);
$this->tagline_box_counter++;
return $html;
}
作者:rvelez
项目:drpelaezgo.co
public function __construct()
{
$this->data = Avada()->settings->get_all();
add_action('add_meta_boxes', array($this, 'add_meta_boxes'));
add_action('save_post', array($this, 'save_meta_boxes'));
add_action('admin_enqueue_scripts', array($this, 'admin_script_loader'));
}
作者:universal-yout
项目:www.universal-youth.co
/**
* Render the shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
*
* @return string HTML output
*/
public function render($args, $content = '')
{
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'background_color' => Avada()->settings->get('countdown_background_color'), 'background_image' => Avada()->settings->get('countdown_background_image'), 'background_position' => Avada()->settings->get('countdown_background_position'), 'background_repeat' => Avada()->settings->get('countdown_background_repeat'), 'border_radius' => Avada()->settings->get('countdown_border_radius'), 'counter_box_color' => Avada()->settings->get('countdown_counter_box_color'), 'counter_text_color' => Avada()->settings->get('countdown_counter_text_color'), 'countdown_end' => '2000-01-01 00:00:00', 'dash_titles' => 'short', 'heading_text' => '', 'heading_text_color' => Avada()->settings->get('countdown_heading_text_color'), 'link_text' => '', 'link_text_color' => Avada()->settings->get('countdown_link_text_color'), 'link_target' => Avada()->settings->get('countdown_link_target'), 'link_url' => '', 'show_weeks' => Avada()->settings->get('countdown_show_weeks'), 'subheading_text' => '', 'subheading_text_color' => Avada()->settings->get('countdown_subheading_text_color')), $args);
extract($defaults);
self::$args = $defaults;
$html = sprintf('<div %s>', FusionCore_Plugin::attributes('countdown-shortcode'));
$html .= self::get_styles();
$html .= sprintf('<div %s>', FusionCore_Plugin::attributes('fusion-countdown-heading-wrapper'));
$html .= sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('fusion-countdown-subheading'), $subheading_text);
$html .= sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('fusion-countdown-heading'), $heading_text);
$html .= '</div>';
$html .= sprintf('<div %s>', FusionCore_Plugin::attributes('countdown-shortcode-counter-wrapper'));
$dashes = array(array('show' => $show_weeks, 'class' => 'weeks', 'shortname' => __('Weeks', 'fusion-core'), 'longname' => __('Weeks', 'fusion-core')), array('show' => 'yes', 'class' => 'days', 'shortname' => __('Days', 'fusion-core'), 'longname' => __('Days', 'fusion-core')), array('show' => 'yes', 'class' => 'hours', 'shortname' => __('Hrs', 'fusion-core'), 'longname' => __('Hours', 'fusion-core')), array('show' => 'yes', 'class' => 'minutes', 'shortname' => __('Min', 'fusion-core'), 'longname' => __('Minutes', 'fusion-core')), array('show' => 'yes', 'class' => 'seconds', 'shortname' => __('Sec', 'fusion-core'), 'longname' => __('Seconds', 'fusion-core')));
$dash_class = '';
if (!self::$args['counter_box_color'] || self::$args['counter_box_color'] == 'transparent') {
$dash_class = ' fusion-no-bg';
}
for ($i = 0; $i < count($dashes); $i++) {
if ($dashes[$i]['show'] == 'yes') {
$html .= sprintf('<div class="fusion-dash-wrapper %s"><div class="fusion-dash fusion-dash-%s">%s<div class="fusion-digit">0</div><div class="fusion-digit">0</div><div class="fusion-dash-title">%s</div></div></div>', $dash_class, $dashes[$i]['class'], $dashes[$i]['class'] == 'days' ? '<div class="fusion-first-digit fusion-digit">0</div>' : '', $dashes[$i][$dash_titles . 'name']);
}
}
$html .= '</div>';
$html .= sprintf('<div %s>', FusionCore_Plugin::attributes('fusion-countdown-link-wrapper'));
$html .= sprintf('<a %s>%s</a>', FusionCore_Plugin::attributes('countdown-shortcode-link'), $link_text);
$html .= '</div>';
$html .= do_shortcode($content);
$html .= '</div>';
$this->countdown_counter++;
return $html;
}
作者:rvelez
项目:drpelaezgo.co
/**
* Modify the query (using the 'pre_get_posts' filter)
*/
public function set_post_filters($query)
{
if ($query->is_main_query() && (is_tax('portfolio_category') || is_tax('portfolio_skills') || is_tax('portfolio_tags'))) {
$query->set('posts_per_page', Avada()->settings->get('portfolio_items'));
}
return $query;
}
作者:agipe
项目:wordpres
/**
* Render the shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render_parent($args, $content = '')
{
$defaults = shortcode_atts(array('class' => '', 'id' => '', 'animation_offset' => Avada()->settings->get('animation_offset')), $args);
extract($defaults);
self::$parent_args = $defaults;
$html = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('counters-circle-shortcode'), do_shortcode($content));
return $html;
}
作者:sdxlg
项目:net-wp_sdgcxl-htdoc
/**
* Render the shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render_parent($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => $smof_data['content_box_bg_color'], 'columns' => '', 'circle' => '', 'iconcolor' => $smof_data['content_box_icon_color'], 'circlecolor' => $smof_data['content_box_icon_bg_color'], 'circlebordercolor' => $smof_data['content_box_icon_bg_inner_border_color'], 'circlebordersize' => $smof_data['content_box_icon_bg_inner_border_size'], 'outercirclebordercolor' => $smof_data['content_box_icon_bg_outer_border_color'], 'outercirclebordersize' => $smof_data['content_box_icon_bg_outer_border_size'], 'icon_circle' => $smof_data['content_box_icon_circle'], 'icon_circle_radius' => $smof_data['content_box_icon_circle_radius'], 'icon_size' => $smof_data['content_box_icon_size'], 'icon_align' => '', 'icon_hover_type' => $smof_data['content_box_icon_hover_type'], 'hover_accent_color' => array_key_exists('content_box_hover_animation_accent_color', $smof_data) && !empty($smof_data['content_box_hover_animation_accent_color']) ? $smof_data['content_box_hover_animation_accent_color'] : $smof_data['primary_color'], 'layout' => 'icon-with-title', 'margin_top' => $smof_data['content_box_margin_top'], 'margin_bottom' => $smof_data['content_box_margin_bottom'], 'title_size' => $smof_data['content_box_title_size'], 'title_color' => $smof_data['content_box_title_color'], 'body_color' => $smof_data['content_box_body_color'], 'link_type' => $smof_data['content_box_link_type'], 'link_area' => $smof_data['content_box_link_area'], 'link_target' => $smof_data['content_box_link_target'], 'animation_type' => '', 'animation_delay' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1', 'animation_offset' => Avada()->settings->get('animation_offset'), 'settings_lvl' => 'child', 'linktarget' => ''), $args);
if ($defaults['linktarget']) {
$defaults['link_target'] = $defaults['linktarget'];
}
if ($defaults['layout'] == 'timeline-vertical') {
$defaults['columns'] = 1;
}
if ($defaults['layout'] == 'timeline-vertical' || $defaults['layout'] == 'timeline-horizontal') {
// See #1362
$defaults['animation_delay'] = 350;
$defaults['animation_speed'] = 0.25;
$defaults['animation_type'] = 'fade';
$defaults['animation_direction'] = '';
}
extract($defaults);
self::$parent_args = $defaults;
$this->column_counter = 1;
$this->row_counter = 1;
preg_match_all('/(\\[content_box (.*?)\\](.*?)\\[\\/content_box\\])/s', $content, $matches);
$this->total_num_of_columns = count($matches[0]);
if (!$columns || empty($columns)) {
if (is_array($matches) && !empty($matches)) {
$this->num_of_columns = count($matches[0]);
if ($this->num_of_columns > 6) {
$this->num_of_columns = 6;
}
} else {
$this->num_of_columns = 1;
}
} elseif ($columns > 6) {
$this->num_of_columns = 6;
} else {
$this->num_of_columns = $columns;
}
$styles = '<style type="text/css" scoped="scoped">';
if ($title_color) {
$styles .= ".fusion-content-boxes-{$this->content_box_counter} .heading h2{color:{$title_color};}";
}
$styles .= "\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover .heading h2,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover .heading .heading-link h2,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover .heading h2,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover .heading .heading-link h2,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover.link-area-box .fusion-read-more,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover.link-area-box .fusion-read-more::after,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover.link-area-box .fusion-read-more::before,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .fusion-read-more:hover:after,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .fusion-read-more:hover:before,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .fusion-read-more:hover,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover.link-area-box .fusion-read-more,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover.link-area-box .fusion-read-more::after,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover.link-area-box .fusion-read-more::before,\t\t\t\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover .icon .circle-no,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover .icon .circle-no {\n\t\t\t\tcolor: {$hover_accent_color} !important;\n\t\t\t}";
$circle_hover_accent_color = $hover_accent_color;
if ($circlecolor == 'transparent') {
$circle_hover_accent_color = 'transparent';
}
$styles .= "\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .heading-link:hover .icon i.circle-yes,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box:hover .heading-link .icon i.circle-yes,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover .heading .icon i.circle-yes,\n\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover .heading .icon i.circle-yes {\n\t\t\t\tbackground-color: {$circle_hover_accent_color} !important;\n\t\t\t\tborder-color: {$hover_accent_color} !important;\n\t\t\t}";
if ($icon_hover_type == 'pulsate' && $hover_accent_color) {
$styles .= "\n\t\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover.icon-hover-animation-pulsate .fontawesome-icon:after,\n\t\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover.icon-hover-animation-pulsate .fontawesome-icon:after,\n\t\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-link-icon-hover.icon-wrapper-hover-animation-pulsate .icon span:after,\n\t\t\t\t.fusion-content-boxes-{$this->content_box_counter} .fusion-content-box-hover .link-area-box-hover.icon-wrapper-hover-animation-pulsate .icon span:after {\n\t\t\t\t\t-webkit-box-shadow:0 0 0 2px rgba(255,255,255,0.1), 0 0 10px 10px {$hover_accent_color}, 0 0 0 10px rgba(255,255,255,0.5);\n\t\t\t\t\t-moz-box-shadow:0 0 0 2px rgba(255,255,255,0.1), 0 0 10px 10px {$hover_accent_color}, 0 0 0 10px rgba(255,255,255,0.5);\n\t\t\t\t\tbox-shadow: 0 0 0 2px rgba(255,255,255,0.1), 0 0 10px 10px {$hover_accent_color}, 0 0 0 10px rgba(255,255,255,0.5);\n\t\t\t\t}\n\t\t\t";
}
$styles .= '</style>';
$html = sprintf('<div %s>%s%s<div class="fusion-clearfix"></div></div>', FusionCore_Plugin::attributes('content-boxes-shortcode'), $styles, do_shortcode($content));
$this->content_box_counter++;
return $html;
}
作者:agipe
项目:wordpres
/**
* Render the shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render_parent($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'animation_offset' => Avada()->settings->get('animation_offset'), 'body_color' => strtolower($smof_data['counter_box_body_color']), 'body_size' => strtolower($smof_data['counter_box_body_size']), 'border_color' => strtolower($smof_data['counter_box_border_color']), 'color' => strtolower($smof_data['counter_box_color']), 'columns' => '', 'icon_size' => strtolower($smof_data['counter_box_icon_size']), 'icon_top' => strtolower($smof_data['counter_box_icon_top']), 'title_size' => strtolower($smof_data['counter_box_title_size'])), $args);
extract($defaults);
self::$parent_args = $defaults;
if (self::$parent_args['columns'] > 6) {
self::$parent_args['columns'] = 6;
}
$this->set_num_of_columns($content);
$html = sprintf('<div %s>%s</div><div class="clearfix"></div>', FusionCore_Plugin::attributes('counters-box-shortcode'), do_shortcode($content));
return $html;
}
作者:universal-yout
项目:www.universal-youth.co
/**
* Avada extra OpenGraph tags
* These are added to the <head> of the page using the 'wp_head' action.
*/
public function insert_og_meta()
{
global $post;
$settings = Avada::settings();
// Early exit if we don't need to continue any further
if ($settings['status_opengraph']) {
return;
}
// Early exit if this is not a singular post/page/cpt
if (!is_singular()) {
return;
}
$image = '';
if (!has_post_thumbnail($post->ID)) {
if ($settings['logo']) {
$image = $settings['logo'];
}
} else {
$thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
$image = esc_attr($thumbnail_src[0]);
}
?>
<meta property="og:title" content="<?php
echo strip_tags(str_replace(array('"', "'"), array('"', '''), $post->post_title));
?>
"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="<?php
echo get_permalink();
?>
"/>
<meta property="og:site_name" content="<?php
echo get_bloginfo('name');
?>
"/>
<meta property="og:description" content="<?php
echo Avada()->blog->get_content_stripped_and_excerpted(55, $post->post_content);
?>
"/>
<?php
if ('' != $image) {
?>
<meta property="og:image" content="<?php
echo $image;
?>
"/>
<?php
}
}
作者:pedrom4
项目:sazoo.or
/**
* Register our sidebars
*/
public function widgets_init()
{
register_sidebar(array('name' => 'Blog Sidebar', 'id' => 'avada-blog-sidebar', 'description' => __('Default Sidebar of Avada', 'Avada'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="heading"><h4 class="widget-title">', 'after_title' => '</h4></div>'));
$columns = Avada()->settings->get('footer_widgets_columns') + 1;
// Register he footer widgets
for ($i = 1; $i < $columns; $i++) {
register_sidebar(array('name' => sprintf('Footer Widget %s', $i), 'id' => 'avada-footer-widget-' . $i, 'before_widget' => '<div id="%1$s" class="fusion-footer-widget-column widget %2$s">', 'after_widget' => '<div style="clear:both;"></div></div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
}
$columns = (int) Avada()->settings->get('slidingbar_widgets_columns') + 1;
// Register the slidingbar widgets
for ($i = 1; $i < $columns; $i++) {
register_sidebar(array('name' => sprintf('Slidingbar Widget %s', $i), 'id' => 'avada-slidingbar-widget-' . $i, 'before_widget' => '<div id="%1$s" class="fusion-slidingbar-widget-column widget %2$s">', 'after_widget' => '<div style="clear:both;"></div></div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
}
}
作者:universal-yout
项目:www.universal-youth.co
public function generate()
{
$post_types = array('post', 'page', 'avada_portfolio');
if (!class_exists('kdMultipleFeaturedImages')) {
return;
}
$i = 2;
while ($i <= Avada()->settings->get('posts_slideshow_number')) {
foreach ($post_types as $post_type) {
new kdMultipleFeaturedImages(array('id' => 'featured-image-' . $i, 'post_type' => $post_type, 'labels' => array('name' => sprintf(__('Featured image %s', 'Avada'), $i), 'set' => sprintf(__('Set featured image %s', 'Avada'), $i), 'remove' => sprintf(__('Remove featured image %s', 'Avada'), $i), 'use' => sprintf(__('Use as featured image %s', 'Avada'), $i))));
}
$i++;
}
}
作者:pedrom4
项目:sazoo.or
/**
* Set portfolio width and assign a class to the content div
*/
public function set_portfolio_single_width($classes)
{
if (is_singular('avada_portfolio')) {
if (fusion_get_option('portfolio_featured_image_width', 'width', Avada::c_pageID()) == 'half') {
$portfolio_width = 'half';
} else {
$portfolio_width = 'full';
}
if (!Avada()->settings->get('portfolio_featured_images') && $portfolio_width == 'half') {
$portfolio_width = 'full';
}
$classes[] = 'portfolio-' . $portfolio_width;
}
return $classes;
}
作者:agipe
项目:wordpres
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'accent_color' => '', 'background_color' => '', 'border_size' => '', 'box_shadow' => 'no', 'icon' => '', 'type' => 'general', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '', 'animation_offset' => Avada()->settings->get('animation_offset')), $args);
extract($defaults);
self::$args = $defaults;
switch ($args['type']) {
case 'general':
$this->alert_class = 'info';
if (!$icon || $icon != 'none') {
self::$args['icon'] = $icon = 'fa-info-circle';
}
break;
case 'error':
$this->alert_class = 'danger';
if (!$icon || $icon != 'none') {
self::$args['icon'] = $icon = 'fa-exclamation-triangle';
}
break;
case 'success':
$this->alert_class = 'success';
if (!$icon || $icon != 'none') {
self::$args['icon'] = $icon = 'fa-check-circle';
}
break;
case 'notice':
$this->alert_class = 'warning';
if (!$icon || $icon != 'none') {
self::$args['icon'] = $icon = 'fa-lg fa-cog';
}
break;
case 'blank':
$this->alert_class = 'blank';
break;
case 'custom':
$this->alert_class = 'custom';
break;
}
$html = sprintf('<div %s>', FusionCore_Plugin::attributes('alert-shortcode')) . "\n";
$html .= sprintf(' <button %s>×</button>', FusionCore_Plugin::attributes('alert-shortcode-button')) . "\n";
if ($icon && $icon != 'none') {
$html .= sprintf('<span %s><i %s></i></span>', FusionCore_Plugin::attributes('alert-icon'), FusionCore_Plugin::attributes('alert-shortcode-icon'));
}
$html .= do_shortcode($content);
$html .= '</div>' . "\n";
return $html;
}
作者:agipe
项目:wordpres
/**
* Render the shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'alignment' => '', 'circle' => 'yes', 'circlecolor' => '', 'circlebordercolor' => '', 'flip' => '', 'icon' => '', 'iconcolor' => '', 'rotate' => '', 'size' => 'medium', 'spin' => 'no', 'animation_type' => '', 'animation_direction' => 'down', 'animation_speed' => '0.1', 'animation_offset' => Avada()->settings->get('animation_offset')), $args);
extract($defaults);
// Dertmine line-height and margin from font size
$defaults['font_size'] = FusionCore_Plugin::strip_unit(self::convert_deprecated_sizes($defaults['size']));
$defaults['circle_yes_font_size'] = $defaults['font_size'] * 0.88;
$defaults['line_height'] = $defaults['font_size'] * 1.76;
$defaults['icon_margin'] = $defaults['font_size'] * 0.5;
$defaults['icon_margin_position'] = is_rtl() ? 'left' : 'right';
self::$args = $defaults;
$html = sprintf('<i %s>%s</i>', FusionCore_Plugin::attributes('fontawesome-shortcode'), do_shortcode($content));
if ($alignment) {
$html = sprintf('<div class="align%s">%s</div>', $alignment, $html);
}
return $html;
}
作者:pedrom4
项目:sazoo.or
/**
* Get a flat array of our fields.
* This will contain simply the field IDs and nothing more than that.
* We'll be using this to check if a setting belongs to Avada or not.
*
* @return array
*/
public function fields_array()
{
/**
* Get the options object
*/
$avada_new_options = Avada()->options;
$fields = array();
/**
* start parsing sections
*/
foreach ($avada_new_options->sections as $section) {
/**
* Make sure we have defined fields for this section.
* No need to proceed otherwise
*/
if (isset($section['fields'])) {
/**
* start parsing the fields inside the section
*/
foreach ($section['fields'] as $field) {
/**
* Make sure a field-type has been defined
*/
if (isset($field['type'])) {
/**
* For normal fields, we'll just add the field ID to our array.
*/
if (!in_array($field['type'], array('sub-section', 'accordion'))) {
if (isset($field['id'])) {
$fields[] = $field['id'];
}
} else {
if (isset($field['fields'])) {
foreach ($field['fields'] as $sub_field) {
if (isset($sub_field['id'])) {
$fields[] = $sub_field['id'];
}
}
}
}
}
}
}
}
return $fields;
}
作者:Aldebaran1
项目:avad
/**
* Class Constructor
*/
public function __construct()
{
// Initialize object variables
$this->post = isset($GLOBALS['post']) ? $GLOBALS['post'] : null;
$this->options = Avada()->settings->get_all();
// Setup default array for changeable variables
$defaults = array('home_prefix' => $this->options['breacrumb_prefix'], 'separator' => $this->options['breadcrumb_separator'], 'show_post_type_archive' => $this->options['breadcrumb_show_post_type_archive'], 'show_terms' => $this->options['breadcrumb_show_categories'], 'home_label' => __('Home', 'Avada'), 'tag_archive_prefix' => __('Tag:', 'Avada'), 'search_prefix' => __('Search:', 'Avada'), 'error_prefix' => __('404 - Page not Found', 'Avada'));
// Setup a filter for changeable variables and meger it with the defaults
$args = apply_filters('fusion_breadcrumbs_defaults', $defaults);
$defaults = wp_parse_args($args, $defaults);
$this->home_prefix = $defaults['home_prefix'];
$this->separator = $defaults['separator'];
$this->show_post_type_archive = $defaults['show_post_type_archive'];
$this->show_terms = $defaults['show_terms'];
$this->home_label = $defaults['home_label'];
$this->tag_archive_prefix = $defaults['tag_archive_prefix'];
$this->search_prefix = $defaults['search_prefix'];
$this->error_prefix = $defaults['error_prefix'];
}
作者:sdxlg
项目:net-wp_sdgcxl-htdoc
/**
* Require the installation of any required and/or recommended third-party plugins here.
* See http://tgmpluginactivation.com/ for more details
*/
function avada_register_required_plugins()
{
/**
* Array of plugin arrays. Required keys are name and slug.
* If the source is NOT from the .org repo, then source is also required.
*/
$plugins = array(array('name' => 'Fusion Core', 'slug' => 'fusion-core', 'source' => get_template_directory() . '/framework/plugins/fusion-core.zip', 'required' => true, 'version' => '1.8.3', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', 'image_url' => Avada()->get_framework_dir() . '/assets/images/fusion_core.png'), array('name' => 'LayerSlider WP', 'slug' => 'LayerSlider', 'source' => get_template_directory() . '/framework/plugins/LayerSlider.zip', 'required' => false, 'version' => '5.6.2', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', 'image_url' => Avada()->get_framework_dir() . '/assets/images/layer_slider.png'), array('name' => 'Revolution Slider', 'slug' => 'revslider', 'source' => get_template_directory() . '/framework/plugins/revslider.zip', 'required' => false, 'version' => '5.1.6', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => '', 'image_url' => Avada()->get_framework_dir() . '/assets/images/rev_slider.png'), array('name' => 'WooCommerce', 'slug' => 'woocommerce', 'required' => false, 'image_url' => Avada()->get_framework_dir() . '/assets/images/woocommerce.png'), array('name' => 'bbPress', 'slug' => 'bbpress', 'required' => false, 'image_url' => Avada()->get_framework_dir() . '/assets/images/bbpress.png'), array('name' => 'The Events Calendar', 'slug' => 'the-events-calendar', 'required' => false, 'image_url' => Avada()->get_framework_dir() . '/assets/images/the_events_calendar.png'), array('name' => 'Contact Form 7', 'slug' => 'contact-form-7', 'required' => false, 'image_url' => Avada()->get_framework_dir() . '/assets/images/contact_form_7.jpg'));
// Change this to your theme text domain, used for internationalising strings
$theme_text_domain = 'Avada';
/**
* Array of configuration settings. Amend each line as needed.
* If you want the default strings to be available under your own theme domain,
* leave the strings uncommented.
* Some of the strings are added into a sprintf, so see the comments at the
* end of each line for what each argument will be.
*/
$config = array('domain' => $theme_text_domain, 'default_path' => '', 'parent_slug' => 'themes.php', 'menu' => 'install-required-plugins', 'has_notices' => true, 'is_automatic' => true, 'message' => '', 'strings' => array('page_title' => __('Install Required Plugins', 'Avada'), 'menu_title' => __('Install Plugins', 'Avada'), 'installing' => __('Installing Plugin: %s', 'Avada'), 'oops' => __('Something went wrong with the plugin API.', 'Avada'), 'notice_can_install_required' => _n_noop('This theme requires the following plugin installed or updated: %1$s.', 'This theme requires the following plugins installed or updated: %1$s.', 'Avada'), 'notice_can_install_recommended' => _n_noop(str_replace('{{system-status}}', admin_url('admin.php?page=avada-system-status'), 'This theme recommends the following plugin installed or updated: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal "out of memory" errors. We recommend at least 128MB of memory. Check your resources on the <a href="{{system-status}}" target="_self">System Status</a> tab.'), str_replace('{{system-status}}', admin_url('admin.php?page=avada-system-status'), 'This theme recommends the following plugins installed or updated: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal "out of memory" errors. We recommend at least 128MB of memory. Check your resources on the <a href="{{system-status}}" target="_self">System Status</a> tab.'), 'Avada'), 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'Avada'), 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'Avada'), 'notice_can_activate_recommended' => _n_noop(str_replace('{{system-status}}', admin_url('admin.php?page=avada-system-status'), 'The following recommended plugin is currently inactive: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal "out of memory" errors. We recommend at least 128MB of memory. Check your resources on the <a href="{{system-status}}" target="_self">System Status</a> tab.'), str_replace('{{system-status}}', admin_url('admin.php?page=avada-system-status'), 'The following recommended plugins are currently inactive: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal "out of memory" errors. We recommend at least 128MB of memory. Check your resources on the <a href="{{system-status}}" target="_self">System Status</a> tab.'), 'Avada'), 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'Avada'), 'notice_ask_to_update' => _n_noop('<span class="fusion-update-heading" style="margin-top:-0.4em">%1$s Update Required</span>The plugin needs to be updated to its latest version to ensure maximum compatibility with Avada.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'Avada'), 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'Avada'), 'install_link' => _n_noop('Go Install Plugin', 'Go Install Plugins', 'Avada'), 'activate_link' => _n_noop('Go Activate Plugin', 'Go Activate Plugins', 'Avada'), 'return' => __('Return to Required Plugins Installer', 'Avada'), 'plugin_activated' => __('Plugin activated successfully.', 'Avada'), 'complete' => __('All plugins installed and activated successfully. %s', 'Avada'), 'nag_type' => 'error'));
tgmpa($plugins, $config);
}
作者:agipe
项目:wordpres
/**
* Render the child shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render_child($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'background_color_front' => $smof_data['flip_boxes_front_bg'], 'background_color_back' => $smof_data['flip_boxes_back_bg'], 'border_color' => $smof_data['flip_boxes_border_color'], 'border_radius' => $smof_data['flip_boxes_border_radius'], 'border_size' => $smof_data['flip_boxes_border_size'], 'circle' => '', 'circle_color' => $smof_data['icon_circle_color'], 'circle_border_color' => $smof_data['icon_border_color'], 'icon' => '', 'icon_color' => $smof_data['icon_color'], 'icon_flip' => '', 'icon_rotate' => '', 'icon_spin' => '', 'image' => '', 'image_width' => '35', 'image_height' => '35', 'text_back_color' => $smof_data['flip_boxes_back_text'], 'text_front' => '', 'text_front_color' => $smof_data['flip_boxes_front_text'], 'title_front' => '', 'title_front_color' => $smof_data['flip_boxes_front_heading'], 'title_back' => '', 'title_back_color' => $smof_data['flip_boxes_back_heading'], 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1', 'animation_offset' => Avada()->settings->get('animation_offset')), $args);
if ($defaults['border_radius'] == 'round') {
$defaults['border_radius'] = '50%';
}
extract($defaults);
self::$child_args = $defaults;
$style = $icon_output = $title_output = $title_front_output = $title_back_output = $alt = '';
if ($image && $image_width && $image_height) {
$image_id = FusionCore_Plugin::get_attachment_id_from_url($image);
if ($image_id) {
$alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
}
$icon_output = sprintf('<img src="%s" width="%s" height="%s" alt="%s" />', $image, $image_width, $image_height, $alt);
} else {
if ($icon) {
$icon_output = sprintf('<i %s></i>', FusionCore_Plugin::attributes('flip-box-shortcode-icon'));
}
}
if ($icon_output) {
$icon_output = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-shortcode-grafix'), $icon_output);
} else {
$icon_output = '';
}
if ($title_front) {
$title_front_output = sprintf('<h2 %s>%s</h2>', FusionCore_Plugin::attributes('flip-box-shortcode-heading-front'), $title_front);
}
if ($title_back) {
$title_back_output = sprintf('<h3 %s>%s</h3>', FusionCore_Plugin::attributes('flip-box-shortcode-heading-back'), $title_back);
}
$front_inner = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-front-inner'), $icon_output . $title_front_output . $text_front);
$back_inner = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-back-inner'), $title_back_output . do_shortcode($content));
$front = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-shortcode-front-box'), $front_inner);
$back = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-shortcode-back-box'), $back_inner);
$html = sprintf('<div %s><div class="fusion-flip-box"><div %s>%s%s</div></div></div>', FusionCore_Plugin::attributes('flip-box-shortcode'), FusionCore_Plugin::attributes('flip-box-inner-wrapper'), $front, $back);
$this->flipbox_counter++;
return $html;
}
作者:agipe
项目:wordpres
/**
* Migrate script to decode theme options
*/
public function migrate()
{
if (get_option('avada_38_migrate') != 'done') {
$theme_version = get_option('avada_theme_version');
if ($theme_version == '1.0.0') {
// child theme check failure
Avada()->init->set_theme_version();
}
if (version_compare($theme_version, '3.8', '>=') && version_compare($theme_version, '3.8.5', '<')) {
$smof_data_to_decode = get_option('Avada_options');
$encoded_field_names = array('google_analytics', 'space_head', 'space_body', 'custom_css');
foreach ($encoded_field_names as $field_name) {
$decoded_field_value = rawurldecode($smof_data_to_decode[$field_name]);
if ($decoded_field_value) {
$smof_data_to_decode[$field_name] = $decoded_field_value;
}
}
update_option('Avada_options', $smof_data_to_decode);
update_option('avada_38_migrate', 'done');
}
}
}
作者:agipe
项目:wordpres
/**
* Render the shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @param string $tag The actual shortcode tag, e.g. one_half.
* @return string HTML output
*/
function render($args, $content = '', $tag)
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'background_color' => '', 'background_image' => '', 'background_position' => 'left top', 'background_repeat' => 'no-repeat', 'border_color' => '', 'border_position' => 'all', 'border_size' => '', 'border_style' => 'solid', 'center_content' => 'no', 'hide_on_mobile' => 'no', 'last' => 'no', 'margin_top' => $smof_data['col_top_margin'], 'margin_bottom' => $smof_data['col_bottom_margin'], 'padding' => '', 'spacing' => 'yes', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1', 'animation_offset' => Avada()->settings->get('animation_offset'), 'link' => '', 'hover_type' => 'none'), $args);
$defaults['tag'] = $tag;
extract($defaults);
if ($defaults['margin_top'] == '') {
$defaults['margin_top'] = $smof_data['col_top_margin'];
}
if ($defaults['margin_bottom'] == '') {
$defaults['margin_bottom'] = $smof_data['col_bottom_margin'];
}
// After the last column we need a clearing div
$clearfix = '';
if ($last == 'yes') {
$clearfix = sprintf('<div %s></div>', FusionCore_Plugin::attributes('fusion-clearfix'));
}
$inner_content = do_shortcode($content);
$inner_content .= '<div class="fusion-clearfix"></div>';
// If content should be centered, add needed markup
if ($center_content == 'yes') {
$inner_content = sprintf('<div class="fusion-column-table"><div class="fusion-column-tablecell">%s</div></div>', $inner_content);
}
// Link + Hover Background
$inner_bg = '';
if ($link || $hover_type && $hover_type != 'none') {
$bg_link = '';
if ($link) {
$bg_link = 'href="' . $link . '"';
}
$inner_bg = sprintf('<span class="fusion-column-inner-bg hover-type-%s"><a %s><span %s></span></a></span>', $hover_type, $bg_link, FusionCore_Plugin::attributes('columns-shortcode-inner-bg', $defaults));
}
// Setup the main markup
$html = sprintf('<div %s><div %s>%s</div>%s</div>%s', FusionCore_Plugin::attributes('columns-shortcode', $defaults), FusionCore_Plugin::attributes('columns-shortcode-wrapper', $defaults), $inner_content, $inner_bg, $clearfix);
return $html;
}
作者:rvelez
项目:drpelaezgo.co
/**
* Clear varnish cache for the dynamic CSS file
*
* @param $url the URL of the file whose cache we want to reset
* @return void
*/
public function clear_varnish_cache($url)
{
/**
* Parse the URL for proxy proxies
*/
$p = parse_url($url);
if (isset($p['query']) && 'vhp=regex' == $p['query']) {
$pregex = '.*';
$varnish_x_purgemethod = 'regex';
} else {
$pregex = '';
$varnish_x_purgemethod = 'default';
}
/**
* Build a varniship
*/
if (Avada()->settings->get('cache_server_ip')) {
$varniship = Avada()->settings->get('cache_server_ip');
} else {
if (defined('VHP_VARNISH_IP') && VHP_VARNISH_IP != false) {
$varniship = VHP_VARNISH_IP;
} else {
$varniship = get_option('vhp_varnish_ip');
}
}
$path = isset($p['path']) ? $p['path'] : '';
/**
* If we made varniship, let it sail.
*/
$purgeme = isset($varniship) && $varniship != null ? $varniship : $p['host'];
wp_remote_request('http://' . $purgeme, array('method' => 'PURGE', 'headers' => array('host' => $p['host'], 'X-Purge-Method' => $varnish_x_purgemethod)));
}