From 9f3c902de66bd55a489f27e469f9b666c2e26c4d Mon Sep 17 00:00:00 2001
From: Steve Jones
Date: Thu, 5 Oct 2023 15:45:55 -0400
Subject: [PATCH] added - disclosure superscript
---
inc/helper-functions.php | 23 ++++++++++++++++++++++-
single.php | 27 ++++++++++++++++++++-------
2 files changed, 42 insertions(+), 8 deletions(-)
diff --git a/inc/helper-functions.php b/inc/helper-functions.php
index 9db3046..2b7e63b 100644
--- a/inc/helper-functions.php
+++ b/inc/helper-functions.php
@@ -328,4 +328,25 @@ function slp_a_target( $value ) {
if( ! $value ) return;
return ' target="' . $value . '"';
-}
\ No newline at end of file
+}
+
+/**
+ * Appends a superscript at the end of each line in the provided HTML content.
+ *
+ * @param string $content The original HTML content.
+ * @param string $superscriptText The text to be added as superscript. Default is 'TM'.
+ *
+ * @return string Updated content with superscripts appended.
+ */
+function slp_append_superscript( $content, $superscript_text ) {
+ // Convert the superscript text to actual HTML tag.
+ $superscript = '' . $superscript_text . '';
+
+ // Replace each line break with the superscript followed by a line break.
+ $updated_content = str_replace( ' ', $superscript . ' ', $content );
+
+ // Additionally, add superscript to the end of the paragraph if needed.
+ $updated_content = str_replace( '