Advertisement
xpeed

typo v2

Jun 11th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.83 KB | None | 0 0
  1. if ( !function_exists( 'bizipress_advanced_xs_font_styles' ) ) :
  2.  
  3.     /**
  4.      * Get shortcode advanced Font styles
  5.      *
  6.      */
  7.     function bizipress_advanced_xs_font_styles( $style ) {
  8.         $font_styles = '';
  9.         if ( isset( $style[ 'google_font' ] ) && ($style[ 'google_font' ] === true || $style[ 'google_font' ] === 'true') ) {
  10.  
  11.             $font_styles .= isset( $style[ 'family' ] ) ? 'font-family:' . custom_font_style( $style[ 'family' ] ) . ';' : '';
  12.  
  13.             if ( strpos( $style[ 'variation' ], 'italic' ) !== false )
  14.                 $font_styles .= 'font-style:italic;';
  15.             elseif ( strpos( $style[ 'variation' ], 'oblique' ) !== false )
  16.                 $font_styles .= 'font-style: oblique;';
  17.             else
  18.                 $font_styles .= 'font-style: normal;';
  19.  
  20.             $font_styles .= (intval( $style[ 'variation' ] ) == 0) ? 'font-weight:400;' : 'font-weight:' . intval( $style[ 'variation' ] ) . ';';
  21.         } else {
  22.             $font_styles .= isset( $style[ 'family' ] ) ? 'font-family:' . custom_font_style( $style[ 'family' ] ) . ';' : '';
  23.             $font_styles .= isset( $style[ 'style' ] ) ? 'font-style:' . esc_attr( $style[ 'style' ] ) . ';' : '';
  24.             $font_styles .= isset( $style[ 'weight' ] ) ? 'font-weight:' . esc_attr( $style[ 'weight' ] ) . ';' : '';
  25.         }
  26.         $font_styles .= isset( $style[ 'color' ] ) && !empty( $style[ 'color' ] ) ? 'color:' . esc_attr( $style[ 'color' ] ) . ';' : '';
  27.         $font_styles .= isset( $style[ 'line-height' ] ) && !empty( $style[ 'line-height' ] ) ? 'line-height:' . esc_attr( $style[ 'line-height' ] ) . 'px;' : '';
  28.         $font_styles .= isset( $style[ 'letter-spacing' ] ) && !empty( $style[ 'letter-spacing' ] ) ? 'letter-spacing:' . esc_attr( $style[ 'letter-spacing' ] ) . 'px;' : '';
  29.         $font_styles .= isset( $style[ 'size' ] ) && !empty( $style[ 'size' ] ) ? 'font-size:' . esc_attr( $style[ 'size' ] ) . 'px;' : '';
  30.  
  31.  
  32.         return !empty( $font_styles ) ? $font_styles : '';
  33.     }
  34.  
  35. endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement