'100%', 'background' => '#222222', 'img' => '', 'text' => '', 'height' => 'auto', 'align' => 'center', 'size' => '1', 'parallax' => '', 'direction' => '', 'quote' => __( 'People are made of stories, not atoms.', 'aesop-core' ), 'cite' => '', 'type' => 'block', 'revealfx' => '' ); $atts = apply_filters( 'aesop_quote_defaults', shortcode_atts( $defaults, $atts ) ); // let this be used multiple times static $instance = 0; $instance++; $unique = sprintf( '%s-%s', get_the_ID(), $instance ); // set component to content width $contentwidth = 'content' == $atts['width'] ? 'aesop-content' : false; // set size $size_unit = apply_filters( 'aesop_quote_size_unit', 'em', $unique ); $size = $atts['size'] ? sprintf( '%s%s', $atts['size'], $size_unit ) : false; // bg img $bgimg = $atts['img'] ? sprintf( 'background-image:url(%s);background-size:cover;background-position:center center;', esc_url( $atts['img'] ) ) : false; // bg color only if not block style $bgcolor = 'block' == $atts['type'] ? sprintf( 'background-color:%s;', $atts['background'] ) : false; if ('block' == $atts['type'] ) { if ($atts['text'] == '') { $atts['text'] = '#FFFFFF'; } $fgcolor = sprintf( 'color:%s;', esc_attr($atts['text']) ); } else { // for non-block quote color is ignored unless it has been changed from the default value if ($atts['text'] == '' || !strcasecmp(esc_attr($atts['text']),'#ffffff')) { $fgcolor = null; } else { $fgcolor = sprintf( 'color:%s;', esc_attr($atts['text']) ); } } // set styles // hide the component initially if revealfx is set $visibility = aesop_revealfx_set($atts) ? 'visibility:hidden;': false; $style = $bgcolor || $fgcolor || $atts['height'] || $atts['width'] || $visibility? sprintf( 'style="%s%s%sheight:%s;width:%s;%s"', esc_attr( $bgcolor ), $bgimg, $fgcolor, esc_attr( $atts['height'] ), esc_attr( $atts['width'] ), $visibility ) : false; $isparallax = 'on' == $atts['parallax'] ? 'quote-is-parallax' : false; $lrclass = 'left' == $atts['direction'] || 'right' == $atts['direction'] ? 'quote-left-right' : false; // has img class $imgclass = $atts['img'] ? 'quote-has-image' : false; // type $type = $atts['type'] ? sprintf( ' aesop-quote-type-%s', trim( $atts['type'] ) ) : false; // align $align = $atts['align'] ? sprintf( 'aesop-component-align-%s', esc_attr( $atts['align'] ) ) : null; // style/consolidated classes $css_class_array = array( $align, $type, $contentwidth, $isparallax, $lrclass, $imgclass ); $css_classes = ''; if ( !empty( $css_class_array ) ) { foreach ( $css_class_array as $class ) { $css_classes .= ' '.$class; } } // lets make sure scroll direction makes sense if ($isparallax) { if ($atts['align']=="left") { $atts['direction'] = 'right'; } else if ($atts['align']=="right"){ $atts['direction'] = 'left'; } } // core/custom classes $core_classes = function_exists( 'aesop_component_classes' ) ? aesop_component_classes( 'quote' ) : null; // cite $cite = $atts['cite'] ? apply_filters( 'aesop_quote_component_cite', sprintf( '%s', aesop_component_media_filter( $atts['cite'] ) ) ) : null; ob_start(); do_action( 'aesop_quote_before', $atts, $unique ); // action ?>
class="aesop-component aesop-quote-component " >