Skip to content

Commit

Permalink
eliminate use of extract(). Fixes #8.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Schreiber committed Feb 26, 2015
1 parent 44656c8 commit 4dacc90
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mathjax-latex.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ public static function latex_shortcode( $atts, $content ) {
self::$add_script = true;

// this gives us an optional "syntax" attribute, which defaults to "inline", but can also be "display"
extract( shortcode_atts( array( 'syntax' => get_option( 'kblog_mathjax_latex_inline' ) ), $atts ) );
if ( 'inline' === $syntax ) {
$shortcode_atts = shortcode_atts( array( 'syntax' => get_option( 'kblog_mathjax_latex_inline' ) ), $atts );

if ( 'inline' === $shortcode_atts['syntax'] ) {
return '\(' . $content . '\)';
} else if ( 'display' === $syntax ) {
} else if ( 'display' === $shortcode_atts['syntax'] ) {
return '\[' . $content . '\]';
}
}
Expand Down

0 comments on commit 4dacc90

Please sign in to comment.