'', 'id' => '', 'align' => '', 'bordercolor' => '', 'borderradius' => $smof_data['imageframe_border_radius'], 'bordersize' => $smof_data['imageframe_border_size'], 'lightbox' => 'no', 'link' => '', 'linktarget' => '_self', 'style' => '', 'style_type' => 'none', 'stylecolor' => '', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '' ), $args ); if( ! $defaults['style'] ) { $defaults['style'] = $defaults['style_type']; } if( $defaults['borderradius'] && $defaults['style'] == 'bottomshadow' ) { $defaults['borderradius'] = '0'; } if( $defaults['borderradius'] == 'round' ) { $defaults['borderradius'] = '50%'; } extract( $defaults ); self::$args = $defaults; if( ! $bordercolor ) { $bordercolor = $smof_data['imgframe_border_color']; } if( ! $stylecolor ) { $stylecolor = $smof_data['imgframe_style_color']; } $rgb = FusionCore_Plugin::hex2rgb( $stylecolor ); $styles = ''; if( $bordersize != '0' && $bordersize != '0px' ) { $styles .= ".imageframe-{$this->imageframe_counter} img{border:{$bordersize} solid {$bordercolor};}"; } if( $borderradius != '0' && $borderradius != '0px' ) { $styles .= ".imageframe-{$this->imageframe_counter} img{-webkit-border-radius:{$borderradius};-moz-border-radius:{$borderradius};border-radius:{$borderradius};}"; } if( $style == 'glow' ) { $styles .= ".imageframe-{$this->imageframe_counter}.imageframe-glow img{ -moz-box-shadow: 0 0 3px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3); -webkit-box-shadow: 0 0 3px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3); box-shadow: 0 0 3px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3); }"; } if( $style == 'dropshadow' ) { $styles .= ".imageframe-{$this->imageframe_counter}.imageframe-dropshadow img{ -moz-box-shadow: 2px 3px 7px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3); -webkit-box-shadow: 2px 3px 7px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3); box-shadow: 2px 3px 7px rgba({$rgb[0]},{$rgb[1]},{$rgb[2]},.3); }"; } if( $styles ) { $styles = sprintf('', $styles ); } else { $styles = ''; } $html = sprintf( '%s', $styles, FusionCore_Plugin::attributes( 'imageframe-shortcode' ) ); preg_match( '/(class=["\'](.*?)["\'])/', $content, $classes ); $class_style = ''; if ( $style == 'circle' ) { $class_style = ' img-circle'; } if( $classes ) { $content = str_replace( $classes[0], sprintf( 'class="img-responsive %s%s"', $classes[2], $class_style ) , $content ); } else { $content = str_replace( '/>', sprintf( 'class="img-responsive%s" />', $class_style ) , $content ); } $alt_tag = $image_url = ''; preg_match( '/(src=["\'](.*?)["\'])/', $content, $src ); $image_url = self::$args['pic_link'] = $src[2]; $image_id = FusionCore_Plugin::get_attachment_id_from_url( $image_url ); if( isset( $image_id ) && $image_id ) { $alt_tag = sprintf( 'alt="%s"', get_post_meta( $image_id, '_wp_attachment_image_alt', true ) ); } if( strpos( $content, 'alt=""' ) !== false && $alt_tag ) { $content = str_replace( 'alt=""', $alt_tag, $content ); } elseif ( strpos( $content, 'alt' ) === false && $alt_tag ) { $content = str_replace( '/> ', $alt_tag . ' />', $content ); } $output = do_shortcode( $content ); if( $lightbox == 'yes' ) { self::$args['title_attr'] = ''; if( $image_id ) { self::$args['title_attr'] = get_post_field( 'post_excerpt', $image_id ); } $output = sprintf( '%s', FusionCore_Plugin::attributes( 'imageframe-shortcode-link' ), do_shortcode( $content ) ); } elseif( $link ) { $output = sprintf( '%s', FusionCore_Plugin::attributes( 'imageframe-shortcode-link' ), do_shortcode( $content ) ); } $html .= $output . ''; if( $align == 'center' ) { $html = sprintf( '