From aa431bb9b5507ee6f39ca47d4dd5eb6702cb3acc Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Thu, 7 Apr 2016 00:52:03 -0400 Subject: [PATCH 1/6] updated 'tested up to' to 4.5 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 9ddba30..494000e 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: philliplord, sjcockell, knowledgeblog, d_swan, paulschreiber, jwenerd Tags: mathematics, math, latex, mathml, mathjax, science, res-comms, scholar, academic Requires at least: 3.0 -Tested up to: 4.3 +Tested up to: 4.5 Stable tag: 1.3.4 License: GPLv3 From b417254f9cd69328f1d233b1187c408430914415 Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Wed, 1 Feb 2017 18:09:32 -0500 Subject: [PATCH 2/6] use elseif instead of else if --- mathjax-latex.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathjax-latex.php b/mathjax-latex.php index c0e1cc4..d0d8068 100644 --- a/mathjax-latex.php +++ b/mathjax-latex.php @@ -156,7 +156,7 @@ public static function latex_shortcode( $atts, $content ) { if ( 'inline' === $shortcode_atts['syntax'] ) { return '\(' . $content . '\)'; - } else if ( 'display' === $shortcode_atts['syntax'] ) { + } elseif ( 'display' === $shortcode_atts['syntax'] ) { return '\[' . $content . '\]'; } } From ce7e3442faa44369f3fc4fe676a8f91bdf11c6af Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Mon, 27 Mar 2017 13:28:15 -0400 Subject: [PATCH 3/6] remove unconditional() call, which adds comment to footer --- mathjax-latex.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/mathjax-latex.php b/mathjax-latex.php index d0d8068..13efa66 100644 --- a/mathjax-latex.php +++ b/mathjax-latex.php @@ -94,7 +94,6 @@ public static function init() { add_shortcode( 'nomathjax', array( __CLASS__, 'nomathjax_shortcode' ) ); add_shortcode( 'latex', array( __CLASS__, 'latex_shortcode' ) ); add_action( 'wp_footer', array( __CLASS__, 'add_script' ) ); - add_action( 'wp_footer', array( __CLASS__, 'unconditional' ) ); if ( get_option( 'kblog_mathjax_use_wplatex_syntax' ) ) { add_filter( 'the_content', array( __CLASS__, 'inline_to_shortcode' ) ); @@ -127,19 +126,6 @@ public static function mathjax_uninstall() { delete_option( 'kblog_mathjax_config' ); } - public static function unconditional() { - echo ''; - } - public static function mathjax_shortcode( $atts, $content ) { self::$add_script = true; } From ac197daccbd59ade2d7397e04d564bc1170d0f35 Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Mon, 27 Mar 2017 13:29:12 -0400 Subject: [PATCH 4/6] define MATHJAX_VERSION and use it in wp_enqueue_scripts() call --- mathjax-latex.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mathjax-latex.php b/mathjax-latex.php index 13efa66..dc31b83 100644 --- a/mathjax-latex.php +++ b/mathjax-latex.php @@ -32,6 +32,8 @@ * along with this program. If not, see http://www.gnu.org/licenses/. */ +define( 'MATHJAX_VERSION', '1.3.4' ); + require_once( dirname( __FILE__ ) . '/mathjax-latex-admin.php' ); class MathJax { @@ -165,7 +167,7 @@ public static function add_script() { $mathjax_url = $mathjax_location . '?config=' . get_option( 'kblog_mathjax_config' ); - wp_enqueue_script( 'mathjax', $mathjax_url, false, '1.2.1', false ); + wp_enqueue_script( 'mathjax', $mathjax_url, false, MATHJAX_VERSION, false ); } public static function inline_to_shortcode( $content ) { From ec0525d626892f2c011fb271c8506a30bb133623 Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Mon, 27 Mar 2017 13:30:51 -0400 Subject: [PATCH 5/6] support MathJax configuration tag * add mathjax_config filter (takes and returns array) * add script_loader_tag filter to fix