当前位置: 首页>>代码示例>>PHP>>正文


PHP Avada函数代码示例

本文整理汇总了PHP中Avada函数的典型用法代码示例。如果您正苦于以下问题:PHP Avada函数的具体用法?PHP Avada怎么用?PHP Avada使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Avada函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 /**
  * 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;
 }
开发者ID:agiper,项目名称:wordpress,代码行数:37,代码来源:class-tagline.php

示例2: __construct

 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'));
 }
开发者ID:rvelezc,项目名称:drpelaezgo.com,代码行数:7,代码来源:metaboxes.php

示例3: render

 /**
  * 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;
 }
开发者ID:universal-youth,项目名称:www.universal-youth.com,代码行数:39,代码来源:class-countdown.php

示例4: set_post_filters

 /**
  * 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;
 }
开发者ID:rvelezc,项目名称:drpelaezgo.com,代码行数:10,代码来源:class-avada-portfolio.php

示例5: render_parent

 /**
  * 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;
 }
开发者ID:agiper,项目名称:wordpress,代码行数:15,代码来源:class-counters-circle.php

示例6: render_parent

 /**
  * 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;
 }
开发者ID:sdxlgc,项目名称:net-wp_sdgcxl-htdocs,代码行数:62,代码来源:class-content-boxes.php

示例7: render_parent

 /**
  * 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;
 }
开发者ID:agiper,项目名称:wordpress,代码行数:20,代码来源:class-counters-box.php

示例8: insert_og_meta

    /**
     * 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('&quot;', '&#39;'), $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 
        }
    }
开发者ID:universal-youth,项目名称:www.universal-youth.com,代码行数:55,代码来源:class-avada-head.php

示例9: widgets_init

 /**
  * 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>'));
     }
 }
开发者ID:pedrom40,项目名称:sazoo.org,代码行数:17,代码来源:class-avada-sidebars.php

示例10: generate

 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++;
     }
 }
开发者ID:universal-youth,项目名称:www.universal-youth.com,代码行数:14,代码来源:class-avada-multiple-featured-images.php

示例11: set_portfolio_single_width

 /**
  * 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;
 }
开发者ID:pedrom40,项目名称:sazoo.org,代码行数:18,代码来源:class-avada-portfolio.php

示例12: render

 /**
  * 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>&times;</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;
 }
开发者ID:agiper,项目名称:wordpress,代码行数:52,代码来源:class-alert.php

示例13: render

 /**
  * 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;
 }
开发者ID:agiper,项目名称:wordpress,代码行数:24,代码来源:class-fontawesome.php

示例14: fields_array

 /**
  * 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;
 }
开发者ID:pedrom40,项目名称:sazoo.org,代码行数:53,代码来源:class-avada-options.php

示例15: __construct

 /**
  * 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'];
 }
开发者ID:Aldebaran10,项目名称:avada,代码行数:22,代码来源:class-fusion-breadcrumbs.php


注:本文中的Avada函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。