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