From a6a1a67b00be6bc7e5d2b3bad15fb24716febedd Mon Sep 17 00:00:00 2001 From: pewgeuges Date: Sun, 28 Mar 2021 12:41:33 +0000 Subject: [PATCH] Unreleased urgent bugfix v2.6.2 with Stable Tag 2.6.0. Needed for https://wordpress.org/support/topic/problem-with-footnotes-in-excerpts-of-the-blog-page/ = 2.6.2 = - Bugfix: Excerpts: debug the 'No' option by generating excerpts from scratch without footnotes, thanks to @nikelaos @markcheret @martinneumannat bug reports. - Bugfix: Tooltips: Continue reading: debug link for AMP compatibility mode. git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2504730 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/task.php | 375 +++++++++++++++++++++++++------------------ footnotes.php | 8 +- js/wysiwyg-editor.js | 2 +- readme.txt | 4 + 4 files changed, 232 insertions(+), 157 deletions(-) diff --git a/class/task.php b/class/task.php index 04c8854..3df6403 100644 --- a/class/task.php +++ b/class/task.php @@ -353,7 +353,43 @@ class MCI_Footnotes_Task { public static $a_bool_mirror_tooltip_text = false; /** - * Footnote delimiter syntax validation. + * Footnote delimiter start short code. + * + * @since 1.5.0 (constant, variable) + * @since 2.6.2 (property) + * @var str + */ + public static $a_str_start_tag = ''; + + /** + * Footnote delimiter end short code. + * + * @since 1.5.0 (constant, variable) + * @since 2.6.2 (property) + * @var str + */ + public static $a_str_end_tag = ''; + + /** + * Footnote delimiter start short code in regex format. + * + * @since 2.4.0 (variable) + * @since 2.6.2 (property) + * @var str + */ + public static $a_str_start_tag_regex = ''; + + /** + * Footnote delimiter end short code in regex format. + * + * @since 2.4.0 (variable) + * @since 2.6.2 (property) + * @var str + */ + public static $a_str_end_tag_regex = ''; + + /** + * Footnote delimiter syntax validation enabled. * * - Adding: Footnote delimiters: syntax validation for balanced footnote start and end tag short codes. * @@ -407,18 +443,18 @@ class MCI_Footnotes_Task { $l_int_widget_text_priority = ( -1 === $l_int_widget_text_priority ) ? PHP_INT_MAX : $l_int_widget_text_priority; // Append custom css to the header. - add_filter( 'wp_head', array( $this, 'wp_head' ), PHP_INT_MAX ); + add_filter( 'wp_head', array( $this, 'footnotes_output_head' ), PHP_INT_MAX ); // Append the love and share me slug to the footer. - add_filter( 'wp_footer', array( $this, 'wp_footer' ), PHP_INT_MAX ); + add_filter( 'wp_footer', array( $this, 'footnotes_output_footer' ), PHP_INT_MAX ); if ( MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_TITLE ) ) ) { - add_filter( 'the_title', array( $this, 'the_title' ), $l_int_the_title_priority ); + add_filter( 'the_title', array( $this, 'footnotes_in_title' ), $l_int_the_title_priority ); } // Configurable priority level for reference container relative positioning; default 98. if ( MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_CONTENT ) ) ) { - add_filter( 'the_content', array( $this, 'the_content' ), $l_int_the_content_priority ); + add_filter( 'the_content', array( $this, 'footnotes_in_content' ), $l_int_the_content_priority ); /** * Hook for category pages. @@ -438,7 +474,7 @@ class MCI_Footnotes_Task { * For this to happen, WordPress’ built-in partial HTML blocker needs to be disabled. * @link https://docs.woocommerce.com/document/allow-html-in-term-category-tag-descriptions/ */ - add_filter( 'term_description', array( $this, 'the_content' ), $l_int_the_content_priority ); + add_filter( 'term_description', array( $this, 'footnotes_in_content' ), $l_int_the_content_priority ); /** * Hook for popup maker popups. @@ -451,17 +487,18 @@ class MCI_Footnotes_Task { * @since 2.5.1 * @date 2021-01-18T2038+0100 */ - add_filter( 'pum_popup_content', array( $this, 'the_content' ), $l_int_the_content_priority ); + add_filter( 'pum_popup_content', array( $this, 'footnotes_in_content' ), $l_int_the_content_priority ); } if ( MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_EXCERPT ) ) ) { - add_filter( 'the_excerpt', array( $this, 'the_excerpt' ), $l_int_the_excerpt_priority ); + add_filter( 'the_excerpt', array( $this, 'footnotes_in_excerpt' ), $l_int_the_excerpt_priority ); + add_filter( 'get_the_excerpt', array( $this, 'footnotes_in_excerpt' ), $l_int_the_excerpt_priority ); } if ( MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_EXPERT_LOOKUP_WIDGET_TITLE ) ) ) { - add_filter( 'widget_title', array( $this, 'widget_title' ), $l_int_widget_title_priority ); + add_filter( 'widget_title', array( $this, 'footnotes_in_widget_title' ), $l_int_widget_title_priority ); } if ( MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_EXPERT_LOOKUP_WIDGET_TEXT ) ) ) { - add_filter( 'widget_text', array( $this, 'widget_text' ), $l_int_widget_text_priority ); + add_filter( 'widget_text', array( $this, 'footnotes_in_widget_text' ), $l_int_widget_text_priority ); } /** @@ -548,7 +585,7 @@ class MCI_Footnotes_Task { * @since 2.3.0 Bugfix: Reference container: convert top padding to margin and make it a setting, thanks to @hamshe bug report. * @since 2.5.4 Bugfix: Referrers: optional fixes to vertical alignment, font size and position (static) for in-theme consistency and cross-theme stability, thanks to @tomturowski bug report. */ - public function wp_head() { + public function footnotes_output_head() { // Insert start tag without switching out of PHP. echo "\r\n