Maintain a list of all hooks that are registered throughout
+the plugin, and register them with the WordPress API. Call the
+run function to execute the list of actions and filters.
Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports.
Set the plugin name and the plugin version that can be used throughout the plugin.
+Load the dependencies, define the locale, and set the hooks for the admin area and
+the public-facing side of the site.
+
@@ -615,97 +464,10 @@ ull
since
- 1.5.0
-
-
-
Update: Fix for deprecated PHP function create_function(), thanks to @psykonevro @daliasued bug reports, thanks to @felipelavinz code contribution
This action is documented in includes/class-plugin-name-activator.php
+
+
+
+
+
+
+
+
+
+ deactivate_plugin_name()
+
+
+
+
+
The code that runs during plugin deactivation.
+
+
+
+ deactivate_plugin_name() : mixed
+
+
This action is documented in includes/class-plugin-name-deactivator.php
+
+
+
+
+
+
+
+
+
+ run_footnotes()
+
+
+
+
+
Begins execution of the plugin.
+
+
+
+ run_footnotes() : mixed
+
+
Since everything within the plugin is registered via hooks,
+then kicking off the plugin from this point in the file does
+not affect the page life cycle.
Absolute Directory path to lookup for *.php files.
+
This action is documented in includes/class-plugin-name-activator.php
-
-
+
+
+
+
+
+ deactivate_plugin_name()
+
+
+
+
+
The code that runs during plugin deactivation.
+
+
+
+ deactivate_plugin_name() : mixed
+
+
This action is documented in includes/class-plugin-name-deactivator.php
+
+
+
+
+
+
+
+
+
+ run_footnotes()
+
+
+
+
+
Begins execution of the plugin.
+
+
+
+ run_footnotes() : mixed
+
+
Since everything within the plugin is registered via hooks,
+then kicking off the plugin from this point in the file does
+not affect the page life cycle.
Absolute Directory path to lookup for *.php files.
+
This action is documented in includes/class-plugin-name-activator.php
-
-
+
+
+
+
+
+ deactivate_plugin_name()
+
+
+
+
+
The code that runs during plugin deactivation.
+
+
+
+ deactivate_plugin_name() : mixed
+
+
This action is documented in includes/class-plugin-name-deactivator.php
+
+
+
+
+
+
+
+
+
+ run_footnotes()
+
+
+
+
+
Begins execution of the plugin.
+
+
+
+ run_footnotes() : mixed
+
+
Since everything within the plugin is registered via hooks,
+then kicking off the plugin from this point in the file does
+not affect the page life cycle.
Absolute Directory path to lookup for *.php files.
+
This action is documented in includes/class-plugin-name-activator.php
-
-
+
+
+
+
+
+ deactivate_plugin_name()
+
+
+
+
+
The code that runs during plugin deactivation.
+
+
+
+ deactivate_plugin_name() : mixed
+
+
This action is documented in includes/class-plugin-name-deactivator.php
+
+
+
+
+
+
+
+
+
+ run_footnotes()
+
+
+
+
+
Begins execution of the plugin.
+
+
+
+ run_footnotes() : mixed
+
+
Since everything within the plugin is registered via hooks,
+then kicking off the plugin from this point in the file does
+not affect the page life cycle.
Bugfix: Referrers and backlinks: remove hard links to streamline browsing history, thanks to @theroninjedi47 bug report.
+
+
+
+
+
+ since
+
+
+ 2.0.4
+
+
+
Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro issue report, thanks to @martinneumannat issue report and code contribution.
Debug Yes option, the setting becomes fully effective.
+
+
Bugfix: Excerpts: make excerpt handling backward compatible, thanks to @mfessler bug report.
+
+
+
+
+
+ since
+
+
+ 2.7.0
+
+
The input was already the processed excerpt, no more footnotes to search.
+But issue #65 brought up that manual excerpts can include processable footnotes.
+Default 'manual' is fallback and is backward compatible with the initial setup.
Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report.
+
+
+
+
+ since
+
+
+ 2.1.1
+
+
Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage, thanks to @andreasra feedback.
+
+
+
+
+ since
+
+
+ 2.1.3
+
+
raise settings priority to override theme stylesheets
+
+
+
+
+ since
+
+
+ 2.1.4
+
+
Bugfix: Tooltips: Styling: fix font size issue by adding font size to settings with legacy as default.
+
+
+
+
+ since
+
+
+ 2.1.4
+
+
Bugfix: Reference container: fix layout issues by moving backlink column width to settings.
+
+
+
+
+ since
+
+
+ 2.2.5
+
+
Bugfix: Reference container: Label: make bottom border an option, thanks to @markhillyer issue report.
+
+
+
+
+ since
+
+
+ 2.2.5
+
+
Bugfix: Reference container: Label: option to select paragraph or heading element, thanks to @markhillyer issue report.
+
+
+
+
+ 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.
Bugfix: Excerpts: debug the 'No' option by generating excerpts on the basis of the post without footnotes, thanks to @nikelaos @markcheret @martinneumannat bug reports.
Bugfix: Excerpts: debug the 'Yes' option by generating excerpts with footnotes on the basis of the posts, thanks to @nikelaos @martinneumannat bug reports.
Bugfix: Process: remove trailing comma after last argument in multiline function calls for PHP < 7.3, thanks to @scroom @copylefter @lagoon24 bug reports.
+
+
+
+
+
+ since
+
+
+ 2.6.4
+
+
+
+
+
+ see
+
+
+ self::generate_excerpt()
+
+
Uses information and some code from Advanced Excerpt.
+
+
+
+
+
+
Return values
+ string
+ —
+
$p_str_content An excerpt of the post.
+Does not apply full WordPress excerpt processing.
Adding: Footnote delimiters: syntax validation for balanced footnote start and end tag short codes.
+
+
+
+
+ since
+
+
+ 2.5.0
+
+
Bugfix: Footnote delimiters: Syntax validation: exclude certain cases involving scripts, thanks to @andreasra bug report.
+
+
+
+
+ since
+
+
+ 2.5.0
+
+
Bugfix: Footnote delimiters: Syntax validation: complete message with hint about setting, thanks to @andreasra bug report.
+
+
+
+
+ since
+
+
+ 2.5.0
+
+
Bugfix: Footnote delimiters: Syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra bug report.
+
+
Bugfix: Footnote delimiter short codes: debug closing pointy brackets in the Block Editor by accounting for unbalanced HTML escapement, thanks to @patrick_here @alifarahani8000 bug reports.
While the Classic Editor (visual mode) escapes both pointy brackets,
+the Block Editor enforces balanced escapement only in code editor mode
+when the opening tag is already escaped. In visual mode, the Block Editor
+does not escape the greater-than sign.
@@ -491,7 +493,7 @@ the public-facing side of the site.
The reference to the class that orchestrates the hooks with the plugin.
@@ -541,7 +543,7 @@ the public-facing side of the site.
The name of the plugin used to uniquely identify it within the context of
@@ -592,7 +594,7 @@ WordPress and to define internationalization functionality.
Retrieve the version number of the plugin.
@@ -642,7 +644,7 @@ WordPress and to define internationalization functionality.
Run the loader to execute all of the hooks with WordPress.
@@ -700,7 +702,7 @@ WordPress and to define internationalization functionality.
Register all of the hooks related to the admin area functionality
@@ -759,7 +761,7 @@ of the plugin.
Register all of the hooks related to the public-facing functionality
@@ -818,7 +820,7 @@ of the plugin.
Load the required dependencies for this plugin.
@@ -829,10 +831,22 @@ of the plugin.
Include the following files that make up the plugin:
-
Footnotes_Loader. Orchestrates the hooks of the plugin.
@@ -784,7 +915,7 @@ list directly in the template, as CSS is in English anyway
Displays transitional legacy Custom CSS box.
@@ -833,7 +964,7 @@ list directly in the template, as CSS is in English anyway
Displays the new Custom CSS box.
@@ -882,7 +1013,7 @@ list directly in the template, as CSS is in English anyway
Output the Description of a section. May be overwritten in any section.
@@ -931,7 +1062,7 @@ list directly in the template, as CSS is in English anyway
Displays the content of specific sub page.
@@ -980,7 +1111,7 @@ list directly in the template, as CSS is in English anyway
Displays all Donate button to support the developers.
@@ -1029,7 +1160,7 @@ list directly in the template, as CSS is in English anyway
Displays the footnotes in excerpt setting.
@@ -1113,7 +1244,7 @@ list directly in the template, as CSS is in English anyway
Returns a Priority index. Lower numbers have a higher Priority.
@@ -1162,7 +1293,7 @@ list directly in the template, as CSS is in English anyway
Displays all options for the fragment identifier configuration.
@@ -1222,7 +1353,7 @@ list directly in the template, as CSS is in English anyway
Displays a short introduction to the Plugin.
@@ -1288,7 +1419,7 @@ list directly in the template, as CSS is in English anyway
Displays all settings for the backlink symbol.
@@ -1410,7 +1541,7 @@ list directly in the template, as CSS is in English anyway
Displays the setting for the input label issue solution.
@@ -1459,7 +1590,7 @@ list directly in the template, as CSS is in English anyway
Displays available Hooks to look for Footnote short codes.
@@ -1554,7 +1685,7 @@ define -1 as PHP_INT_MAX instead
Displays all settings for 'I love Footnotes'.
@@ -1624,7 +1755,7 @@ define -1 as PHP_INT_MAX instead
Displays enabled status for the footnotes mouse-over box.
@@ -1694,7 +1825,7 @@ define -1 as PHP_INT_MAX instead
Displays style settings for the footnotes mouse-over box.
@@ -1743,7 +1874,7 @@ define -1 as PHP_INT_MAX instead
Displays dimensions setting for the footnotes mouse-over box.
@@ -1792,7 +1923,7 @@ define -1 as PHP_INT_MAX instead
Displays position settings for the footnotes mouse-over box.
@@ -1841,7 +1972,7 @@ define -1 as PHP_INT_MAX instead
Displays dedicated tooltip text settings for the footnotes mouse-over box.
@@ -1890,7 +2021,7 @@ define -1 as PHP_INT_MAX instead
Displays timing settings for the footnotes mouse-over box.
@@ -1939,7 +2070,7 @@ define -1 as PHP_INT_MAX instead
Displays truncation settings for the footnotes mouse-over box.
@@ -1988,7 +2119,7 @@ define -1 as PHP_INT_MAX instead
Displays all options for the footnotes numbering.
@@ -2037,7 +2168,7 @@ define -1 as PHP_INT_MAX instead
Displays all settings for the reference container.
@@ -2114,7 +2245,7 @@ define -1 as PHP_INT_MAX instead
Registers all sections for a sub page.
@@ -2163,7 +2294,7 @@ define -1 as PHP_INT_MAX instead
Registers a sub page.
@@ -2212,7 +2343,7 @@ define -1 as PHP_INT_MAX instead
Displays all options for the scrolling behavior.
@@ -2261,7 +2392,7 @@ define -1 as PHP_INT_MAX instead
Displays all options for the footnotes start and end tag short codes.
@@ -2392,7 +2523,7 @@ define -1 as PHP_INT_MAX instead
Displays all settings for the footnote referrers.
@@ -2462,7 +2593,7 @@ define -1 as PHP_INT_MAX instead
Returns the html tag for an input [type = checkbox].
@@ -2523,7 +2654,7 @@ define -1 as PHP_INT_MAX instead
Returns the html tag for an input [type = text] with color selection class.
@@ -2584,7 +2715,7 @@ define -1 as PHP_INT_MAX instead
Returns the html tag for an input/select label.
@@ -2654,7 +2785,7 @@ define -1 as PHP_INT_MAX instead
Returns a line break to have a space between two lines.
@@ -2703,7 +2834,7 @@ define -1 as PHP_INT_MAX instead
Returns an array describing a meta box.
@@ -2792,7 +2923,7 @@ define -1 as PHP_INT_MAX instead
Returns a line break to start a new line.
@@ -2841,7 +2972,7 @@ define -1 as PHP_INT_MAX instead
Returns the html tag for an input [type = num].
@@ -2940,7 +3071,7 @@ define -1 as PHP_INT_MAX instead
Returns an array describing a sub page section.
@@ -3029,7 +3160,7 @@ define -1 as PHP_INT_MAX instead
Returns the html tag for a select box.
@@ -3140,7 +3271,7 @@ define -1 as PHP_INT_MAX instead
Returns a simple text inside html <span> text.
@@ -3201,7 +3332,7 @@ define -1 as PHP_INT_MAX instead
Returns the html tag for an input [type = text].
@@ -3289,7 +3420,7 @@ define -1 as PHP_INT_MAX instead
Returns the html tag for a text area.
@@ -3350,7 +3481,7 @@ define -1 as PHP_INT_MAX instead
Returns an array of all registered meta boxes for each section of the sub page.
@@ -3464,7 +3595,7 @@ Change string "%s styling" to "Footnotes styling" to fix lay
Returns an array of all registered sections for the sub page.
@@ -3541,7 +3672,7 @@ Change string "%s styling" to "Footnotes styling" to fix lay
Returns the unique slug of the sub page.
@@ -3590,7 +3721,7 @@ Change string "%s styling" to "Footnotes styling" to fix lay
Returns the title of the sub page.
@@ -3639,7 +3770,7 @@ Change string "%s styling" to "Footnotes styling" to fix lay
Loads specific setting and returns an array with the keys [id, name, value].
@@ -3767,7 +3898,7 @@ Removing this did not fix the quotation mark backslash escapement bug.
Append javascript and css files for specific sub page.
@@ -3816,7 +3947,7 @@ Removing this did not fix the quotation mark backslash escapement bug.
Registers all Meta boxes for a sub page.
@@ -3877,7 +4008,7 @@ Removing this did not fix the quotation mark backslash escapement bug.
Save all Plugin settings.
diff --git a/docs/classes/Footnotes-Loader.html b/docs/classes/Footnotes-Loader.html
index 296324e..045b65a 100644
--- a/docs/classes/Footnotes-Loader.html
+++ b/docs/classes/Footnotes-Loader.html
@@ -177,13 +177,6 @@ run function to execute the list of actions and filters.
Add a new filter to the collection to be registered with WordPress.
A utility function that is used to register the actions and hooks into a single
diff --git a/docs/classes/Footnotes-Public.html b/docs/classes/Footnotes-Public.html
index 1800669..2cc1450 100644
--- a/docs/classes/Footnotes-Public.html
+++ b/docs/classes/Footnotes-Public.html
@@ -165,9 +165,9 @@ and JavaScript.
Bugfix: Editor buttons: debug button by reverting name change in PHP file while JS file and HTML template remained unsynced, thanks to @gova bug report.
protected
@@ -493,7 +493,7 @@ the public-facing side of the site.
The reference to the class that orchestrates the hooks with the plugin.
@@ -543,7 +543,7 @@ the public-facing side of the site.
The name of the plugin used to uniquely identify it within the context of
@@ -594,7 +594,7 @@ WordPress and to define internationalization functionality.
Retrieve the version number of the plugin.
@@ -644,7 +644,7 @@ WordPress and to define internationalization functionality.
Run the loader to execute all of the hooks with WordPress.
@@ -702,7 +702,7 @@ WordPress and to define internationalization functionality.
Register all of the hooks related to the admin area functionality
@@ -725,10 +725,20 @@ of the plugin.
since
- 2.8.0
+ 1.5.0
+
+
+ since
+
+
+ 2.8.0
+
+
Moved registrating from various classes into Footnotes_Admin.
+
+
access
@@ -761,7 +771,7 @@ of the plugin.
Register all of the hooks related to the public-facing functionality
diff --git a/docs/files/src-footnotes.html b/docs/files/src-footnotes.html
index 62b5816..781f640 100644
--- a/docs/files/src-footnotes.html
+++ b/docs/files/src-footnotes.html
@@ -136,7 +136,7 @@
Searches and replaces the footnotes and generates the reference container.
From 418abc253b3381513d394e05628ac0800c1fd84d Mon Sep 17 00:00:00 2001
From: Mark Cheret
Date: Wed, 28 Apr 2021 05:33:35 +0200
Subject: [PATCH 50/99] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 873c520..3304714 100644
--- a/README.md
+++ b/README.md
@@ -3,11 +3,11 @@
    
-    
+    
[](https://www.gnu.org/licenses/gpl-3.0)  [](https://github.com/markcheret/footnotes/actions/workflows/ossar-analysis.yml) [](https://github.com/markcheret/footnotes/actions/workflows/php.yml)
-[](http://commitizen.github.io/cz-cli/)
+[](http://commitizen.github.io/cz-cli/) [](https://coveralls.io/github/markcheret/footnotes?branch=main)

From a048fae868427731ae2fc6db6b129b7a0cefcd26 Mon Sep 17 00:00:00 2001
From: Rumperuu
Date: Thu, 29 Apr 2021 18:38:17 +0100
Subject: [PATCH 51/99] build: add GitHub Wiki repo. as Git submodule
---
.gitmodules | 3 +++
footnotes.wiki | 1 +
2 files changed, 4 insertions(+)
create mode 100644 .gitmodules
create mode 160000 footnotes.wiki
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..f12d971
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "footnotes.wiki"]
+ path = footnotes.wiki
+ url = git://github.com/markcheret/footnotes.wiki
diff --git a/footnotes.wiki b/footnotes.wiki
new file mode 160000
index 0000000..837ae00
--- /dev/null
+++ b/footnotes.wiki
@@ -0,0 +1 @@
+Subproject commit 837ae00912690f4c39c719d4ce9c9a197610dbe6
From 27a98a86a7922ac8e613caa685b2a5608b529d8f Mon Sep 17 00:00:00 2001
From: Rumperuu
Date: Thu, 29 Apr 2021 18:39:20 +0100
Subject: [PATCH 52/99] ci: update Markdown linting command
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 450d88d..7047eaa 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
"*.(sa|sc|c)ss": [
"npm run lint:css"
],
- "*.md": [
+ "*.(md|markdown|wiki)": [
"npm run lint:md"
],
"*.htm(l)?": [
From bfeb11d5ad726055ce7cb8f070d964a263509dcf Mon Sep 17 00:00:00 2001
From: Rumperuu
Date: Thu, 29 Apr 2021 20:57:30 +0100
Subject: [PATCH 53/99] docs: update docblocks
---
.../class-footnotes-layout-settings.php | 2 +-
src/footnotes.php | 39 ++++--
src/includes/class-footnotes-activator.php | 21 +--
src/includes/class-footnotes-config.php | 71 ++++++----
src/includes/class-footnotes-convert.php | 92 +++++++------
src/includes/class-footnotes-deactivator.php | 21 +--
src/includes/class-footnotes-i18n.php | 34 ++---
src/includes/class-footnotes-loader.php | 87 +++++++------
src/includes/class-footnotes-settings.php | 67 +++++-----
src/includes/class-footnotes-template.php | 113 ++++++++--------
src/includes/class-footnotes.php | 122 ++++++++++--------
11 files changed, 363 insertions(+), 306 deletions(-)
diff --git a/src/admin/layout/class-footnotes-layout-settings.php b/src/admin/layout/class-footnotes-layout-settings.php
index a6c42c4..7976add 100644
--- a/src/admin/layout/class-footnotes-layout-settings.php
+++ b/src/admin/layout/class-footnotes-layout-settings.php
@@ -1152,7 +1152,7 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
* Edited:
* @since 2.1.6 drop localized notices for CSS classes as the number increased to 16
* list directly in the template, as CSS is in English anyway
- * @see admin/partials/customize-css.html
+ * @link ../partials/customize-css.html
*
* @since 2.2.2 migrate Custom CSS to a dedicated tab
* @since 2.3.0 say 'copy-paste' instead of 'cut and paste' since cutting is not needed
diff --git a/src/footnotes.php b/src/footnotes.php
index 1f31b75..8413518 100755
--- a/src/footnotes.php
+++ b/src/footnotes.php
@@ -7,11 +7,11 @@
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
- * @author Mark Cheret
- * @since 1.0.0
- * @package footnotes
- * @copyright 2021 Mark Cheret (email: mark@cheret.de)
- * @license GPL-3.0-only
+ * @package footnotes
+ * @license GPL-3.0-only
+ * @copyright 2021 Mark Cheret (email: mark@cheret.de)
+ *
+ * @since 1.0.0
*
* @wordpress-plugin
* Plugin Name: footnotes
@@ -34,24 +34,33 @@ if ( ! defined( 'WPINC' ) ) {
}
/**
- * Current plugin version.
+ * The current plugin version.
+ *
+ * @link https://github.com/markcheret/footnotes/wiki/Versioning Versioning Guide
+ *
+ * @global string PLUGIN_VERSION
*
* @since 2.1.4
*/
define( 'PLUGIN_VERSION', '2.8.0d' );
/**
- * Defines the current environment ('development' or 'production').
+ * The current environment ('development' or 'production').
*
* This primarily affects whether minified or unminified files are requested.
*
+ * @global bool PRODUCTION_ENV
+ *
* @since 2.5.5
*/
define( 'PRODUCTION_ENV', false );
/**
- * The code that runs during plugin activation.
- * This action is documented in includes/class-plugin-name-activator.php
+ * Triggers during plugin activation.
+ *
+ * @uses Footnotes_Activator::activate() Method called on plugin activation.
+ *
+ * @since 2.8.0
*/
function activate_footnotes() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-footnotes-activator.php';
@@ -59,8 +68,11 @@ function activate_footnotes() {
}
/**
- * The code that runs during plugin deactivation.
- * This action is documented in includes/class-plugin-name-deactivator.php
+ * Triggers during plugin deactivation.
+ *
+ * @uses Footnotes_Deactivator::deactivate() Method called on plugin deactivation.
+ *
+ * @since 2.8.0
*/
function deactivate_plugin_name() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-footnotes-deactivator.php';
@@ -79,9 +91,8 @@ require plugin_dir_path( __FILE__ ) . 'includes/class-footnotes.php';
/**
* Begins execution of the plugin.
*
- * Since everything within the plugin is registered via hooks,
- * then kicking off the plugin from this point in the file does
- * not affect the page life cycle.
+ * Since everything within the plugin is registered via hooks, then kicking off
+ * the plugin from this point in the file does not affect the page life cycle.
*
* @since 2.8.0
*/
diff --git a/src/includes/class-footnotes-activator.php b/src/includes/class-footnotes-activator.php
index 14212e2..87acc7d 100644
--- a/src/includes/class-footnotes-activator.php
+++ b/src/includes/class-footnotes-activator.php
@@ -1,30 +1,31 @@
footnotes';
/**
- * Public Plugin name for dashboard heading
+ * Public plugin name for use as a dashboard heading.
*
* After properly displaying in dashboard headings until WPv5.4, the above started
- * in WPv5.5 being torn apart as if the headline was text-align:justify and not
- * the last line. That ugly display bug badly affected the plugin’s communication.
- * The only working solution found so far is using position:fixed in one heading
- * that isn’t translated, and dropping the logo in another, translatable heading.
+ * in WP 5.5 being torn apart as if the headline was `text-align:justify` and not
+ * the last line. That ugly display bug badly affected the plugin's communication.
+ * The only working solution found so far is using `position:fixed` in one heading
+ * that isn't translated, and dropping the logo in another, translatable heading.
*
- * @since 2.0.4
- * @var string
+ * @var string
+ *
+ * @since 2.0.4
+ * @todo Remove.
+ * @deprecated
*/
const C_STR_PLUGIN_HEADING_NAME = 'footnotes';
/**
- * Html tag for the LOVE symbol.
+ * HTML element for the ‘love’ symbol.
*
- * @since 1.5.0
- * @var string
+ * @var string
+ *
+ * @since 1.5.0
+ * @todo Remove.
+ * @deprecated
*/
const C_STR_LOVE_SYMBOL = '♥';
/**
- * HTML code for the 'love' symbol used in dashboard heading
+ * HTML element for the ‘love’ symbol used in dashboard heading
*
- * @since 2.0.4
- * @var string
+ * @var string
+ *
+ * @since 2.0.4
+ * @todo Remove.
+ * @deprecated
*/
const C_STR_LOVE_SYMBOL_HEADING = '♥';
/**
- * Short code to DON'T display the 'LOVE ME' slug on certain pages.
+ * Shortcode to NOT display the ‘LOVE ME’ slug on certain pages.
*
- * @since 1.5.0
- * @var string
+ * @var string
+ *
+ * @since 1.5.0
+ * @todo Remove.
+ * @deprecated
*/
const C_STR_NO_LOVE_SLUG = '[[no footnotes: love]]';
}
diff --git a/src/includes/class-footnotes-convert.php b/src/includes/class-footnotes-convert.php
index a3e9944..e307fff 100644
--- a/src/includes/class-footnotes-convert.php
+++ b/src/includes/class-footnotes-convert.php
@@ -1,31 +1,29 @@
';
}
- // phpcs:disable
+ // phpcs:enable WordPress.PHP.DevelopmentFunctions.error_log_var_dump, WordPress.PHP.DevelopmentFunctions.error_log_print_r
}
diff --git a/src/includes/class-footnotes-deactivator.php b/src/includes/class-footnotes-deactivator.php
index 323ab64..4514089 100644
--- a/src/includes/class-footnotes-deactivator.php
+++ b/src/includes/class-footnotes-deactivator.php
@@ -1,30 +1,31 @@
actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
@@ -66,12 +71,13 @@ class Footnotes_Loader {
/**
* Add a new filter to the collection to be registered with WordPress.
*
- * @since 2.8.0
- * @param string $hook The name of the WordPress filter that is being registered.
- * @param object $component A reference to the instance of the object on which the filter is defined.
- * @param string $callback The name of the function definition on the $component.
- * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
- * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
+ * @param string $hook The name of the WordPress filter that is being registered.
+ * @param object $component A reference to the instance of the object on which the filter is defined.
+ * @param string $callback The name of the function definition on the `$component`.
+ * @param int $priority (optional) The priority at which the function should be fired. Default is 10.
+ * @param int $accepted_args (optional) The number of arguments that should be passed to the $callback. Default is 1.
+ *
+ * @since 2.8.0
*/
public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
@@ -81,15 +87,16 @@ class Footnotes_Loader {
* A utility function that is used to register the actions and hooks into a single
* collection.
*
- * @since 2.8.0
- * @access private
- * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
- * @param string $hook The name of the WordPress filter that is being registered.
- * @param object $component A reference to the instance of the object on which the filter is defined.
- * @param string $callback The name of the function definition on the $component.
- * @param int $priority The priority at which the function should be fired.
- * @param int $accepted_args The number of arguments that should be passed to the $callback.
- * @return array The collection of actions and filters registered with WordPress.
+ * @access private
+ * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
+ * @param string $hook The name of the WordPress filter that is being registered.
+ * @param object $component A reference to the instance of the object on which the filter is defined.
+ * @param string $callback The name of the function definition on the `$component`.
+ * @param int $priority The priority at which the function should be fired.
+ * @param int $accepted_args The number of arguments that should be passed to the `$callback`.
+ * @return array The collection of actions and filters registered with WordPress.
+ *
+ * @since 2.8.0
*/
private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
@@ -106,9 +113,9 @@ class Footnotes_Loader {
}
/**
- * Register the filters and actions with WordPress.
+ * Registers the filters and actions with WordPress.
*
- * @since 2.8.0
+ * @since 2.8.0
*/
public function run() {
diff --git a/src/includes/class-footnotes-settings.php b/src/includes/class-footnotes-settings.php
index ffe818d..02189ec 100644
--- a/src/includes/class-footnotes-settings.php
+++ b/src/includes/class-footnotes-settings.php
@@ -4,96 +4,103 @@
*
* The constants are ordered by ascending version so their docblocks can replace most of this list.
*
- * @since 1.5.0
- * @since 2.0.0 Update: **symbol for backlinks** removed; hyperlink moved to the reference number.
- * @since 2.0.4 Update: Restore arrow settings to customize or disable the now prepended arrow symbol, thanks to @mmallett issue report.
- * @since 2.0.7 BUGFIX: Hooks: Default-disable 'the_post', thanks to @spaceling @markcheret @nyamachi @whichgodsaves @spiralofhope2 @mmallett @andreasra @widecast @ymorin007 @tashi1es bug reports.
- * @since 2.1.3 Bugfix: Hooks: disable the_excerpt hook by default to fix issues, thanks to @nikelaos bug report.
+ * @package footnotes
+ * @subpackage includes
*
- * @package footnotes
- * @subpackage includes
+ * @since 1.5.0
+ * @since 2.8.0 Rename file from `settings.php` to `class-footnotes-settings.php`.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-footnotes-convert.php';
/**
- * Loads the settings values, sets to default values if undefined.
+ * Class defining configurable plugin settings.
*
- * @since 1.5.0
+ * @since 1.5.0
*/
class Footnotes_Settings {
/**
* Settings container key for the label of the reference container.
*
- * @since 1.5.0
- * @var str
+ * @var str
+ *
+ * @since 1.5.0
*/
const C_STR_REFERENCE_CONTAINER_NAME = 'footnote_inputfield_references_label';
/**
* Settings container key to collapse the reference container by default.
*
- * @since 1.5.0
- * @var str
* The string is converted to Boolean false if 'no', true if 'yes'.
- * @see Footnotes_Convert::to_bool()
+ *
+ * @var str
+ *
+ * @since 1.5.0
+ * @todo Refactor to use sane typing.
*/
const C_STR_REFERENCE_CONTAINER_COLLAPSE = 'footnote_inputfield_collapse_references';
/**
* Settings container key for the position of the reference container.
*
- * @since 1.5.0
- * @var str
+ * @var str
+ *
+ * @since 1.5.0
*/
const C_STR_REFERENCE_CONTAINER_POSITION = 'footnote_inputfield_reference_container_place';
/**
* Settings container key for combining identical footnotes.
*
- * @since 1.5.0
- * @var str
+ * @var str
+ *
+ * @since 1.5.0
*/
const C_STR_COMBINE_IDENTICAL_FOOTNOTES = 'footnote_inputfield_combine_identical';
/**
- * Settings container key for the short code of the footnote’s start.
+ * Settings container key for the short code of the footnote's start.
*
- * @since 1.5.0
- * @var str
+ * @var str
+ *
+ * @since 1.5.0
*/
const C_STR_FOOTNOTES_SHORT_CODE_START = 'footnote_inputfield_placeholder_start';
/**
- * Settings container key for the short code of the footnote’s end.
+ * Settings container key for the short code of the footnote's end.
*
- * @since 1.5.0
- * @var str
+ * @var str
+ *
+ * @since 1.5.0
*/
const C_STR_FOOTNOTES_SHORT_CODE_END = 'footnote_inputfield_placeholder_end';
/**
* Settings container key for the user-defined short code of the footnotes start.
*
- * @since 1.5.0
- * @var str
+ * @var str
+ *
+ * @since 1.5.0
*/
const C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED = 'footnote_inputfield_placeholder_start_user_defined';
/**
* Settings container key for the user-defined short code of the footnotes end.
*
- * @since 1.5.0
- * @var str
+ * @var str
+ *
+ * @since 1.5.0
*/
const C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED = 'footnote_inputfield_placeholder_end_user_defined';
/**
* Settings container key for the counter style of the footnotes.
*
- * @since 1.5.0
- * @var str
+ * @var str
+ *
+ * @since 1.5.0
*/
const C_STR_FOOTNOTES_COUNTER_STYLE = 'footnote_inputfield_counter_style';
diff --git a/src/includes/class-footnotes-template.php b/src/includes/class-footnotes-template.php
index 874fafd..9e20f5a 100644
--- a/src/includes/class-footnotes-template.php
+++ b/src/includes/class-footnotes-template.php
@@ -1,97 +1,93 @@
plugin_directory = plugin_dir_path( dirname( __FILE__ ) );
-
- /**
- * Modularize functions.
- *
- * @since 2.4.0d3
- */
+
$template = $this->get_template( $p_str_file_type, $p_str_file_name, $p_str_extension );
if ( $template ) {
$this->process_template( $template );
@@ -104,9 +100,11 @@ class Footnotes_Template {
/**
* Replace all placeholders specified in array.
*
+ * @param array $p_arr_placeholders Placeholders (key = placeholder, value = value).
+ * @return bool `true` on Success, `false` if placeholders invalid.
+ *
* @since 1.5.0
- * @param array $p_arr_placeholders Placeholders (key = placeholder, value = value).
- * @return bool True on Success, False if Placeholders invalid.
+ * @todo Refactor templating.
*/
public function replace( $p_arr_placeholders ) {
// No placeholders set.
@@ -129,6 +127,7 @@ class Footnotes_Template {
* Reloads the original content of the template file.
*
* @since 1.5.0
+ * @todo Refactor templating.
*/
public function reload() {
$this->a_str_replaced_content = $this->a_str_original_content;
@@ -137,8 +136,10 @@ class Footnotes_Template {
/**
* Returns the content of the template file with replaced placeholders.
*
+ * @return string Template content with replaced placeholders.
+ *
* @since 1.5.0
- * @return string Template content with replaced placeholders.
+ * @todo Refactor templating.
*/
public function get_content() {
return $this->a_str_replaced_content;
@@ -147,16 +148,11 @@ class Footnotes_Template {
/**
* Process template file.
*
- * @since 2.4.0d3
+ * @param string $template The template to be processed.
+ * @return void
*
- * @param string $template The template to be processed.
- * @return void
- *
- * @since 2.0.3 Replace tab with a space.
- * @since 2.0.3 Replace 2 spaces with 1.
- * @since 2.0.4 Collapse multiple spaces.
- * @since 2.2.6 Delete a space before a closing pointy bracket.
- * @since 2.5.4 Collapse HTML comments and PHP/JS docblocks (only).
+ * @since 2.4.0d3
+ * @todo Refactor templating.
*/
public function process_template( $template ) {
// phpcs:disable WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
@@ -174,18 +170,13 @@ class Footnotes_Template {
/**
* Get the template.
*
- * - Adding: Templates: Enable template location stack, thanks to @misfist issue report and code contribution.
+ * @param string $p_str_file_type The file type of the template.
+ * @param string $p_str_file_name The file name of the template.
+ * @param string $p_str_extension The file extension of the template.
+ * @return mixed `false` or the template path
*
- * @since 2.4.0d3 Contribution.
- * @since 2.5.0 Release.
- *
- * @contributor @misfist
- * @link https://wordpress.org/support/topic/template-override-filter/#post-13864301
- *
- * @param string $p_str_file_type The file type of the template.
- * @param string $p_str_file_name The file name of the template.
- * @param string $p_str_extension The file extension of the template.
- * @return mixed false | template path
+ * @since 2.5.0
+ * @todo Refactor templating.
*/
public function get_template( $p_str_file_type, $p_str_file_name, $p_str_extension = 'html' ) {
$located = false;
@@ -197,6 +188,8 @@ class Footnotes_Template {
* add_filter( 'footnotes_template_directory', function( $directory ) {
* return 'template_parts/footnotes/';
* } );
+ *
+ * @todo Review.
*/
$template_directory = apply_filters( '', 'footnotes/' );
$custom_directory = apply_filters( 'footnotes_custom_template_directory', 'footnotes-custom/' );
diff --git a/src/includes/class-footnotes.php b/src/includes/class-footnotes.php
index 02d7590..313018b 100644
--- a/src/includes/class-footnotes.php
+++ b/src/includes/class-footnotes.php
@@ -1,66 +1,69 @@
loader->run();
}
/**
- * The name of the plugin used to uniquely identify it within the context of
- * WordPress and to define internationalization functionality.
+ * Gets the name of the plugin used to uniquely identify it within the
+ * context of WordPress and to define internationalization functionality.
*
- * @since 1.0.0
- * @return string The name of the plugin.
+ * @return string The name of the plugin.
+ *
+ * @since 2.8.0
*/
public function get_plugin_name() {
return $this->plugin_name;
}
/**
- * The reference to the class that orchestrates the hooks with the plugin.
+ * Returns a reference to the class that orchestrates the hooks with the plugin.
*
- * @since 1.0.0
- * @return Footnotes_Loader Orchestrates the hooks of the plugin.
+ * @return Footnotes_Loader Orchestrates the hooks of the plugin.
+ *
+ * @since 2.8.0
*/
public function get_loader() {
return $this->loader;
}
/**
- * Retrieve the version number of the plugin.
+ * Gets the version number of the plugin.
*
- * @since 1.0.0
- * @return string The version number of the plugin.
+ * @return string The version number of the plugin.
+ *
+ * @since 2.8.0
*/
public function get_version() {
return $this->version;
From 7ad975c3896759f09a54aa6ffe773c1110a7740d Mon Sep 17 00:00:00 2001
From: Rumperuu
Date: Fri, 30 Apr 2021 18:03:15 +0100
Subject: [PATCH 54/99] docs: update docblocks
---
src/admin/class-footnotes-admin.php | 66 +-
src/admin/class-footnotes-wysiwyg.php | 52 +-
.../layout/class-footnotes-layout-engine.php | 330 +++---
.../layout/class-footnotes-layout-init.php | 65 +-
.../class-footnotes-layout-settings.php | 278 ++---
src/includes/class-footnotes-config.php | 6 +-
src/includes/class-footnotes-convert.php | 6 +-
src/includes/class-footnotes-i18n.php | 3 +-
src/includes/class-footnotes-loader.php | 2 +-
src/includes/class-footnotes-settings.php | 990 +++++++---------
src/includes/class-footnotes-template.php | 3 +-
src/includes/class-footnotes.php | 3 +-
src/public/class-footnotes-parser.php | 1037 ++++-------------
src/public/class-footnotes-public.php | 120 +-
.../widget/class-footnotes-widget-base.php | 64 +-
...s-footnotes-widget-reference-container.php | 67 +-
16 files changed, 1168 insertions(+), 1924 deletions(-)
diff --git a/src/admin/class-footnotes-admin.php b/src/admin/class-footnotes-admin.php
index 05f1ad8..2809853 100644
--- a/src/admin/class-footnotes-admin.php
+++ b/src/admin/class-footnotes-admin.php
@@ -1,56 +1,62 @@
get_sections() as $l_arr_section ) {
@@ -174,10 +215,12 @@ abstract class Footnotes_Layout_Engine {
}
/**
- * Registers all Meta boxes for a sub page.
+ * Registers all Meta boxes for a sub-page.
*
- * @since 1.5.0
- * @param string $p_str_parent_id Parent section unique id.
+ * @access private
+ * @param string $p_str_parent_id Parent section unique ID.
+ *
+ * @since 1.5.0
*/
private function register_meta_boxes( $p_str_parent_id ) {
// Iterate through each meta box.
@@ -196,12 +239,14 @@ abstract class Footnotes_Layout_Engine {
}
/**
- * Append javascript and css files for specific sub page.
+ * Append JavaScript and CSS files for specific sub-page.
+ *
+ * @access private
*
* @since 1.5.0
+ * @todo Move to {@see Footnotes_Admin}.
*/
private function append_scripts() {
- // TODO: Move to `Footnotes_Admin`.
wp_enqueue_script( 'postbox' );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker' );
@@ -209,15 +254,14 @@ abstract class Footnotes_Layout_Engine {
// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
/**
- * Displays the content of specific sub page.
+ * Displays the content of specific sub-page.
*
* @since 1.5.0
+ * @todo Review nonce verification.
*/
public function display_content() {
$this->append_scripts();
- // TODO: add nonce verification.
-
// Get the current section.
reset( $this->a_arr_sections );
$l_str_active_section_id = isset( $_GET['t'] ) ? wp_unslash( $_GET['t'] ) : key( $this->a_arr_sections );
@@ -276,14 +320,17 @@ abstract class Footnotes_Layout_Engine {
echo '});';
echo '';
}
- // phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
+ // phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
/**
- * Save all Plugin settings.
+ * Save all plugin settings.
*
- * @since 1.5.0
- * @return bool
+ * @access private
+ * @return bool `true` on save success, else `false`.
+ *
+ * @since 1.5.0
+ * @todo Review nonce verification.
*/
private function save_settings() {
$l_arr_new_settings = array();
@@ -309,35 +356,31 @@ abstract class Footnotes_Layout_Engine {
// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
/**
- * Output the Description of a section. May be overwritten in any section.
+ * Output the description of a section. May be overwritten in any section.
*
- * @since 1.5.0
+ * @since 1.5.0
+ * @todo Required? Should be `abstract`?
*/
public function description() {
// Default no description will be displayed.
}
/**
- * Loads specific setting and returns an array with the keys [id, name, value].
+ * Loads a specified setting.
*
- * @since 1.5.0
- * @param string $p_str_setting_key_name Settings Array key name.
- * @return array Contains Settings ID, Settings Name and Settings Value.
+ * @access protected
+ * @param string $p_str_setting_key_name Setting key.
+ * @return array {
+ * A configurable setting.
*
- * @since 2.5.11 Remove escapement function.
- * When refactoring the codebase after 2.5.8, all and every output was escaped.
- * After noticing that the plugin was broken, all escapement functions were removed.
- * @link https://github.com/markcheret/footnotes/pull/50/commits/25c3f2f12eb5de1079e9215bf624ec4289b095a5
- * @link https://github.com/markcheret/footnotes/pull/50#issuecomment-787624123
- * In that process, this instance of esc_attr() was removed too, so the plugin was
- * broken again.
- * @link https://github.com/markcheret/footnotes/pull/50/commits/25c3f2f12eb5de1079e9215bf624ec4289b095a5#diff-a8ed6e859c32a18fc10bbbad3b4dd8ce7f43f2378d29471c7638e314ab30f1bdL349-L354
+ * @type string $id Setting key.
+ * @type string $name Setting name.
+ * @type string $value Setting value.
+ * }
*
- * @since 2.5.15 To fix it, the data was escaped in add_select_box() instead.
- * @since 2.6.1 Restore esc_attr() in load_setting().
- * @see add_select_box()
- * This is the only instance of esc_|kses|sanitize in the pre-2.5.11 codebase.
- * Removing this did not fix the quotation mark backslash escapement bug.
+ * @since 1.5.0
+ * @since 2.5.11 Broken due to accidental removal of `esc_attr()` call.
+ * @since 2.6.1 Restore `esc_attr()` call.
*/
protected function load_setting( $p_str_setting_key_name ) {
// Get current section.
@@ -348,45 +391,31 @@ abstract class Footnotes_Layout_Engine {
$p_arr_return['value'] = esc_attr( Footnotes_Settings::instance()->get( $p_str_setting_key_name ) );
return $p_arr_return;
}
-
+
/**
- * Returns a line break to start a new line.
+ * Returns a simple text inside HTML `` element.
+ *
+ * @access protected
+ * @param string $p_str_text Message to be surrounded with `` tags.
+ * @return string
*
* @since 1.5.0
- * @return string
- */
- protected function add_newline() {
- return ' ';
- }
-
- /**
- * Returns a line break to have a space between two lines.
- *
- * @since 1.5.0
- * @return string
- */
- protected function add_line_space() {
- return '
';
- }
-
- /**
- * Returns a simple text inside html text.
- *
- * @since 1.5.0
- * @param string $p_str_text Message to be surrounded with simple html tag (span).
- * @return string
+ * @todo Refactor HTML generation.
*/
protected function add_text( $p_str_text ) {
return sprintf( '%s', $p_str_text );
}
/**
- * Returns the html tag for an input/select label.
+ * Returns the HTML tag for an ``/`
|
]*>)#' );
@@ -2048,11 +1549,7 @@ class Footnotes_Parser {
$l_str_tooltip_content = '';
}
- /**
- * Determine shrink width if alternative tooltips are enabled.
- *
- * @since 2.5.6
- */
+ // Determine shrink width if alternative tooltips are enabled.
$l_str_tooltip_style = '';
if ( Footnotes_Public::$a_bool_alternative_tooltips_enabled && Footnotes_Public::$a_bool_tooltips_enabled ) {
$l_int_tooltip_length = strlen( wp_strip_all_tags( $l_str_tooltip_content ) );
@@ -2125,29 +1622,10 @@ class Footnotes_Parser {
$l_int_footnote_index++;
}
- /**
+ /*
* Fixes a partial footnotes process outage happening when tooltips are truncated or disabled.
* Fixed a footnotes numbering bug happening under de facto rare circumstances.
*
- * - Bugfix: Fixed occasional bug where footnote ordering could be out of sequence
- *
- * @since 1.6.4
- * @committer @dartiss
- * @link https://plugins.trac.wordpress.org/browser/footnotes/trunk/class/task.php?rev=1445718 @dartiss’ class/task.php
- * @link https://plugins.trac.wordpress.org/log/footnotes/trunk/class/task.php?rev=1445718 @dartiss re-added class/task.php
- * @link https://plugins.trac.wordpress.org/browser/footnotes/trunk/class?rev=1445711 class/ w/o task.php
- * @link https://plugins.trac.wordpress.org/changeset/1445711/footnotes/trunk/class @dartiss deleted class/task.php
- * @link https://plugins.trac.wordpress.org/browser/footnotes/trunk/class/task.php?rev=1026210 @aricura’s latest class/task.php
- *
- * - Bugfix: Process: fix numbering bug impacting footnote #2 with footnote #1 close to start, thanks to @rumperuu bug report, thanks to @lolzim code contribution.
- *
- * @reporter @rumperuu
- * @link https://wordpress.org/support/topic/footnotes-numbered-incorrectly/
- *
- * @contributor @lolzim
- * @link https://wordpress.org/support/topic/footnotes-numbered-incorrectly/#post-14062032
- *
- * @since 2.5.5
* This assignment was overridden by another one, causing the algorithm to jump back
* near the post start to a position calculated as the sum of the length of the last
* footnote and the length of the last footnote replace text.
@@ -2157,18 +1635,6 @@ class Footnotes_Parser {
* Deleting both lines instead, to resume the search at the position where it left off,
* would have prevented also the following bug.
*
- * - Bugfix: Process: fix issue that caused some footnotes to not be processed, thanks to @docteurfitness @rkupadhya @offpeakdesign bug reports.
- *
- * @reporter @docteurfitness
- * @link https://wordpress.org/support/topic/problem-since-footnotes-2-5-14/
- *
- * @reporter @rkupadhya
- * @link https://wordpress.org/support/topic/adjacent-footnotes-not-working-sometimes/
- *
- * @reporter @offpeakdesign
- * @link https://wordpress.org/support/topic/character-limit-bug/
- *
- * @since 2.6.6
* The origin of the bug was present since the beginning (v1.0.0).
* For v1.3.2 the wrong code was refactored but remained wrong,
* and was unaffected by the v1.5.0 refactoring.
@@ -2190,15 +1656,9 @@ class Footnotes_Parser {
/**
* Generates the reference container.
*
- * @since 1.5.0
- * @return string
+ * @since 1.5.0
*
- * @since 2.0.0 Update: remove backlink symbol along with column 2 of the reference container
- * @since 2.0.3 Bugfix: prepend an arrow on user request
- * @since 2.0.6 Bugfix: Reference container: fix line breaking behavior in footnote number clusters.
- * @since 2.0.4 Bugfix: restore the arrow select and backlink symbol input settings
- * @since 2.1.1 Bugfix: Referrers, reference container: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report.
- * @since 2.1.1 Bugfix: Reference container: Backlink symbol: make optional, not suggest configuring it to invisible, thanks to @spaceling feedback.
+ * @return string
*/
public function reference_container() {
@@ -2207,16 +1667,10 @@ class Footnotes_Parser {
return '';
}
- /**
+ /*
* Footnote index backlink symbol.
- *
- * - Bugfix: Reference container: Backlink symbol: make optional, not suggest configuring it to invisible, thanks to @spaceling feedback.
- *
- * @reporter @spaceling
- * @link https://wordpress.org/support/topic/change-the-position-5/page/2/#post-13671138
- *
- * @since 2.1.1
*/
+
// If the backlink symbol is enabled.
if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE ) ) ) {
@@ -2244,18 +1698,9 @@ class Footnotes_Parser {
}
- /**
+ /*
* Backlink separator.
*
- * - Bugfix: Reference container: make separating and terminating punctuation optional and configurable, thanks to @docteurfitness issue report and code contribution.
- *
- * @reporter @docteurfitness
- * @link https://wordpress.org/support/topic/update-2-1-3/
- *
- * @contributor @docteurfitness
- * @link https://wordpress.org/support/topic/update-2-1-3/#post-13704194
- *
- * @since 2.1.4
* Initially an appended comma was hard-coded in this algorithm for enumerations.
* The comma in enumerations is not universally preferred.
*/
@@ -2285,14 +1730,10 @@ class Footnotes_Parser {
$l_str_separator = '';
}
- /**
+ /*
* Backlink terminator.
*
* Initially a dot was appended in the table row template.
- *
- * @since 2.0.6 a dot after footnote numbers is discarded as not localizable;
- * making it optional was envisaged.
- * @since 2.1.4 the terminator is optional, has options, and is configurable.
*/
if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_ENABLED ) ) ) {
@@ -2320,13 +1761,9 @@ class Footnotes_Parser {
$l_str_terminator = '';
}
- /**
+ /*
* Line breaks.
*
- * - Bugfix: Reference container: Backlinks: fix stacked enumerations by adding optional line breaks.
- *
- * @since 2.1.4
- *
* The backlinks of combined footnotes are generally preferred in an enumeration.
* But when few footnotes are identical, stacking the items in list form is better.
* Variable number length and proportional character width require explicit line breaks.
@@ -2334,7 +1771,7 @@ class Footnotes_Parser {
*/
$l_str_line_break = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED ) ) ? ' ' : ' ';
- /**
+ /*
* Line breaks for source readability.
*
* For maintenance and support, table rows in the reference container should be
@@ -2343,12 +1780,8 @@ class Footnotes_Parser {
*/
$l_str_body = "\r\n\r\n";
- /**
+ /*
* Reference container table row template load.
- *
- * - Bugfix: Reference container: option to restore pre-2.0.0 layout with the backlink symbol in an extra column.
- *
- * @since 2.1.1
*/
$l_bool_combine_identical_footnotes = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_COMBINE_IDENTICAL_FOOTNOTES ) );
@@ -2411,20 +1844,8 @@ class Footnotes_Parser {
}
}
- /**
+ /*
* Switch backlink symbol and footnote number.
- *
- * - Bugfix: Reference container: option to append symbol (prepended by default), thanks to @spaceling code contribution.
- *
- * @since 2.1.1
- *
- * @contributor @spaceling
- * @link https://wordpress.org/support/topic/change-the-position-5/#post-13615994
- *
- *
- * - Bugfix: Reference container: Backlink symbol: support for appending when combining identicals is on.
- *
- * @since 2.1.4
*/
$l_bool_symbol_switch = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) );
@@ -2458,18 +1879,14 @@ class Footnotes_Parser {
if ( self::$a_bool_hard_links_enabled ) {
- /**
+ /*
* Use-Backbutton-Hint tooltip, optional and configurable.
*
- * - Update: Reference container: Hard backlinks (optional): optional configurable tooltip hinting to use the backbutton instead, thanks to @theroninjedi47 bug report.
- *
- * @reporter @theroninjedi47
- * @link https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/
- *
- * @since 2.5.4
* When hard links are enabled, clicks on the backlinks are logged in the browsing history.
* This tooltip hints to use the backbutton instead, so the history gets streamlined again.
* @link https://wordpress.org/support/topic/making-it-amp-compatible/#post-13837359
+ *
+ * @since 2.5.4
*/
if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE ) ) ) {
$l_str_use_backbutton_hint = ' title="';
@@ -2505,19 +1922,16 @@ class Footnotes_Parser {
$l_str_footnote_anchor_element = '';
}
- /**
+ /*
* Support for combining identicals: compose enumerated backlinks.
*
- * - Bugfix: Referrers, reference container: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report.
- *
- * @reporter @happyches
- * @link https://wordpress.org/support/topic/custom-css-for-jumbled-references/
- *
- * @since 2.1.1
* Prepare to have single footnotes, where the click event and
* optional hard link need to be set to cover the table cell,
* for better usability and UX.
+ *
+ * @since 2.1.1
*/
+
// Set a flag to check for the combined status of a footnote item.
$l_bool_flag_combined = false;
@@ -2546,7 +1960,7 @@ class Footnotes_Parser {
/*
* The click event goes in the table cell if footnote remains single.
*/
- // Reverted wrong linting.
+
$l_str_backlink_event = ' onclick="footnote_moveToAnchor_';
$l_str_backlink_event .= self::$a_int_post_id;
@@ -2721,14 +2135,9 @@ class Footnotes_Parser {
// Streamline.
$l_bool_collapse_default = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) );
- /**
+ /*
* Reference container label.
*
- * - Bugfix: Reference container: Label: set empty label to U+202F NNBSP for more robustness, thanks to @lukashuggenberg feedback.
- *
- * @reporter @lukashuggenberg
- *
- * @since 2.4.0
* Themes may drop-cap a first letter of initial paragraphs, like this label.
* In case of empty label that would apply to the left half button character.
* Hence the point in setting an empty label to U+202F NARROW NO-BREAK SPACE.
diff --git a/src/public/class-footnotes-public.php b/src/public/class-footnotes-public.php
index 7df55d1..c169c00 100644
--- a/src/public/class-footnotes-public.php
+++ b/src/public/class-footnotes-public.php
@@ -2,101 +2,106 @@
/**
* The public-facing functionality of the plugin.
*
- * @since 2.8.0
- *
- * @package footnotes
- * @subpackage public
+ * @package footnotes\public
+ * @since 2.8.0
*/
/**
- * The public-facing functionality of the plugin.
+ * Class provide all admin-specific functionality of the plugin.
*
* Defines the plugin name, version, and enqueues all public-facing stylesheets
* and JavaScript.
*
- * @package footnotes
- * @subpackage public
+ * @package footnotes\public
+ * @since 2.8.0
*/
class Footnotes_Public {
/**
* The ID of this plugin.
*
- * @since 2.8.0
- * @access private
- * @var string $plugin_name The ID of this plugin.
+ * @since 2.8.0
+
+ * @access private
+ * @var string $plugin_name The ID of this plugin.
*/
private $plugin_name;
/**
* The version of this plugin.
*
- * @since 2.8.0
- * @access private
- * @var string $version The current version of this plugin.
+ * @since 2.8.0
+
+ * @access private
+ * @var string $version The current version of this plugin.
*/
private $version;
/**
* The reference container widget.
*
- * @since 2.8.0
- * @var Footnotes_Widget_Reference_Container $reference_container_widget The reference container widget
+ * @since 2.8.0
+ *
+ * @var Footnotes_Widget_Reference_Container $reference_container_widget The reference container widget
*/
private $reference_container_widget;
/**
* The footnote parser.
*
- * @since 1.5.0
- * @since 2.8.0 Moved from `Footnotes` to `Footnotes_Public` class.
- * @var Footnote_Parser $task The Plugin task.
+ * @since 1.5.0
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
+ *
+ * @var Footnotes_Parser $task The Plugin task.
*/
public $a_obj_task = null;
/**
* Flag for using tooltips.
*
- * @since 2.4.0
- * @since 2.8.0 Moved from `Footnotes` to `Footnotes_Public` class.
- * @var bool $tooltips_enabled Whether tooltips are enabled or not.
+ * @since 2.4.0
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
+ *
+ * @var bool $tooltips_enabled Whether tooltips are enabled or not.
*/
public static $a_bool_tooltips_enabled = false;
/**
* Allows to determine whether alternative tooltips are enabled.
*
- * @since 2.1.1
- * @since 2.8.0 Moved from `Footnotes` to `Footnotes_Public` class.
- * @var bool
+ * @since 2.1.1
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
+ *
+ * @var bool
*/
public static $a_bool_alternative_tooltips_enabled = false;
/**
* Allows to determine whether AMP compatibility mode is enabled.
*
- * @since 2.6.0 (release)
- * @since 2.8.0 Moved from `Footnotes` to `Footnotes_Public` class.
- * @var bool
+ * @since 2.6.0
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
+ *
+ * @var bool
*/
public static $a_bool_amp_enabled = false;
/**
* Allows to determine the script mode among jQuery or plain JS.
*
- * @since 2.5.6
- * @since 2.8.0 Moved from `Footnotes` to `Footnotes_Public` class.
- * @var str 'js' Plain JavaScript.
- * 'jquery' Use jQuery libraries.
+ * @since 2.5.6
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
+ *
+ * @var string ‘js’ to use plain JavaScript, ‘jquery’ to use jQuery.
*/
public static $a_str_script_mode = 'js';
/**
* Initialize the class and set its properties.
*
- * @since 2.8.0
- * @param string $plugin_name The name of this plugin.
- * @param string $version The version of this plugin.
+ * @since 2.8.0
+ * @param string $plugin_name The name of this plugin.
+ * @param string $version The version of this plugin.
*/
public function __construct( $plugin_name, $version ) {
@@ -118,11 +123,10 @@ class Footnotes_Public {
* Include the following files that provide the public-facing functionality
* of this plugin:
*
- * - `Footnotes_Parser`. Parses Posts and Pages for footnote shortcodes.
- * - `Footnotes_Widget_Reference_Container`. Defines the Reference Container widget.
+ * - {@see Footnotes_Parser}: parses Posts and Pages for footnote shortcodes; and
+ * - {@see Footnotes_Widget_Reference_Container}: defines the Reference Container widget.
*
- * @since 2.8.0
- * @access private
+ * @since 2.8.0
*/
private function load_dependencies() {
// TODO: neaten up and document once placements and names are settled.
@@ -141,12 +145,12 @@ class Footnotes_Public {
/**
* Register the stylesheets for the public-facing side of the site.
*
- * Enables enqueuing the formatted individual stylesheets if `PRODCUTION_ENV`
- * is true (set in `footnotes.php`).
+ * Enables enqueuing the formatted individual stylesheets if {@see PRODUCTION_ENV}
+ * is `true`.
*
- * @since 1.5.0
- * @since 2.5.5 Change stylesheet scheme.
- * @since 2.8.0 Moved from `Footnotes` to `Footnotes_Public` class.
+ * @since 1.5.0
+ * @since 2.5.5 Change stylesheet schema.
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
*/
public function enqueue_styles() {
if ( PRODUCTION_ENV ) {
@@ -207,22 +211,20 @@ class Footnotes_Public {
/**
* Register the JavaScript for the public-facing side of the site.
*
- * @since 1.5.0
- * @since 2.0.0 Add jQueryUI dependency.
- * @since 2.1.2 Add jQuery Tools dependency.
- * @since 2.5.6 Add jQuery dependency.
- * @since 2.8.0 Moved from `Footnotes` to `Footnotes_Public` class.
+ * @since 1.5.0
+ * @since 2.0.0 Add jQueryUI dependency.
+ * @since 2.1.2 Add jQuery Tools dependency.
+ * @since 2.5.6 Add jQuery dependency.
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
*/
public function enqueue_scripts() {
- /**
+ /*
* Enqueues the jQuery library registered by WordPress.
*
* As jQuery is also used for animated scrolling, it was loaded by default.
* The function `wp_enqueue_script()` avoids loading the same library multiple times.
* After adding the alternative reference container, jQuery has become optional,
* but still enabled by default.
- *
- * @since 2.5.6
*/
if ( ! self::$a_bool_amp_enabled ) {
@@ -233,24 +235,20 @@ class Footnotes_Public {
}
if ( self::$a_bool_tooltips_enabled && ! self::$a_bool_alternative_tooltips_enabled ) {
- /**
+ /*
* Enqueues the jQuery Tools library shipped with the plugin.
*
- * Redacted jQuery.browser, completed minification;
+ * Redacted `jQuery.browser`, completed minification;
* see full header in `public/js/jquery.tools.js`.
- * No '-js' in the handle, is appended automatically.
+ * No ‘-js’ in the handle, is appended automatically.
* Deferring to the footer breaks jQuery tooltip display.
- *
- * @since 2.1.2
*/
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/jquery.tools' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.js', array(), '1.2.7.redacted.2', false );
- /**
+ /*
* Enqueues some jQuery UI libraries registered by WordPress.
*
* If alternative tooltips are enabled, these libraries are not needed.
- *
- * @since 2.0.0
*/
wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-ui-widget' );
@@ -265,8 +263,8 @@ class Footnotes_Public {
/**
* Register the widget(s) for the public-facing side of the site.
*
- * @since 1.5.0
- * @since 2.8.0 Moved to `Footnotes_Public` class.
+ * @since 1.5.0
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
*/
public function register_widgets() {
register_widget( $this->reference_container_widget );
diff --git a/src/public/widget/class-footnotes-widget-base.php b/src/public/widget/class-footnotes-widget-base.php
index e7b8e63..584d6b8 100644
--- a/src/public/widget/class-footnotes-widget-base.php
+++ b/src/public/widget/class-footnotes-widget-base.php
@@ -1,73 +1,74 @@
echo the Widget Content
- * **public function form($instance)** -> echo the Settings of the Widget
+ * Base class to be extended by all widget sub-classes.
*
- * @author Stefan Herndler
- * @since 1.5.0
+ * Any sub-class must override the appropriate method(s) provided by
+ * {@link https://developer.wordpress.org/reference/classes/wp_widget/#description `WP_Widget`}.
*
- * @package footnotes
- * @subpackage public_widget
+ * @abstract
+ *
+ * @package footnotes\public\widget
+ * @since 1.5.0
+ * @todo Review implemenation of Widgets API.
*/
abstract class Footnotes_Widget_Base extends WP_Widget {
/**
* Returns an unique ID as string used for the Widget Base ID.
*
- * @since 1.5.0
- * @return string
+ * @abstract
+ * @since 1.5.0
+ *
+ * @return string
*/
abstract protected function get_id();
/**
* Returns the Public name of child Widget to be displayed in the Configuration page.
*
- * @since 1.5.0
- * @return string
+ * @abstract
+ * @since 1.5.0
+ *
+ * @return string
*/
abstract protected function get_name();
/**
* Returns the Description of the child widget.
*
- * @since 1.5.0
- * @return string
+ * @abstract
+ * @since 1.5.0
+ *
+ * @return string
*/
abstract protected function get_description();
/**
* Returns the width of the Widget. Default width is 250 pixel.
*
- * @since 1.5.0
- * @return int
+ * @since 1.5.0
+ *
+ * @return int
*/
protected function get_widget_width() {
return 250;
}
-
+
/**
- * Class Constructor. Registers the child Widget to WordPress.
+ * Registers the child Widget to WordPress.
*
- * @since 1.5.0
- *
- * - Update: replace deprecated function WP_Widget() with recommended __construct(), thanks to @dartiss code contribution.
- *
- * @since 1.6.4
- * @contributor @dartiss
- * @link https://plugins.trac.wordpress.org/browser/footnotes/trunk/class/widgets/base.php?rev=1445720
- * “The called constructor method for WP_Widget in Footnotes_Widget_ReferenceContainer is deprecated since version 4.3.0! Use __construct() instead.”
+ * @since 1.5.0
*/
public function __construct() {
$l_arr_widget_options = array(
@@ -86,4 +87,5 @@ abstract class Footnotes_Widget_Base extends WP_Widget {
$l_arr_control_options // Optional Widget Control Options.
);
}
+
}
diff --git a/src/public/widget/class-footnotes-widget-reference-container.php b/src/public/widget/class-footnotes-widget-reference-container.php
index faf6216..d4bd527 100644
--- a/src/public/widget/class-footnotes-widget-reference-container.php
+++ b/src/public/widget/class-footnotes-widget-reference-container.php
@@ -1,11 +1,13 @@
plugin_name;
@@ -63,34 +71,35 @@ class Footnotes_Widget_Reference_Container extends Footnotes_Widget_Base {
/**
* Returns the Description of the child widget.
*
- * @since 1.5.0
- * @return string
+ * @see Footnotes_Widget_Base::get_description()
+ * @since 1.5.0
*
- * Edit: curly quotes 2.2.0
+ * @return string
*/
protected function get_description() {
- return __( 'The widget defines the position of the reference container if set to “widget area”.', 'footnotes' );
+ return __( 'The widget defines the position of the reference container if set to “widget area”.', 'footnotes' );
}
/**
* Outputs the Settings of the Widget.
*
- * @since 1.5.0
- * @param mixed $instance The instance of the widget.
- * @return void
+ * @link https://developer.wordpress.org/reference/classes/wp_widget/form/ `WP_Widget::form()`
+ * @since 1.5.0
*
- * Edit: curly quotes 2.2.0
+ * @param mixed $instance The instance of the widget.
*/
public function form( $instance ) {
- echo __( 'The widget defines the position of the reference container if set to “widget area”.', 'footnotes' );
+ echo __( 'The widget defines the position of the reference container if set to “widget area”.', 'footnotes' );
}
/**
* Outputs the Content of the Widget.
*
- * @since 1.5.0
- * @param mixed $args The widget's arguments.
- * @param mixed $instance The instance of the widget.
+ * @link https://developer.wordpress.org/reference/classes/wp_widget/widget/ `WP_Widget::widget()`
+ * @since 1.5.0
+ *
+ * @param mixed $args The widget's arguments.
+ * @param mixed $instance The instance of the widget.
*/
public function widget( $args, $instance ) {
global $footnotes;
From f0c6b07a84ebe482533f8f8cdddfb344935a84a7 Mon Sep 17 00:00:00 2001
From: Rumperuu
Date: Sat, 1 May 2021 19:22:41 +0100
Subject: [PATCH 55/99] chore: lint code
---
src/admin/class-footnotes-admin.php | 8 +-
src/admin/class-footnotes-wysiwyg.php | 6 +-
.../layout/class-footnotes-layout-engine.php | 60 ++++-----
.../layout/class-footnotes-layout-init.php | 8 +-
.../class-footnotes-layout-settings.php | 13 +-
src/footnotes.php | 53 ++++----
src/includes/class-footnotes-config.php | 12 +-
src/includes/class-footnotes-convert.php | 18 +--
src/includes/class-footnotes-i18n.php | 4 +-
src/includes/class-footnotes-loader.php | 34 ++---
src/includes/class-footnotes-settings.php | 81 ++++++------
src/includes/class-footnotes-template.php | 27 ++--
src/includes/class-footnotes.php | 116 ++++++++----------
src/public/class-footnotes-parser.php | 66 +++++-----
src/public/class-footnotes-public.php | 8 +-
.../widget/class-footnotes-widget-base.php | 4 +-
...s-footnotes-widget-reference-container.php | 8 +-
17 files changed, 257 insertions(+), 269 deletions(-)
diff --git a/src/admin/class-footnotes-admin.php b/src/admin/class-footnotes-admin.php
index 2809853..bfd1051 100644
--- a/src/admin/class-footnotes-admin.php
+++ b/src/admin/class-footnotes-admin.php
@@ -52,9 +52,9 @@ class Footnotes_Admin {
/**
* Initialize the class and set its properties.
-
- * @param string $plugin_name The name of this plugin.
- * @param string $version The version of this plugin.
+
+ * @param string $plugin_name The name of this plugin.
+ * @param string $version The version of this plugin.
*
* @since 2.8.0
*/
@@ -140,7 +140,7 @@ class Footnotes_Admin {
/**
* Appends the Plugin links for display in the dashboard Plugins page.
*
- * @param string[] $links The default set of links to display.
+ * @param string[] $links The default set of links to display.
* @return string[] The full set of links to display.
*
* @since 1.5.0
diff --git a/src/admin/class-footnotes-wysiwyg.php b/src/admin/class-footnotes-wysiwyg.php
index 037ec59..90e8152 100644
--- a/src/admin/class-footnotes-wysiwyg.php
+++ b/src/admin/class-footnotes-wysiwyg.php
@@ -10,7 +10,7 @@
* @package footnotes\admin
* @since 1.5.0
* @since 2.8.0 Rename file from `wysiwyg.php` to `class-footnotes-wysiwyg.php`,
- * move from `class/` sub-directory to `admin/`.
+ * move from `class/` sub-directory to `admin/`.
*/
/**
@@ -47,7 +47,7 @@ class Footnotes_WYSIWYG {
/**
* Append a new Button to the WYSIWYG editor of Posts and Pages.
*
- * @param string[] $p_arr_buttons Already-defined editor buttons.
+ * @param string[] $p_arr_buttons Already-defined editor buttons.
* @return string[]
*
* @since 1.5.0
@@ -73,7 +73,7 @@ class Footnotes_WYSIWYG {
/**
* Includes the Plugins WYSIWYG editor script.
*
- * @param string[] $p_arr_plugins Scripts to be included by the editor.
+ * @param string[] $p_arr_plugins Scripts to be included by the editor.
* @return string[]
*
* @since 1.5.0
diff --git a/src/admin/layout/class-footnotes-layout-engine.php b/src/admin/layout/class-footnotes-layout-engine.php
index 7de4d72..a9610c2 100644
--- a/src/admin/layout/class-footnotes-layout-engine.php
+++ b/src/admin/layout/class-footnotes-layout-engine.php
@@ -4,13 +4,13 @@
*
* The Admin. Layouts subpackage is composed of the {@see Footnotes_Layout_Engine}
* abstract class, which is extended by the {@see Footnotes_Layout_Settings}
- * sub-class. The subpackage is initialised at runtime by the {@see
+ * sub-class. The subpackage is initialised at runtime by the {@see
* Footnotes_Layout_Init} class.
*
* @package footnotes\admin_layout
* @since 1.5.0
* @since 2.8.0 Rename file from `layout.php` to `class-footnotes-layout-engine.php`,
- * rename `dashboard/` sub-directory to `layout/`.
+ * rename `dashboard/` sub-directory to `layout/`.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-footnotes-layout-init.php';
@@ -19,7 +19,7 @@ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-footnotes-la
* Class to be extended by page layout sub-classes.
*
* @abstract
-
+
* @package footnotes\admin_layout
* @since 1.5.0
*/
@@ -113,11 +113,11 @@ abstract class Footnotes_Layout_Engine {
* Returns an array describing a sub-page section.
*
* @access protected
- * @param string $p_str_id Unique ID suffix.
- * @param string $p_str_title Title of the section.
- * @param int $p_int_settings_container_index Settings Container index.
- * @param bool $p_bool_has_submit_button Whether a ‘Submit’ button should
- * be displayed for this section. Default `true`.
+ * @param string $p_str_id Unique ID suffix.
+ * @param string $p_str_title Title of the section.
+ * @param int $p_int_settings_container_index Settings Container index.
+ * @param bool $p_bool_has_submit_button Whether a ‘Submit’ button should
+ * be displayed for this section. Default `true`.
* @return array {
* A dashboard section.
*
@@ -143,10 +143,10 @@ abstract class Footnotes_Layout_Engine {
* Returns an array describing a meta box.
*
* @access protected
- * @param string $p_str_section_id Parent section ID.
- * @param string $p_str_id Unique ID suffix.
- * @param string $p_str_title Title for the meta box.
- * @param string $p_str_callback_function_name Class method name for callback.
+ * @param string $p_str_section_id Parent section ID.
+ * @param string $p_str_id Unique ID suffix.
+ * @param string $p_str_title Title for the meta box.
+ * @param string $p_str_callback_function_name Class method name for callback.
* @return array {
* A dashboard meta box.
*
@@ -218,7 +218,7 @@ abstract class Footnotes_Layout_Engine {
* Registers all Meta boxes for a sub-page.
*
* @access private
- * @param string $p_str_parent_id Parent section unique ID.
+ * @param string $p_str_parent_id Parent section unique ID.
*
* @since 1.5.0
*/
@@ -369,7 +369,7 @@ abstract class Footnotes_Layout_Engine {
* Loads a specified setting.
*
* @access protected
- * @param string $p_str_setting_key_name Setting key.
+ * @param string $p_str_setting_key_name Setting key.
* @return array {
* A configurable setting.
*
@@ -391,12 +391,12 @@ abstract class Footnotes_Layout_Engine {
$p_arr_return['value'] = esc_attr( Footnotes_Settings::instance()->get( $p_str_setting_key_name ) );
return $p_arr_return;
}
-
+
/**
* Returns a simple text inside HTML `` element.
*
* @access protected
- * @param string $p_str_text Message to be surrounded with `` tags.
+ * @param string $p_str_text Message to be surrounded with `` tags.
* @return string
*
* @since 1.5.0
@@ -410,8 +410,8 @@ abstract class Footnotes_Layout_Engine {
* Returns the HTML tag for an ``/`` label.
*
* @access protected
- * @param string $p_str_setting_name Settings key.
- * @param string $p_str_caption Label caption.
+ * @param string $p_str_setting_name Settings key.
+ * @param string $p_str_caption Label caption.
* @return string
*
* @since 1.5.0
@@ -440,10 +440,10 @@ abstract class Footnotes_Layout_Engine {
* Constructs the HTML for a text `` element.
*
* @access protected
- * @param string $p_str_setting_name Setting key.
- * @param int $p_str_max_length Maximum length of the input. Default length 999 chars.
- * @param bool $p_bool_readonly Set the input to be read only. Default `false`.
- * @param bool $p_bool_hidden Set the input to be hidden. Default `false`.
+ * @param string $p_str_setting_name Setting key.
+ * @param int $p_str_max_length Maximum length of the input. Default length 999 chars.
+ * @param bool $p_bool_readonly Set the input to be read only. Default `false`.
+ * @param bool $p_bool_hidden Set the input to be hidden. Default `false`.
* @return string
*
* @since 1.5.0
@@ -471,7 +471,7 @@ abstract class Footnotes_Layout_Engine {
* Constructs the HTML for a checkbox `` element.
*
* @access protected
- * @param string $p_str_setting_name Setting key.
+ * @param string $p_str_setting_name Setting key.
* @return string
*
* @since 1.5.0
@@ -492,7 +492,7 @@ abstract class Footnotes_Layout_Engine {
* Constructs the HTML for a `` element.
*
* @access protected
- * @param string $p_str_setting_name Setting key.
+ * @param string $p_str_setting_name Setting key.
* @param array $p_arr_options Possible options.
* @return string
*
@@ -528,7 +528,7 @@ abstract class Footnotes_Layout_Engine {
* Constructs the HTML for a `';
@@ -1505,7 +1498,7 @@ class Footnotes_Parser {
$l_str_footnote_link_argument .= $l_int_index;
$l_str_footnote_link_argument .= '" class="footnote_hard_link"';
- /**
+ /*
* Compose fragment ID anchor with offset, for use in reference container.
* Empty span, child of empty span, to avoid tall dotted rectangles in browser.
*/
@@ -1516,7 +1509,6 @@ class Footnotes_Parser {
$l_str_referrer_anchor_element .= '" class="footnote_referrer_anchor">';
} else {
-
/*
* Initialize hard link variables when hard links are disabled.
*
@@ -1538,6 +1530,7 @@ class Footnotes_Parser {
// Determine tooltip content.
if ( Footnotes_Public::$a_bool_tooltips_enabled ) {
$l_str_tooltip_content = $l_bool_has_tooltip_text ? $l_str_tooltip_text : $l_str_excerpt_text;
+
/*
* Ensures paragraph separation
*
@@ -1670,7 +1663,7 @@ class Footnotes_Parser {
/*
* Footnote index backlink symbol.
*/
-
+
// If the backlink symbol is enabled.
if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE ) ) ) {
@@ -1878,7 +1871,6 @@ class Footnotes_Parser {
$l_str_hard_link_address = '';
if ( self::$a_bool_hard_links_enabled ) {
-
/*
* Use-Backbutton-Hint tooltip, optional and configurable.
*
@@ -1931,7 +1923,7 @@ class Footnotes_Parser {
*
* @since 2.1.1
*/
-
+
// Set a flag to check for the combined status of a footnote item.
$l_bool_flag_combined = false;
@@ -1960,7 +1952,7 @@ class Footnotes_Parser {
/*
* The click event goes in the table cell if footnote remains single.
*/
-
+
$l_str_backlink_event = ' onclick="footnote_moveToAnchor_';
$l_str_backlink_event .= self::$a_int_post_id;
diff --git a/src/public/class-footnotes-public.php b/src/public/class-footnotes-public.php
index c169c00..90f0ba0 100644
--- a/src/public/class-footnotes-public.php
+++ b/src/public/class-footnotes-public.php
@@ -21,7 +21,7 @@ class Footnotes_Public {
* The ID of this plugin.
*
* @since 2.8.0
-
+
* @access private
* @var string $plugin_name The ID of this plugin.
*/
@@ -31,7 +31,7 @@ class Footnotes_Public {
* The version of this plugin.
*
* @since 2.8.0
-
+
* @access private
* @var string $version The current version of this plugin.
*/
@@ -100,8 +100,8 @@ class Footnotes_Public {
* Initialize the class and set its properties.
*
* @since 2.8.0
- * @param string $plugin_name The name of this plugin.
- * @param string $version The version of this plugin.
+ * @param string $plugin_name The name of this plugin.
+ * @param string $version The version of this plugin.
*/
public function __construct( $plugin_name, $version ) {
diff --git a/src/public/widget/class-footnotes-widget-base.php b/src/public/widget/class-footnotes-widget-base.php
index 584d6b8..b472674 100644
--- a/src/public/widget/class-footnotes-widget-base.php
+++ b/src/public/widget/class-footnotes-widget-base.php
@@ -64,7 +64,7 @@ abstract class Footnotes_Widget_Base extends WP_Widget {
protected function get_widget_width() {
return 250;
}
-
+
/**
* Registers the child Widget to WordPress.
*
@@ -87,5 +87,5 @@ abstract class Footnotes_Widget_Base extends WP_Widget {
$l_arr_control_options // Optional Widget Control Options.
);
}
-
+
}
diff --git a/src/public/widget/class-footnotes-widget-reference-container.php b/src/public/widget/class-footnotes-widget-reference-container.php
index d4bd527..0e94932 100644
--- a/src/public/widget/class-footnotes-widget-reference-container.php
+++ b/src/public/widget/class-footnotes-widget-reference-container.php
@@ -37,7 +37,7 @@ class Footnotes_Widget_Reference_Container extends Footnotes_Widget_Base {
*
* @since 2.8.0
*
- * @param string $plugin_name The name of this plugin.
+ * @param string $plugin_name The name of this plugin.
*/
public function __construct( $plugin_name ) {
parent::__construct();
@@ -86,7 +86,7 @@ class Footnotes_Widget_Reference_Container extends Footnotes_Widget_Base {
* @link https://developer.wordpress.org/reference/classes/wp_widget/form/ `WP_Widget::form()`
* @since 1.5.0
*
- * @param mixed $instance The instance of the widget.
+ * @param mixed $instance The instance of the widget.
*/
public function form( $instance ) {
echo __( 'The widget defines the position of the reference container if set to “widget area”.', 'footnotes' );
@@ -98,8 +98,8 @@ class Footnotes_Widget_Reference_Container extends Footnotes_Widget_Base {
* @link https://developer.wordpress.org/reference/classes/wp_widget/widget/ `WP_Widget::widget()`
* @since 1.5.0
*
- * @param mixed $args The widget's arguments.
- * @param mixed $instance The instance of the widget.
+ * @param mixed $args The widget's arguments.
+ * @param mixed $instance The instance of the widget.
*/
public function widget( $args, $instance ) {
global $footnotes;
From 6683c0b1692c4a2df42c02422cff349c5e7fa58b Mon Sep 17 00:00:00 2001
From: Rumperuu
Date: Sat, 1 May 2021 19:45:30 +0100
Subject: [PATCH 56/99] build: ignore index files
---
phpdoc.dist.xml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml
index 47acf1e..86e4e78 100644
--- a/phpdoc.dist.xml
+++ b/phpdoc.dist.xml
@@ -7,13 +7,17 @@
>
+ docs-cache
-
+ src
+
+ **/index.php
+ php
From ce41cd835319d86f9f6728e25d16df79fa6925d3 Mon Sep 17 00:00:00 2001
From: Rumperuu
Date: Sat, 1 May 2021 21:34:46 +0100
Subject: [PATCH 57/99] refactor: namespace everything
---
...ss-footnotes-admin.php => class-admin.php} | 51 +-
...ootnotes-wysiwyg.php => class-wysiwyg.php} | 26 +-
...tes-layout-engine.php => class-engine.php} | 45 +-
...otnotes-layout-init.php => class-init.php} | 37 +-
...layout-settings.php => class-settings.php} | 495 ++++++++--------
src/footnotes.php | 58 +-
src/includes/class-activator.php | 53 ++
...-footnotes-config.php => class-config.php} | 85 +--
...ootnotes-convert.php => class-convert.php} | 17 +-
.../{class-footnotes.php => class-core.php} | 103 ++--
...-deactivator.php => class-deactivator.php} | 20 +-
src/includes/class-footnotes-activator.php | 34 --
...lass-footnotes-i18n.php => class-i18n.php} | 26 +-
...-footnotes-loader.php => class-loader.php} | 8 +-
...tnotes-settings.php => class-settings.php} | 41 +-
...tnotes-template.php => class-template.php} | 10 +-
...footnotes-public.php => class-general.php} | 63 +-
...-footnotes-parser.php => class-parser.php} | 549 +++++++++---------
...otnotes-widget-base.php => class-base.php} | 19 +-
...iner.php => class-reference-container.php} | 33 +-
src/uninstall.php | 5 +-
21 files changed, 939 insertions(+), 839 deletions(-)
rename src/admin/{class-footnotes-admin.php => class-admin.php} (66%)
rename src/admin/{class-footnotes-wysiwyg.php => class-wysiwyg.php} (75%)
rename src/admin/layout/{class-footnotes-layout-engine.php => class-engine.php} (91%)
rename src/admin/layout/{class-footnotes-layout-init.php => class-init.php} (86%)
rename src/admin/layout/{class-footnotes-layout-settings.php => class-settings.php} (58%)
create mode 100644 src/includes/class-activator.php
rename src/includes/{class-footnotes-config.php => class-config.php} (51%)
rename src/includes/{class-footnotes-convert.php => class-convert.php} (95%)
rename src/includes/{class-footnotes.php => class-core.php} (66%)
rename src/includes/{class-footnotes-deactivator.php => class-deactivator.php} (57%)
delete mode 100644 src/includes/class-footnotes-activator.php
rename src/includes/{class-footnotes-i18n.php => class-i18n.php} (61%)
rename src/includes/{class-footnotes-loader.php => class-loader.php} (97%)
rename src/includes/{class-footnotes-settings.php => class-settings.php} (98%)
rename src/includes/{class-footnotes-template.php => class-template.php} (96%)
rename src/public/{class-footnotes-public.php => class-general.php} (73%)
rename src/public/{class-footnotes-parser.php => class-parser.php} (74%)
rename src/public/widget/{class-footnotes-widget-base.php => class-base.php} (81%)
rename src/public/widget/{class-footnotes-widget-reference-container.php => class-reference-container.php} (74%)
diff --git a/src/admin/class-footnotes-admin.php b/src/admin/class-admin.php
similarity index 66%
rename from src/admin/class-footnotes-admin.php
rename to src/admin/class-admin.php
index bfd1051..b41fe39 100644
--- a/src/admin/class-footnotes-admin.php
+++ b/src/admin/class-admin.php
@@ -1,33 +1,37 @@
wysiwyg = new Footnotes_WYSIWYG( $this->plugin_name );
+ $this->wysiwyg = new WYSIWYG( $this->plugin_name );
/**
* The class responsible for constructing the plugin dashboard page(s).
*/
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/layout/class-footnotes-layout-init.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/layout/class-init.php';
- new Footnotes_Layout_Init( $this->plugin_name );
+ new layout\Init( $this->plugin_name );
}
/**
@@ -140,21 +144,20 @@ class Footnotes_Admin {
/**
* Appends the Plugin links for display in the dashboard Plugins page.
*
- * @param string[] $links The default set of links to display.
+ * @param string[] $plugin_links The default set of links to display.
* @return string[] The full set of links to display.
*
* @since 1.5.0
- * @since 2.8.0 Moved from `Footnotes_Hooks` class to `Footnotes_Admin`.
+ * @since 2.8.0 Moved from `Hooks` class to `Admin`.
*/
- public function footnotes_action_links( array $links ): array {
+ public function action_links( array $plugin_links ): array {
// Append link to the WordPress Plugin page.
- $links[] = sprintf( '%s', __( 'Support', 'footnotes' ) );
+ $plugin_links[] = sprintf( '%s', __( 'Support', 'footnotes' ) );
// Append link to the settings page.
- $links[] = sprintf( '%s', esc_url( admin_url( 'options-general.php?page=footnotes' ) ), __( 'Settings', 'footnotes' ) );
+ $plugin_links[] = sprintf( '%s', esc_url( admin_url( 'options-general.php?page=footnotes' ) ), __( 'Settings', 'footnotes' ) );
// Append link to the PayPal donate function.
- $links[] = sprintf( '%s', __( 'Donate', 'footnotes' ) );
-
- return $links;
+ $plugin_links[] = sprintf( '%s', __( 'Donate', 'footnotes' ) );
+ return $plugin_links;
}
}
diff --git a/src/admin/class-footnotes-wysiwyg.php b/src/admin/class-wysiwyg.php
similarity index 75%
rename from src/admin/class-footnotes-wysiwyg.php
rename to src/admin/class-wysiwyg.php
index 90e8152..ad3e572 100644
--- a/src/admin/class-footnotes-wysiwyg.php
+++ b/src/admin/class-wysiwyg.php
@@ -1,25 +1,29 @@
get_content();
// phpcs:enable
@@ -92,11 +96,11 @@ class Footnotes_WYSIWYG {
*/
public static function ajax_callback() {
// Get start and end tag for the footnotes short code.
- $l_str_starting_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
- $l_str_ending_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
+ $l_str_starting_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
+ $l_str_ending_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
if ( 'userdefined' === $l_str_starting_tag || 'userdefined' === $l_str_ending_tag ) {
- $l_str_starting_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
- $l_str_ending_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
+ $l_str_starting_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
+ $l_str_ending_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
}
echo wp_json_encode(
array(
diff --git a/src/admin/layout/class-footnotes-layout-engine.php b/src/admin/layout/class-engine.php
similarity index 91%
rename from src/admin/layout/class-footnotes-layout-engine.php
rename to src/admin/layout/class-engine.php
index a9610c2..6f4c2b7 100644
--- a/src/admin/layout/class-footnotes-layout-engine.php
+++ b/src/admin/layout/class-engine.php
@@ -1,29 +1,32 @@
get_sub_page_slug() ) === $l_arr_sub_menu[2] ) {
- remove_submenu_page( Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG, Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug() );
+ if ( array_key_exists( plugin_basename( Init::C_STR_MAIN_MENU_SLUG ), $submenu ) ) {
+ foreach ( $submenu[ plugin_basename( Init::C_STR_MAIN_MENU_SLUG ) ] as $l_arr_sub_menu ) {
+ if ( plugin_basename( Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug() ) === $l_arr_sub_menu[2] ) {
+ remove_submenu_page( Init::C_STR_MAIN_MENU_SLUG, Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug() );
}
}
}
$this->a_str_sub_page_hook = add_submenu_page(
- Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG,
+ Init::C_STR_MAIN_MENU_SLUG,
$this->get_sub_page_title(),
$this->get_sub_page_title(),
'manage_options',
- Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug(),
+ Init::C_STR_MAIN_MENU_SLUG . $this->get_sub_page_slug(),
array( $this, 'display_content' )
);
}
@@ -244,7 +247,7 @@ abstract class Footnotes_Layout_Engine {
* @access private
*
* @since 1.5.0
- * @todo Move to {@see Footnotes_Admin}.
+ * @todo Move to {@see Includes\Admin}.
*/
private function append_scripts() {
wp_enqueue_script( 'postbox' );
@@ -286,7 +289,7 @@ abstract class Footnotes_Layout_Engine {
echo sprintf(
'%s',
( $l_str_id === $l_arr_active_section['id'] ) ? ' nav-tab-active' : '',
- Footnotes_Layout_Init::C_STR_MAIN_MENU_SLUG,
+ Init::C_STR_MAIN_MENU_SLUG,
$l_str_id,
$l_arr_description['title']
);
@@ -342,7 +345,7 @@ abstract class Footnotes_Layout_Engine {
$l_str_active_section_id = isset( $_GET['t'] ) ? wp_unslash( $_GET['t'] ) : key( $this->a_arr_sections );
$l_arr_active_section = $this->a_arr_sections[ $l_str_active_section_id ];
- foreach ( Footnotes_Settings::instance()->get_defaults( $l_arr_active_section['container'] ) as $l_str_key => $l_mixed_value ) {
+ foreach ( Includes\Settings::instance()->get_defaults( $l_arr_active_section['container'] ) as $l_str_key => $l_mixed_value ) {
if ( array_key_exists( $l_str_key, $_POST ) ) {
$l_arr_new_settings[ $l_str_key ] = wp_unslash( $_POST[ $l_str_key ] );
} else {
@@ -351,7 +354,7 @@ abstract class Footnotes_Layout_Engine {
}
}
// Update settings.
- return Footnotes_Settings::instance()->save_options( $l_arr_active_section['container'], $l_arr_new_settings );
+ return Includes\Settings::instance()->save_options( $l_arr_active_section['container'], $l_arr_new_settings );
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
@@ -388,7 +391,7 @@ abstract class Footnotes_Layout_Engine {
$p_arr_return = array();
$p_arr_return['id'] = sprintf( '%s', $p_str_setting_key_name );
$p_arr_return['name'] = sprintf( '%s', $p_str_setting_key_name );
- $p_arr_return['value'] = esc_attr( Footnotes_Settings::instance()->get( $p_str_setting_key_name ) );
+ $p_arr_return['value'] = esc_attr( Includes\Settings::instance()->get( $p_str_setting_key_name ) );
return $p_arr_return;
}
@@ -484,7 +487,7 @@ abstract class Footnotes_Layout_Engine {
'',
$l_arr_data['name'],
$l_arr_data['id'],
- Footnotes_Convert::to_bool( $l_arr_data['value'] ) ? 'checked="checked"' : ''
+ Includes\Convert::to_bool( $l_arr_data['value'] ) ? 'checked="checked"' : ''
);
}
diff --git a/src/admin/layout/class-footnotes-layout-init.php b/src/admin/layout/class-init.php
similarity index 86%
rename from src/admin/layout/class-footnotes-layout-init.php
rename to src/admin/layout/class-init.php
index 22a6abd..4e567c8 100644
--- a/src/admin/layout/class-footnotes-layout-init.php
+++ b/src/admin/layout/class-init.php
@@ -1,25 +1,28 @@
load_dependencies();
- $this->settings_page = new Footnotes_Layout_Settings( $this->plugin_name );
+ $this->settings_page = new Settings( $this->plugin_name );
// Register hooks/actions.
add_action( 'admin_menu', array( $this, 'register_options_submenu' ) );
@@ -77,9 +80,9 @@ class Footnotes_Layout_Init {
*
* Include the following files that make up the plugin:
*
- * - {@see Footnotes_Config}: defines plugin constants;
- * - {@see Footnotes_Settings}: defines configurable plugin settings; and
- * - {@see Footnotes_Layout_Settings}: defines the plugin settings page.
+ * - {@see Includes\Config}: defines plugin constants;
+ * - {@see Includes\Settings}: defines configurable plugin settings; and
+ * - {@see Settings}: defines the plugin settings page.
*
* @access private
*
@@ -89,17 +92,17 @@ class Footnotes_Layout_Init {
/**
* Defines plugin constants.
*/
- require_once plugin_dir_path( dirname( __FILE__, 2 ) ) . 'includes/class-footnotes-config.php';
+ require_once plugin_dir_path( dirname( __FILE__, 2 ) ) . 'includes/class-config.php';
/**
* Defines configurable plugin settings.
*/
- require_once plugin_dir_path( dirname( __FILE__, 2 ) ) . 'includes/class-footnotes-settings.php';
+ require_once plugin_dir_path( dirname( __FILE__, 2 ) ) . 'includes/class-settings.php';
/**
* Represents the plugin settings dashboard page.
*/
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-footnotes-layout-settings.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-settings.php';
}
/**
@@ -108,7 +111,7 @@ class Footnotes_Layout_Init {
* @since 1.5.0
*/
public function initialize_settings() {
- Footnotes_Settings::instance()->register_settings();
+ Includes\Settings::instance()->register_settings();
$this->settings_page->register_sections();
}
@@ -122,7 +125,7 @@ class Footnotes_Layout_Init {
add_submenu_page(
'options-general.php',
'footnotes Settings',
- Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME,
+ Includes\Config::C_STR_PLUGIN_PUBLIC_NAME,
'manage_options',
self::C_STR_MAIN_MENU_SLUG,
array( $this->settings_page, 'display_content' )
diff --git a/src/admin/layout/class-footnotes-layout-settings.php b/src/admin/layout/class-settings.php
similarity index 58%
rename from src/admin/layout/class-footnotes-layout-settings.php
rename to src/admin/layout/class-settings.php
index 475e946..2b7dbde 100644
--- a/src/admin/layout/class-footnotes-layout-settings.php
+++ b/src/admin/layout/class-settings.php
@@ -1,11 +1,11 @@
add_meta_box( 'settings', 'hard-links', __( 'URL fragment ID configuration', 'footnotes' ), 'hard_links' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'reference-container', __( 'Reference container', 'footnotes' ), 'reference_container' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'excerpts', __( 'Footnotes in excerpts', 'footnotes' ), 'excerpts' );
- $l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'love', Footnotes_Config::C_STR_PLUGIN_HEADING_NAME . ' ' . Footnotes_Config::C_STR_LOVE_SYMBOL_HEADING, 'love' );
+ $l_arr_meta_boxes[] = $this->add_meta_box( 'settings', 'love', Includes\Config::C_STR_PLUGIN_HEADING_NAME . ' ' . Includes\Config::C_STR_LOVE_SYMBOL_HEADING, 'love' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'hyperlink-arrow', __( 'Backlink symbol', 'footnotes' ), 'hyperlink_arrow' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'superscript', __( 'Referrers', 'footnotes' ), 'superscript' );
@@ -128,13 +131,13 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'mouse-over-box-truncation', __( 'Tooltip truncation', 'footnotes' ), 'mouseover_box_truncation' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'mouse-over-box-text', __( 'Tooltip text', 'footnotes' ), 'mouseover_box_text' );
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'mouse-over-box-appearance', __( 'Tooltip appearance', 'footnotes' ), 'mouseover_box_appearance' );
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE ) ) ) {
$l_arr_meta_boxes[] = $this->add_meta_box( 'customize', 'custom-css', __( 'Your existing Custom CSS code', 'footnotes' ), 'custom_css' );
}
$l_arr_meta_boxes[] = $this->add_meta_box( 'expert', 'lookup', __( 'WordPress hooks with priority level', 'footnotes' ), 'lookup_hooks' );
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE ) ) ) {
$l_arr_meta_boxes[] = $this->add_meta_box( 'customcss', 'custom-css-migration', __( 'Your existing Custom CSS code', 'footnotes' ), 'custom_css_migration' );
}
$l_arr_meta_boxes[] = $this->add_meta_box( 'customcss', 'custom-css-new', __( 'Custom CSS', 'footnotes' ), 'custom_css_new' );
@@ -153,17 +156,17 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
public function amp_compat() {
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'settings-amp' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'settings-amp' );
// Replace all placeholders.
$l_obj_template->replace(
array(
// Translators: '%s' is the link text 'AMP-WP' linked to the plugin's front page on WordPress.org.
'description-1-amp' => sprintf( __( 'The official %s plugin is required when this option is enabled.', 'footnotes' ), 'AMP-WP' ),
- 'label-amp' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE, __( 'Enable AMP compatibility mode:', 'footnotes' ) ),
- 'amp' => $this->add_checkbox( Footnotes_Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE ),
+ 'label-amp' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE, __( 'Enable AMP compatibility mode:', 'footnotes' ) ),
+ 'amp' => $this->add_checkbox( Includes\Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE ),
'notice-amp' => __( 'This option enables hard links with configurable scroll offset in % viewport height.', 'footnotes' ),
// Translators: '%s' is the logogram of the 'Footnotes' plugin.
- 'description-2-amp' => sprintf( __( '%s is becoming AMP compatible when this box is checked. Styled tooltips are displayed with fade-in/fade-out effect if enabled, and the reference container expands also on clicking a referrer if it\'s collapsed by default.', 'footnotes' ), '' . Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '' ),
+ 'description-2-amp' => sprintf( __( '%s is becoming AMP compatible when this box is checked. Styled tooltips are displayed with fade-in/fade-out effect if enabled, and the reference container expands also on clicking a referrer if it\'s collapsed by default.', 'footnotes' ), '' . Includes\Config::C_STR_PLUGIN_PUBLIC_NAME . '' ),
)
);
// Display template with replaced placeholders.
@@ -241,102 +244,102 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'settings-reference-container' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'settings-reference-container' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-name' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME, __( 'Heading:', 'footnotes' ) ),
- 'name' => $this->add_text_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME ),
+ 'label-name' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_NAME, __( 'Heading:', 'footnotes' ) ),
+ 'name' => $this->add_text_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_NAME ),
- 'label-element' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, __( 'Heading\'s HTML element:', 'footnotes' ) ),
- 'element' => $this->add_select_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, $l_arr_label_element ),
+ 'label-element' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, __( 'Heading\'s HTML element:', 'footnotes' ) ),
+ 'element' => $this->add_select_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, $l_arr_label_element ),
- 'label-border' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER, __( 'Border under the heading:', 'footnotes' ) ),
- 'border' => $this->add_select_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER, $l_arr_enabled ),
+ 'label-border' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER, __( 'Border under the heading:', 'footnotes' ) ),
+ 'border' => $this->add_select_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER, $l_arr_enabled ),
- 'label-collapse' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE, __( 'Collapse by default:', 'footnotes' ) ),
- 'collapse' => $this->add_select_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE, $l_arr_enabled ),
+ 'label-collapse' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE, __( 'Collapse by default:', 'footnotes' ) ),
+ 'collapse' => $this->add_select_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE, $l_arr_enabled ),
- 'label-script' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE, __( 'Script mode:', 'footnotes' ) ),
- 'script' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE, $l_arr_script_mode ),
+ 'label-script' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE, __( 'Script mode:', 'footnotes' ) ),
+ 'script' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE, $l_arr_script_mode ),
'notice-script' => __( 'The plain JavaScript mode will enable hard links with configurable scroll offset.', 'footnotes' ),
- 'label-position' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION, __( 'Default position:', 'footnotes' ) ),
- 'position' => $this->add_select_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION, $l_arr_positions ),
+ 'label-position' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION, __( 'Default position:', 'footnotes' ) ),
+ 'position' => $this->add_select_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION, $l_arr_positions ),
// Translators: %s: at the end of the post.
'notice-position' => sprintf( __( 'To use the position or section shortcode, please set the position to: %s', 'footnotes' ), '' . __( 'at the end of the post', 'footnotes' ) . '' ),
- 'label-shortcode' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE, __( 'Position shortcode:', 'footnotes' ) ),
- 'shortcode' => $this->add_text_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE ),
+ 'label-shortcode' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE, __( 'Position shortcode:', 'footnotes' ) ),
+ 'shortcode' => $this->add_text_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE ),
'notice-shortcode' => __( 'If present in the content, any shortcode in this text box will be replaced with the reference container.', 'footnotes' ),
- 'label-section' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTE_SECTION_SHORTCODE, __( 'Footnote section shortcode:', 'footnotes' ) ),
- 'section' => $this->add_text_box( Footnotes_Settings::C_STR_FOOTNOTE_SECTION_SHORTCODE ),
+ 'label-section' => $this->add_label( Includes\Settings::C_STR_FOOTNOTE_SECTION_SHORTCODE, __( 'Footnote section shortcode:', 'footnotes' ) ),
+ 'section' => $this->add_text_box( Includes\Settings::C_STR_FOOTNOTE_SECTION_SHORTCODE ),
'notice-section' => __( 'If present in the content, any shortcode in this text box will delimit a section terminated by a reference container.', 'footnotes' ),
- 'label-startpage' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE, __( 'Display on start page too:', 'footnotes' ) ),
- 'startpage' => $this->add_select_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE, $l_arr_enabled ),
+ 'label-startpage' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE, __( 'Display on start page too:', 'footnotes' ) ),
+ 'startpage' => $this->add_select_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE, $l_arr_enabled ),
- 'label-margin-top' => $this->add_label( Footnotes_Settings::C_INT_REFERENCE_CONTAINER_TOP_MARGIN, __( 'Top margin:', 'footnotes' ) ),
- 'margin-top' => $this->add_num_box( Footnotes_Settings::C_INT_REFERENCE_CONTAINER_TOP_MARGIN, -500, 500 ),
+ 'label-margin-top' => $this->add_label( Includes\Settings::C_INT_REFERENCE_CONTAINER_TOP_MARGIN, __( 'Top margin:', 'footnotes' ) ),
+ 'margin-top' => $this->add_num_box( Includes\Settings::C_INT_REFERENCE_CONTAINER_TOP_MARGIN, -500, 500 ),
'notice-margin-top' => __( 'pixels; may be negative', 'footnotes' ),
- 'label-margin-bottom' => $this->add_label( Footnotes_Settings::C_INT_REFERENCE_CONTAINER_BOTTOM_MARGIN, __( 'Bottom margin:', 'footnotes' ) ),
- 'margin-bottom' => $this->add_num_box( Footnotes_Settings::C_INT_REFERENCE_CONTAINER_BOTTOM_MARGIN, -500, 500 ),
+ 'label-margin-bottom' => $this->add_label( Includes\Settings::C_INT_REFERENCE_CONTAINER_BOTTOM_MARGIN, __( 'Bottom margin:', 'footnotes' ) ),
+ 'margin-bottom' => $this->add_num_box( Includes\Settings::C_INT_REFERENCE_CONTAINER_BOTTOM_MARGIN, -500, 500 ),
'notice-margin-bottom' => __( 'pixels; may be negative', 'footnotes' ),
- 'label-page-layout' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, __( 'Apply basic responsive page layout:', 'footnotes' ) ),
- 'page-layout' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, $l_arr_page_layout_options ),
+ 'label-page-layout' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, __( 'Apply basic responsive page layout:', 'footnotes' ) ),
+ 'page-layout' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, $l_arr_page_layout_options ),
'notice-page-layout' => __( 'Most themes don\'t need this fix.', 'footnotes' ),
- 'label-url-wrap' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED, __( 'Allow URLs to line-wrap anywhere:', 'footnotes' ) ),
- 'url-wrap' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED, $l_arr_enabled ),
+ 'label-url-wrap' => $this->add_label( Includes\Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED, __( 'Allow URLs to line-wrap anywhere:', 'footnotes' ) ),
+ 'url-wrap' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED, $l_arr_enabled ),
'notice-url-wrap' => __( 'Unicode-conformant browsers don\'t need this fix.', 'footnotes' ),
- 'label-symbol' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, __( 'Display a backlink symbol:', 'footnotes' ) ),
- 'symbol-enable' => $this->add_select_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, $l_arr_enabled ),
+ 'label-symbol' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, __( 'Display a backlink symbol:', 'footnotes' ) ),
+ 'symbol-enable' => $this->add_select_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, $l_arr_enabled ),
'notice-symbol' => __( 'Please choose or input the symbol at the top of the next dashboard tab.', 'footnotes' ),
- 'label-switch' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH, __( 'Symbol appended, not prepended:', 'footnotes' ) ),
- 'switch' => $this->add_select_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH, $l_arr_enabled ),
+ 'label-switch' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH, __( 'Symbol appended, not prepended:', 'footnotes' ) ),
+ 'switch' => $this->add_select_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH, $l_arr_enabled ),
- 'label-3column' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE, __( 'Backlink symbol in an extra column:', 'footnotes' ) ),
- '3column' => $this->add_select_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE, $l_arr_enabled ),
+ 'label-3column' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE, __( 'Backlink symbol in an extra column:', 'footnotes' ) ),
+ '3column' => $this->add_select_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE, $l_arr_enabled ),
'notice-3column' => __( 'This legacy layout is available if identical footnotes are not combined.', 'footnotes' ),
- 'label-row-borders' => $this->add_label( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_ROW_BORDERS_ENABLE, __( 'Borders around the table rows:', 'footnotes' ) ),
- 'row-borders' => $this->add_select_box( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_ROW_BORDERS_ENABLE, $l_arr_enabled ),
+ 'label-row-borders' => $this->add_label( Includes\Settings::C_STR_REFERENCE_CONTAINER_ROW_BORDERS_ENABLE, __( 'Borders around the table rows:', 'footnotes' ) ),
+ 'row-borders' => $this->add_select_box( Includes\Settings::C_STR_REFERENCE_CONTAINER_ROW_BORDERS_ENABLE, $l_arr_enabled ),
- 'label-separator' => $this->add_label( Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_ENABLED, __( 'Add a separator when enumerating backlinks:', 'footnotes' ) ),
- 'separator-enable' => $this->add_select_box( Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_ENABLED, $l_arr_enabled ),
- 'separator-options' => $this->add_select_box( Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_OPTION, $l_arr_separators ),
- 'separator-custom' => $this->add_text_box( Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_CUSTOM ),
+ 'label-separator' => $this->add_label( Includes\Settings::C_STR_BACKLINKS_SEPARATOR_ENABLED, __( 'Add a separator when enumerating backlinks:', 'footnotes' ) ),
+ 'separator-enable' => $this->add_select_box( Includes\Settings::C_STR_BACKLINKS_SEPARATOR_ENABLED, $l_arr_enabled ),
+ 'separator-options' => $this->add_select_box( Includes\Settings::C_STR_BACKLINKS_SEPARATOR_OPTION, $l_arr_separators ),
+ 'separator-custom' => $this->add_text_box( Includes\Settings::C_STR_BACKLINKS_SEPARATOR_CUSTOM ),
'notice-separator' => __( 'Your input overrides the selection.', 'footnotes' ),
- 'label-terminator' => $this->add_label( Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_ENABLED, __( 'Add a terminal punctuation to backlinks:', 'footnotes' ) ),
- 'terminator-enable' => $this->add_select_box( Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_ENABLED, $l_arr_enabled ),
- 'terminator-options' => $this->add_select_box( Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_OPTION, $l_arr_terminators ),
- 'terminator-custom' => $this->add_text_box( Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_CUSTOM ),
+ 'label-terminator' => $this->add_label( Includes\Settings::C_STR_BACKLINKS_TERMINATOR_ENABLED, __( 'Add a terminal punctuation to backlinks:', 'footnotes' ) ),
+ 'terminator-enable' => $this->add_select_box( Includes\Settings::C_STR_BACKLINKS_TERMINATOR_ENABLED, $l_arr_enabled ),
+ 'terminator-options' => $this->add_select_box( Includes\Settings::C_STR_BACKLINKS_TERMINATOR_OPTION, $l_arr_terminators ),
+ 'terminator-custom' => $this->add_text_box( Includes\Settings::C_STR_BACKLINKS_TERMINATOR_CUSTOM ),
'notice-terminator' => __( 'Your input overrides the selection.', 'footnotes' ),
- 'label-width' => $this->add_label( Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED, __( 'Set backlinks column width:', 'footnotes' ) ),
- 'width-enable' => $this->add_select_box( Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED, $l_arr_enabled ),
- 'width-scalar' => $this->add_num_box( Footnotes_Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR, 0, 500, true ),
- 'width-unit' => $this->add_select_box( Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT, $l_arr_width_units ),
+ 'label-width' => $this->add_label( Includes\Settings::C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED, __( 'Set backlinks column width:', 'footnotes' ) ),
+ 'width-enable' => $this->add_select_box( Includes\Settings::C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED, $l_arr_enabled ),
+ 'width-scalar' => $this->add_num_box( Includes\Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR, 0, 500, true ),
+ 'width-unit' => $this->add_select_box( Includes\Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT, $l_arr_width_units ),
'notice-width' => __( 'Absolute width in pixels doesn\'t need to be accurate to the tenth, but relative width in rem or em may.', 'footnotes' ),
- 'label-max-width' => $this->add_label( Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED, __( 'Set backlinks column maximum width:', 'footnotes' ) ),
- 'max-width-enable' => $this->add_select_box( Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED, $l_arr_enabled ),
- 'max-width-scalar' => $this->add_num_box( Footnotes_Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR, 0, 500, true ),
- 'max-width-unit' => $this->add_select_box( Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT, $l_arr_width_units ),
+ 'label-max-width' => $this->add_label( Includes\Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED, __( 'Set backlinks column maximum width:', 'footnotes' ) ),
+ 'max-width-enable' => $this->add_select_box( Includes\Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED, $l_arr_enabled ),
+ 'max-width-scalar' => $this->add_num_box( Includes\Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR, 0, 500, true ),
+ 'max-width-unit' => $this->add_select_box( Includes\Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT, $l_arr_width_units ),
'notice-max-width' => __( 'Absolute width in pixels doesn\'t need to be accurate to the tenth, but relative width in rem or em may.', 'footnotes' ),
- 'label-line-break' => $this->add_label( Footnotes_Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED, __( 'Stack backlinks when enumerating:', 'footnotes' ) ),
- 'line-break' => $this->add_select_box( Footnotes_Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED, $l_arr_enabled ),
+ 'label-line-break' => $this->add_label( Includes\Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED, __( 'Stack backlinks when enumerating:', 'footnotes' ) ),
+ 'line-break' => $this->add_select_box( Includes\Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED, $l_arr_enabled ),
'notice-line-break' => __( 'This option adds a line break before each added backlink when identical footnotes are combined.', 'footnotes' ),
- 'label-link' => $this->add_label( Footnotes_Settings::C_STR_LINK_ELEMENT_ENABLED, __( 'Use the link element for referrers and backlinks:', 'footnotes' ) ),
- 'link' => $this->add_select_box( Footnotes_Settings::C_STR_LINK_ELEMENT_ENABLED, $l_arr_enabled ),
+ 'label-link' => $this->add_label( Includes\Settings::C_STR_LINK_ELEMENT_ENABLED, __( 'Use the link element for referrers and backlinks:', 'footnotes' ) ),
+ 'link' => $this->add_select_box( Includes\Settings::C_STR_LINK_ELEMENT_ENABLED, $l_arr_enabled ),
'notice-link' => __( 'The link element is needed to apply the theme\'s link color.', 'footnotes' ),
'description-link' => __( 'If the link element is not desired for styling, a simple span is used instead when the above is set to No.', 'footnotes' ),
)
@@ -388,31 +391,31 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'settings-start-end' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'settings-start-end' );
// Replace all placeholders.
$l_obj_template->replace(
array(
'description-escapement' => __( 'When delimiters with pointy brackets are used, the diverging escapement schemas will be unified before footnotes are processed.', 'footnotes' ),
- 'label-short-code-start' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START, __( 'Footnote start tag short code:', 'footnotes' ) ),
- 'short-code-start' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START, $l_arr_shortcode_start ),
- 'short-code-start-user' => $this->add_text_box( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED ),
+ 'label-short-code-start' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START, __( 'Footnote start tag short code:', 'footnotes' ) ),
+ 'short-code-start' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START, $l_arr_shortcode_start ),
+ 'short-code-start-user' => $this->add_text_box( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED ),
- 'label-short-code-end' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END, __( 'Footnote end tag short code:', 'footnotes' ) ),
- 'short-code-end' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END, $l_arr_shortcode_end ),
- 'short-code-end-user' => $this->add_text_box( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED ),
+ 'label-short-code-end' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END, __( 'Footnote end tag short code:', 'footnotes' ) ),
+ 'short-code-end' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END, $l_arr_shortcode_end ),
+ 'short-code-end-user' => $this->add_text_box( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED ),
// For script showing/hiding user defined text boxes.
- 'short-code-start-id' => Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START,
- 'short-code-end-id' => Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END,
- 'short-code-start-user-id' => Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED,
- 'short-code-end-user-id' => Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED,
+ 'short-code-start-id' => Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START,
+ 'short-code-end-id' => Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END,
+ 'short-code-start-user-id' => Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED,
+ 'short-code-end-user-id' => Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED,
'description-parentheses' => __( 'WARNING: Although widespread industry standard, the double parentheses are problematic because they may occur in scripts embedded in the content and be mistaken as a short code.', 'footnotes' ),
// Option to enable syntax validation, label mirrored in task.php.
- 'label-syntax' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE, __( 'Check for balanced shortcodes:', 'footnotes' ) ),
- 'syntax' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE, $l_arr_enable ),
+ 'label-syntax' => $this->add_label( Includes\Settings::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE, __( 'Check for balanced shortcodes:', 'footnotes' ) ),
+ 'syntax' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE, $l_arr_enable ),
'notice-syntax' => __( 'In the presence of a lone start tag shortcode, a warning displays below the post title.', 'footnotes' ),
'description-syntax' => __( 'If the start tag short code is \'((\' or \'(((\', it will not be reported as unbalanced if the following string contains braces hinting that it is a script.', 'footnotes' ),
@@ -448,16 +451,16 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'settings-numbering' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'settings-numbering' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-counter-style' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE, __( 'Numbering style:', 'footnotes' ) ),
- 'counter-style' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE, $l_arr_counter_style ),
+ 'label-counter-style' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE, __( 'Numbering style:', 'footnotes' ) ),
+ 'counter-style' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE, $l_arr_counter_style ),
// Algorithmically combine identicals.
- 'label-identical' => $this->add_label( Footnotes_Settings::C_STR_COMBINE_IDENTICAL_FOOTNOTES, __( 'Combine identical footnotes:', 'footnotes' ) ),
- 'identical' => $this->add_select_box( Footnotes_Settings::C_STR_COMBINE_IDENTICAL_FOOTNOTES, $l_arr_enable ),
+ 'label-identical' => $this->add_label( Includes\Settings::C_STR_COMBINE_IDENTICAL_FOOTNOTES, __( 'Combine identical footnotes:', 'footnotes' ) ),
+ 'identical' => $this->add_select_box( Includes\Settings::C_STR_COMBINE_IDENTICAL_FOOTNOTES, $l_arr_enable ),
'notice-identical' => __( 'This option may require copy-pasting footnotes in multiple instances.', 'footnotes' ),
// Support for Ibid. notation added thanks to @meglio in .
'description-identical' => __( 'Even when footnotes are combined, footnote numbers keep incrementing. This avoids suboptimal referrer and backlink disambiguation using a secondary numbering system. The Ibid. notation and the op. cit. abbreviation followed by the current page number avoid repeating the footnote content. For changing sources, shortened citations may be used. Repeating full citations is also an opportunity to add details.', 'footnotes' ),
@@ -483,38 +486,38 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'settings-scrolling' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'settings-scrolling' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-scroll-css' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING, __( 'CSS-based smooth scrolling:', 'footnotes' ) ),
- 'scroll-css' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING, $l_arr_enable ),
+ 'label-scroll-css' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING, __( 'CSS-based smooth scrolling:', 'footnotes' ) ),
+ 'scroll-css' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING, $l_arr_enable ),
'notice-scroll-css' => __( 'May slightly disturb jQuery scrolling and is therefore disabled by default. Works in recent browsers.', 'footnotes' ),
- 'label-scroll-offset' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, __( 'Scroll offset:', 'footnotes' ) ),
- 'scroll-offset' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, 0, 100 ),
+ 'label-scroll-offset' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, __( 'Scroll offset:', 'footnotes' ) ),
+ 'scroll-offset' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, 0, 100 ),
'notice-scroll-offset' => __( 'per cent viewport height from the upper edge', 'footnotes' ),
- 'label-scroll-duration' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION, __( 'Scroll duration:', 'footnotes' ) ),
- 'scroll-duration' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION, 0, 20000 ),
+ 'label-scroll-duration' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DURATION, __( 'Scroll duration:', 'footnotes' ) ),
+ 'scroll-duration' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DURATION, 0, 20000 ),
'notice-scroll-duration' => __( 'milliseconds. If asymmetric scroll durations are enabled, this is the scroll-up duration.', 'footnotes' ),
// Enable scroll duration asymmetricity.
- 'label-scroll-asymmetricity' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY, __( 'Enable asymmetric scroll durations:', 'footnotes' ) ),
- 'scroll-asymmetricity' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY, $l_arr_enable ),
+ 'label-scroll-asymmetricity' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY, __( 'Enable asymmetric scroll durations:', 'footnotes' ) ),
+ 'scroll-asymmetricity' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY, $l_arr_enable ),
'notice-scroll-asymmetricity' => __( 'With this option enabled, scrolling up may take longer than down, or conversely.', 'footnotes' ),
- 'label-scroll-down-duration' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION, __( 'Scroll-down duration:', 'footnotes' ) ),
- 'scroll-down-duration' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION, 0, 20000 ),
+ 'label-scroll-down-duration' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION, __( 'Scroll-down duration:', 'footnotes' ) ),
+ 'scroll-down-duration' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION, 0, 20000 ),
'notice-scroll-down-duration' => __( 'milliseconds', 'footnotes' ),
- 'label-scroll-down-delay' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY, __( 'Scroll-down delay:', 'footnotes' ) ),
- 'scroll-down-delay' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY, 0, 20000 ),
+ 'label-scroll-down-delay' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY, __( 'Scroll-down delay:', 'footnotes' ) ),
+ 'scroll-down-delay' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY, 0, 20000 ),
'notice-scroll-down-delay' => __( 'milliseconds. Useful to see the effect on input elements when referrers without hard links are clicked in form labels.', 'footnotes' ),
- 'label-scroll-up-delay' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY, __( 'Scroll-up delay:', 'footnotes' ) ),
- 'scroll-up-delay' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY, 0, 20000 ),
+ 'label-scroll-up-delay' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY, __( 'Scroll-up delay:', 'footnotes' ) ),
+ 'scroll-up-delay' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY, 0, 20000 ),
'notice-scroll-up-delay' => __( 'milliseconds. Less useful than the scroll-down delay.', 'footnotes' ),
)
@@ -539,34 +542,34 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'settings-hard-links' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'settings-hard-links' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-hard-links' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_HARD_LINKS_ENABLE, __( 'Enable hard links:', 'footnotes' ) ),
- 'hard-links' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_HARD_LINKS_ENABLE, $l_arr_enable ),
+ 'label-hard-links' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_HARD_LINKS_ENABLE, __( 'Enable hard links:', 'footnotes' ) ),
+ 'hard-links' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_HARD_LINKS_ENABLE, $l_arr_enable ),
'notice-hard-links' => __( 'Hard links disable jQuery delays but have the same scroll offset, and allow to share footnotes (accessed if the list is not collapsed by default).', 'footnotes' ),
- 'label-footnote' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG, __( 'Fragment identifier slug for footnotes:', 'footnotes' ) ),
- 'footnote' => $this->add_text_box( Footnotes_Settings::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG ),
+ 'label-footnote' => $this->add_label( Includes\Settings::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG, __( 'Fragment identifier slug for footnotes:', 'footnotes' ) ),
+ 'footnote' => $this->add_text_box( Includes\Settings::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG ),
'notice-footnote' => __( 'This will show up in the address bar after clicking on a hard-linked footnote referrer.', 'footnotes' ),
- 'label-referrer' => $this->add_label( Footnotes_Settings::C_STR_REFERRER_FRAGMENT_ID_SLUG, __( 'Fragment identifier slug for footnote referrers:', 'footnotes' ) ),
- 'referrer' => $this->add_text_box( Footnotes_Settings::C_STR_REFERRER_FRAGMENT_ID_SLUG ),
+ 'label-referrer' => $this->add_label( Includes\Settings::C_STR_REFERRER_FRAGMENT_ID_SLUG, __( 'Fragment identifier slug for footnote referrers:', 'footnotes' ) ),
+ 'referrer' => $this->add_text_box( Includes\Settings::C_STR_REFERRER_FRAGMENT_ID_SLUG ),
'notice-referrer' => __( 'This will show up in the address bar after clicking on a hard-linked backlink.', 'footnotes' ),
- 'label-separator' => $this->add_label( Footnotes_Settings::C_STR_HARD_LINK_IDS_SEPARATOR, __( 'ID separator:', 'footnotes' ) ),
- 'separator' => $this->add_text_box( Footnotes_Settings::C_STR_HARD_LINK_IDS_SEPARATOR ),
+ 'label-separator' => $this->add_label( Includes\Settings::C_STR_HARD_LINK_IDS_SEPARATOR, __( 'ID separator:', 'footnotes' ) ),
+ 'separator' => $this->add_text_box( Includes\Settings::C_STR_HARD_LINK_IDS_SEPARATOR ),
'notice-separator' => __( 'May be empty or any string, for example _, - or +, to distinguish post number, container number and footnote number.', 'footnotes' ),
// Enable backlink tooltips.
- 'label-backlink-tooltips' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE, __( 'Enable backlink tooltips:', 'footnotes' ) ),
- 'backlink-tooltips' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE, $l_arr_enable ),
+ 'label-backlink-tooltips' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE, __( 'Enable backlink tooltips:', 'footnotes' ) ),
+ 'backlink-tooltips' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE, $l_arr_enable ),
'notice-backlink-tooltips' => __( 'Hard backlinks get ordinary tooltips hinting to use the backbutton instead to keep it usable.', 'footnotes' ),
- 'label-backlink-tooltip-text' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT, __( 'Backlink tooltip text:', 'footnotes' ) ),
- 'backlink-tooltip-text' => $this->add_text_box( Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT ),
+ 'label-backlink-tooltip-text' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT, __( 'Backlink tooltip text:', 'footnotes' ) ),
+ 'backlink-tooltip-text' => $this->add_text_box( Includes\Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT ),
'notice-backlink-tooltip-text' => __( 'Default text is the keyboard shortcut; may be a localized descriptive hint.', 'footnotes' ),
)
@@ -586,35 +589,35 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
// Options for the acknowledgment display in the footer.
$l_arr_love = array(
// Logo only.
- 'text-3' => sprintf( '%s', Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ),
+ 'text-3' => sprintf( '%s', Includes\Config::C_STR_PLUGIN_PUBLIC_NAME ),
// Logo followed by heart symbol.
- 'text-4' => sprintf( '%s %s', Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME, Footnotes_Config::C_STR_LOVE_SYMBOL ),
+ 'text-4' => sprintf( '%s %s', Includes\Config::C_STR_PLUGIN_PUBLIC_NAME, Includes\Config::C_STR_LOVE_SYMBOL ),
// Logo preceded by heart symbol.
- 'text-5' => sprintf( '%s %s', Footnotes_Config::C_STR_LOVE_SYMBOL, Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ),
+ 'text-5' => sprintf( '%s %s', Includes\Config::C_STR_LOVE_SYMBOL, Includes\Config::C_STR_PLUGIN_PUBLIC_NAME ),
// Translators: 2: heart symbol 1: footnotes logogram.
- 'text-1' => sprintf( __( 'I %2$s %1$s', 'footnotes' ), Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME, Footnotes_Config::C_STR_LOVE_SYMBOL ),
+ 'text-1' => sprintf( __( 'I %2$s %1$s', 'footnotes' ), Includes\Config::C_STR_PLUGIN_PUBLIC_NAME, Includes\Config::C_STR_LOVE_SYMBOL ),
// Translators: %s: Footnotes plugin logo.
- 'text-6' => sprintf( __( 'This website uses %s.', 'footnotes' ), Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ),
+ 'text-6' => sprintf( __( 'This website uses %s.', 'footnotes' ), Includes\Config::C_STR_PLUGIN_PUBLIC_NAME ),
// Translators: %s: Footnotes plugin logo.
- 'text-7' => sprintf( __( 'This website uses the %s plugin.', 'footnotes' ), Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ),
+ 'text-7' => sprintf( __( 'This website uses the %s plugin.', 'footnotes' ), Includes\Config::C_STR_PLUGIN_PUBLIC_NAME ),
// Translators: %s: Footnotes plugin logo.
- 'text-2' => sprintf( __( 'This website uses the awesome %s plugin.', 'footnotes' ), Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ),
+ 'text-2' => sprintf( __( 'This website uses the awesome %s plugin.', 'footnotes' ), Includes\Config::C_STR_PLUGIN_PUBLIC_NAME ),
'random' => __( 'randomly determined display of either mention', 'footnotes' ),
// Translators: 1: Plugin logo.2: heart symbol.
- 'no' => sprintf( __( 'no display of any "%1$s %2$s" mention in the footer', 'footnotes' ), Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME, Footnotes_Config::C_STR_LOVE_SYMBOL ),
+ 'no' => sprintf( __( 'no display of any "%1$s %2$s" mention in the footer', 'footnotes' ), Includes\Config::C_STR_PLUGIN_PUBLIC_NAME, Includes\Config::C_STR_LOVE_SYMBOL ),
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'settings-love' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'settings-love' );
// Replace all placeholders.
$l_obj_template->replace(
array(
// Translators: %s: Footnotes plugin logo.
- 'label-love' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_LOVE, sprintf( __( 'Tell the world you\'re using %s:', 'footnotes' ), Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ) ),
- 'love' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_LOVE, $l_arr_love ),
+ 'label-love' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_LOVE, sprintf( __( 'Tell the world you\'re using %s:', 'footnotes' ), Includes\Config::C_STR_PLUGIN_PUBLIC_NAME ) ),
+ 'love' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_LOVE, $l_arr_love ),
// Translators: %s: Footnotes plugin logo.
- 'label-no-love' => $this->add_text( sprintf( __( 'Shortcode to inhibit the display of the %s mention on specific pages:', 'footnotes' ), Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME ) ),
- 'no-love' => $this->add_text( Footnotes_Config::C_STR_NO_LOVE_SLUG ),
+ 'label-no-love' => $this->add_text( sprintf( __( 'Shortcode to inhibit the display of the %s mention on specific pages:', 'footnotes' ), Includes\Config::C_STR_PLUGIN_PUBLIC_NAME ) ),
+ 'no-love' => $this->add_text( Includes\Config::C_STR_NO_LOVE_SLUG ),
)
);
// Display template with replaced placeholders.
@@ -637,16 +640,16 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'settings-excerpts' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'settings-excerpts' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-excerpts' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_IN_EXCERPT, __( 'Process footnotes in excerpts:', 'footnotes' ) ),
- 'excerpts' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_IN_EXCERPT, $l_arr_excerpt_mode ),
+ 'label-excerpts' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_IN_EXCERPT, __( 'Process footnotes in excerpts:', 'footnotes' ) ),
+ 'excerpts' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_IN_EXCERPT, $l_arr_excerpt_mode ),
'notice-excerpts' => __( 'If the_excerpt is enabled.', 'footnotes' ),
// Translators: %s: link text 'Advanced Excerpt' linked to the plugin\'s WordPress.org front page.
// Translators: %s: Footnotes plugin logo.
- 'description-excerpts' => sprintf( __( 'To not display footnotes in excerpts, the %s plugin generates excerpts on the basis of the posts to be able to remove the footnotes. Else, footnotes may be processed in manual excerpts OR processed based on the posts. — For this setting to be effective, the hook the_excerpt must be enabled under Scope and priority.', 'footnotes' ), '' . Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '' ),
+ 'description-excerpts' => sprintf( __( 'To not display footnotes in excerpts, the %s plugin generates excerpts on the basis of the posts to be able to remove the footnotes. Else, footnotes may be processed in manual excerpts OR processed based on the posts. — For this setting to be effective, the hook the_excerpt must be enabled under Scope and priority.', 'footnotes' ), '' . Includes\Config::C_STR_PLUGIN_PUBLIC_NAME . '' ),
)
);
// Display template with replaced placeholders.
@@ -673,24 +676,24 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
'all' => __( 'All superscript elements', 'footnotes' ),
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'customize-superscript' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'customize-superscript' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-superscript' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, __( 'Display footnote referrers in superscript:', 'footnotes' ) ),
- 'superscript' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, $l_arr_enabled ),
+ 'label-superscript' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, __( 'Display footnote referrers in superscript:', 'footnotes' ) ),
+ 'superscript' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, $l_arr_enabled ),
- 'label-normalize' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT, __( 'Normalize vertical alignment and font size:', 'footnotes' ) ),
- 'normalize' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT, $l_arr_normalize_superscript ),
+ 'label-normalize' => $this->add_label( Includes\Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT, __( 'Normalize vertical alignment and font size:', 'footnotes' ) ),
+ 'normalize' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT, $l_arr_normalize_superscript ),
'notice-normalize' => __( 'Most themes don\'t need this fix.', 'footnotes' ),
- 'label-before' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE, __( 'At the start of the footnote referrers:', 'footnotes' ) ),
- 'before' => $this->add_text_box( Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE ),
+ 'label-before' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_STYLING_BEFORE, __( 'At the start of the footnote referrers:', 'footnotes' ) ),
+ 'before' => $this->add_text_box( Includes\Settings::C_STR_FOOTNOTES_STYLING_BEFORE ),
- 'label-after' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER, __( 'At the end of the footnote referrers:', 'footnotes' ) ),
- 'after' => $this->add_text_box( Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER ),
+ 'label-after' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_STYLING_AFTER, __( 'At the end of the footnote referrers:', 'footnotes' ) ),
+ 'after' => $this->add_text_box( Includes\Settings::C_STR_FOOTNOTES_STYLING_AFTER ),
- 'label-link' => $this->add_label( Footnotes_Settings::C_STR_LINK_ELEMENT_ENABLED, __( 'Use the link element for referrers and backlinks:', 'footnotes' ) ),
+ 'label-link' => $this->add_label( Includes\Settings::C_STR_LINK_ELEMENT_ENABLED, __( 'Use the link element for referrers and backlinks:', 'footnotes' ) ),
'notice-link' => __( 'Please find this setting at the end of the reference container settings. The link element is needed to apply the theme\'s link color.', 'footnotes' ),
)
);
@@ -713,13 +716,13 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
'disconnect' => __( 'B. Labels with footnotes are disconnected from input element (discouraged)', 'footnotes' ),
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'configure-label-solution' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'configure-label-solution' );
// Replace all placeholders.
$l_obj_template->replace(
array(
'description-1-selection' => __( 'Clicking a footnote referrer in an input element label toggles the input except when hard links are enabled. In jQuery mode, the recommended solution is to move footnotes and append them after the label (option A).', 'footnotes' ),
- 'label-selection' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION, __( 'Solve input label issue:', 'footnotes' ) ),
- 'selection' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION, $l_arr_issue_solutions ),
+ 'label-selection' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION, __( 'Solve input label issue:', 'footnotes' ) ),
+ 'selection' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION, $l_arr_issue_solutions ),
'description-2-selection' => __( 'Option B is discouraged because disconnecting a label from its input element may compromise accessibility. This option is a last resort in case footnotes must absolutely stay inside the label. (Using jQuery \'event.stopPropagation\' failed.)', 'footnotes' ),
)
);
@@ -742,20 +745,20 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'mouse-over-box-display' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'mouse-over-box-display' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-enable' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED, __( 'Display tooltips:', 'footnotes' ) ),
- 'enable' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED, $l_arr_enabled ),
+ 'label-enable' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED, __( 'Display tooltips:', 'footnotes' ) ),
+ 'enable' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED, $l_arr_enabled ),
'notice-enable' => __( 'Formatted text boxes allowing hyperlinks, displayed on mouse-over or tap and hold.', 'footnotes' ),
- 'label-alternative' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, __( 'Display alternative tooltips:', 'footnotes' ) ),
- 'alternative' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, $l_arr_enabled ),
+ 'label-alternative' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, __( 'Display alternative tooltips:', 'footnotes' ) ),
+ 'alternative' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, $l_arr_enabled ),
'notice-alternative' => __( 'Intended to work around a configuration-related tooltip outage.', 'footnotes' ),
// Translators: %s: Footnotes plugin logo.
- 'description-alternative' => sprintf( __( 'These alternative tooltips work around a website related jQuery UI outage. They are low-script but use the AMP incompatible onmouseover and onmouseout arguments, along with CSS transitions for fade-in/out. The very small script is inserted after Footnotes\' internal stylesheet. When this option is enabled, %s does not load jQuery UI nor jQuery Tools.', 'footnotes' ), '' . Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '' ),
+ 'description-alternative' => sprintf( __( 'These alternative tooltips work around a website related jQuery UI outage. They are low-script but use the AMP incompatible onmouseover and onmouseout arguments, along with CSS transitions for fade-in/out. The very small script is inserted after Footnotes\' internal stylesheet. When this option is enabled, %s does not load jQuery UI nor jQuery Tools.', 'footnotes' ), '' . Includes\Config::C_STR_PLUGIN_PUBLIC_NAME . '' ),
)
);
@@ -792,24 +795,24 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'mouse-over-box-position' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'mouse-over-box-position' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-position' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, __( 'Position:', 'footnotes' ) ),
- 'position' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, $l_arr_position ),
- 'position-alternative' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION, $l_arr_alternative_position ),
+ 'label-position' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, __( 'Position:', 'footnotes' ) ),
+ 'position' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, $l_arr_position ),
+ 'position-alternative' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION, $l_arr_alternative_position ),
'notice-position' => __( 'The second column of settings boxes is for the alternative tooltips.', 'footnotes' ),
- 'label-offset-x' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, __( 'Horizontal offset:', 'footnotes' ) ),
- 'offset-x' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, -500, 500 ),
- 'offset-x-alternative' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X, -500, 500 ),
+ 'label-offset-x' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, __( 'Horizontal offset:', 'footnotes' ) ),
+ 'offset-x' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, -500, 500 ),
+ 'offset-x-alternative' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X, -500, 500 ),
'notice-offset-x' => __( 'pixels; negative value for a leftwards offset; alternative tooltips: direction depends on position', 'footnotes' ),
- 'label-offset-y' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, __( 'Vertical offset:', 'footnotes' ) ),
- 'offset-y' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, -500, 500 ),
- 'offset-y-alternative' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y, -500, 500 ),
+ 'label-offset-y' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, __( 'Vertical offset:', 'footnotes' ) ),
+ 'offset-y' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, -500, 500 ),
+ 'offset-y-alternative' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y, -500, 500 ),
'notice-offset-y' => __( 'pixels; negative value for an upwards offset; alternative tooltips: direction depends on position', 'footnotes' ),
)
@@ -828,14 +831,14 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
public function mouseover_box_dimensions() {
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'mouse-over-box-dimensions' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'mouse-over-box-dimensions' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-max-width' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, __( 'Maximum width:', 'footnotes' ) ),
- 'max-width' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, 0, 1280 ),
- 'width' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH, 0, 1280 ),
+ 'label-max-width' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, __( 'Maximum width:', 'footnotes' ) ),
+ 'max-width' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, 0, 1280 ),
+ 'width' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH, 0, 1280 ),
'notice-max-width' => __( 'pixels; set to 0 for jQuery tooltips without max width; alternative tooltips are given the value in the second box as fixed width.', 'footnotes' ),
)
@@ -854,25 +857,25 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
public function mouseover_box_timing() {
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'mouse-over-box-timing' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'mouse-over-box-timing' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-fade-in-delay' => $this->add_label( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY, __( 'Fade-in delay:', 'footnotes' ) ),
- 'fade-in-delay' => $this->add_num_box( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY, 0, 20000 ),
+ 'label-fade-in-delay' => $this->add_label( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY, __( 'Fade-in delay:', 'footnotes' ) ),
+ 'fade-in-delay' => $this->add_num_box( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY, 0, 20000 ),
'notice-fade-in-delay' => __( 'milliseconds', 'footnotes' ),
- 'label-fade-in-duration' => $this->add_label( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION, __( 'Fade-in duration:', 'footnotes' ) ),
- 'fade-in-duration' => $this->add_num_box( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION, 0, 20000 ),
+ 'label-fade-in-duration' => $this->add_label( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION, __( 'Fade-in duration:', 'footnotes' ) ),
+ 'fade-in-duration' => $this->add_num_box( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION, 0, 20000 ),
'notice-fade-in-duration' => __( 'milliseconds', 'footnotes' ),
- 'label-fade-out-delay' => $this->add_label( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY, __( 'Fade-out delay:', 'footnotes' ) ),
- 'fade-out-delay' => $this->add_num_box( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY, 0, 20000 ),
+ 'label-fade-out-delay' => $this->add_label( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY, __( 'Fade-out delay:', 'footnotes' ) ),
+ 'fade-out-delay' => $this->add_num_box( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY, 0, 20000 ),
'notice-fade-out-delay' => __( 'milliseconds', 'footnotes' ),
- 'label-fade-out-duration' => $this->add_label( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION, __( 'Fade-out duration:', 'footnotes' ) ),
- 'fade-out-duration' => $this->add_num_box( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION, 0, 20000 ),
+ 'label-fade-out-duration' => $this->add_label( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION, __( 'Fade-out duration:', 'footnotes' ) ),
+ 'fade-out-duration' => $this->add_num_box( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION, 0, 20000 ),
'notice-fade-out-duration' => __( 'milliseconds', 'footnotes' ),
)
@@ -896,21 +899,21 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'mouse-over-box-truncation' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'mouse-over-box-truncation' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-truncation' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED, __( 'Truncate the note in the tooltip:', 'footnotes' ) ),
- 'truncation' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED, $l_arr_enabled ),
+ 'label-truncation' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED, __( 'Truncate the note in the tooltip:', 'footnotes' ) ),
+ 'truncation' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED, $l_arr_enabled ),
- 'label-max-length' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, __( 'Maximum number of characters in the tooltip:', 'footnotes' ) ),
- 'max-length' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, 3, 10000 ),
+ 'label-max-length' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, __( 'Maximum number of characters in the tooltip:', 'footnotes' ) ),
+ 'max-length' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, 3, 10000 ),
// The feature trims back until the last full word.
'notice-max-length' => __( 'No weird cuts.', 'footnotes' ),
- 'label-readon' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL, __( '\'Read on\' button label:', 'footnotes' ) ),
- 'readon' => $this->add_text_box( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL ),
+ 'label-readon' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL, __( '\'Read on\' button label:', 'footnotes' ) ),
+ 'readon' => $this->add_text_box( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL ),
)
);
@@ -933,23 +936,23 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'mouse-over-box-text' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'mouse-over-box-text' );
// Replace all placeholders.
$l_obj_template->replace(
array(
'description-delimiter' => __( 'Tooltips can display another content than the footnote entry in the reference container. The trigger is a shortcode in the footnote text separating the tooltip text from the note. That is consistent with what WordPress does for excerpts.', 'footnotes' ),
- 'label-delimiter' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER, __( 'Delimiter for dedicated tooltip text:', 'footnotes' ) ),
- 'delimiter' => $this->add_text_box( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER ),
+ 'label-delimiter' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER, __( 'Delimiter for dedicated tooltip text:', 'footnotes' ) ),
+ 'delimiter' => $this->add_text_box( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER ),
'notice-delimiter' => __( 'If the delimiter shortcode is present, the tooltip text will be the part before it.', 'footnotes' ),
- 'label-mirror' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE, __( 'Mirror the tooltip in the reference container:', 'footnotes' ) ),
- 'mirror' => $this->add_select_box( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE, $l_arr_enabled ),
+ 'label-mirror' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE, __( 'Mirror the tooltip in the reference container:', 'footnotes' ) ),
+ 'mirror' => $this->add_select_box( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE, $l_arr_enabled ),
'notice-mirror' => __( 'Tooltips may be harder to use on mobiles. This option allows to read it in the reference container.', 'footnotes' ),
- 'label-separator' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR, __( 'Separator between tooltip text and footnote text:', 'footnotes' ) ),
- 'separator' => $this->add_text_box( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR ),
+ 'label-separator' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR, __( 'Separator between tooltip text and footnote text:', 'footnotes' ) ),
+ 'separator' => $this->add_text_box( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR ),
'notice-separator' => __( 'May be a simple space, or a line break <br />, or any string in your language.', 'footnotes' ),
'description-mirror' => __( 'Tooltips, even jQuery-driven, may be hard to consult on mobiles. This option allows to read the tooltip content in the reference container too.', 'footnotes' ),
@@ -985,42 +988,42 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'mouse-over-box-appearance' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'mouse-over-box-appearance' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-font-size' => $this->add_label( Footnotes_Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED, __( 'Set font size:', 'footnotes' ) ),
- 'font-size-enable' => $this->add_select_box( Footnotes_Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED, $l_arr_enabled ),
- 'font-size-scalar' => $this->add_num_box( Footnotes_Settings::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR, 0, 50, true ),
- 'font-size-unit' => $this->add_select_box( Footnotes_Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT, $l_arr_font_size_units ),
+ 'label-font-size' => $this->add_label( Includes\Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED, __( 'Set font size:', 'footnotes' ) ),
+ 'font-size-enable' => $this->add_select_box( Includes\Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED, $l_arr_enabled ),
+ 'font-size-scalar' => $this->add_num_box( Includes\Settings::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR, 0, 50, true ),
+ 'font-size-unit' => $this->add_select_box( Includes\Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT, $l_arr_font_size_units ),
'notice-font-size' => __( 'By default, the font size is set to equal the surrounding text.', 'footnotes' ),
- 'label-color' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR, __( 'Text color:', 'footnotes' ) ),
- 'color' => $this->add_color_selection( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR ),
+ 'label-color' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR, __( 'Text color:', 'footnotes' ) ),
+ 'color' => $this->add_color_selection( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR ),
// Translators: %s: Clear or leave empty.
'notice-color' => sprintf( __( 'To use the current theme\'s default text color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
- 'label-background' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND, __( 'Background color:', 'footnotes' ) ),
- 'background' => $this->add_color_selection( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND ),
+ 'label-background' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND, __( 'Background color:', 'footnotes' ) ),
+ 'background' => $this->add_color_selection( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND ),
// Translators: %s: Clear or leave empty.
'notice-background' => sprintf( __( 'To use the current theme\'s default background color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
- 'label-border-width' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, __( 'Border width:', 'footnotes' ) ),
- 'border-width' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, 0, 4, true ),
+ 'label-border-width' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, __( 'Border width:', 'footnotes' ) ),
+ 'border-width' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, 0, 4, true ),
'notice-border-width' => __( 'pixels; 0 for borderless', 'footnotes' ),
- 'label-border-color' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR, __( 'Border color:', 'footnotes' ) ),
- 'border-color' => $this->add_color_selection( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR ),
+ 'label-border-color' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR, __( 'Border color:', 'footnotes' ) ),
+ 'border-color' => $this->add_color_selection( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR ),
// Translators: %s: Clear or leave empty.
'notice-border-color' => sprintf( __( 'To use the current theme\'s default border color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
- 'label-border-radius' => $this->add_label( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, __( 'Rounded corner radius:', 'footnotes' ) ),
- 'border-radius' => $this->add_num_box( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, 0, 500 ),
+ 'label-border-radius' => $this->add_label( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, __( 'Rounded corner radius:', 'footnotes' ) ),
+ 'border-radius' => $this->add_num_box( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, 0, 500 ),
'notice-border-radius' => __( 'pixels; 0 for sharp corners', 'footnotes' ),
- 'label-box-shadow-color' => $this->add_label( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR, __( 'Box shadow color:', 'footnotes' ) ),
- 'box-shadow-color' => $this->add_color_selection( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR ),
+ 'label-box-shadow-color' => $this->add_label( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR, __( 'Box shadow color:', 'footnotes' ) ),
+ 'box-shadow-color' => $this->add_color_selection( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR ),
// Translators: %s: Clear or leave empty.
'notice-box-shadow-color' => sprintf( __( 'To use the current theme\'s default box shadow color: %s', 'footnotes' ), __( 'Clear or leave empty.', 'footnotes' ) ),
@@ -1039,13 +1042,13 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
*/
public function hyperlink_arrow() {
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'customize-hyperlink-arrow' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'customize-hyperlink-arrow' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-symbol' => $this->add_label( Footnotes_Settings::C_STR_HYPERLINK_ARROW, __( 'Select or input the backlink symbol:', 'footnotes' ) ),
- 'symbol-options' => $this->add_select_box( Footnotes_Settings::C_STR_HYPERLINK_ARROW, Footnotes_Convert::get_arrow() ),
- 'symbol-custom' => $this->add_text_box( Footnotes_Settings::C_STR_HYPERLINK_ARROW_USER_DEFINED ),
+ 'label-symbol' => $this->add_label( Includes\Settings::C_STR_HYPERLINK_ARROW, __( 'Select or input the backlink symbol:', 'footnotes' ) ),
+ 'symbol-options' => $this->add_select_box( Includes\Settings::C_STR_HYPERLINK_ARROW, Includes\Convert::get_arrow() ),
+ 'symbol-custom' => $this->add_text_box( Includes\Settings::C_STR_HYPERLINK_ARROW_USER_DEFINED ),
'notice-symbol' => __( 'Your input overrides the selection.', 'footnotes' ),
'description-symbol' => __( 'This symbol is used in the reference container. But this setting pre-existed under this tab and cannot be moved to another one.', 'footnotes' ),
)
@@ -1063,12 +1066,12 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
*/
public function custom_css() {
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'customize-css' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'customize-css' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-css' => $this->add_label( Footnotes_Settings::C_STR_CUSTOM_CSS, __( 'Your existing Custom CSS code:', 'footnotes' ) ),
- 'css' => $this->add_textarea( Footnotes_Settings::C_STR_CUSTOM_CSS ),
+ 'label-css' => $this->add_label( Includes\Settings::C_STR_CUSTOM_CSS, __( 'Your existing Custom CSS code:', 'footnotes' ) ),
+ 'css' => $this->add_textarea( Includes\Settings::C_STR_CUSTOM_CSS ),
'description-css' => __( 'Custom CSS migrates to a dedicated tab. This text area is intended to keep your data safe, and the code remains valid while visible. Please copy-paste the content into the new text area under the new tab.', 'footnotes' ),
// phpcs:disable Squiz.PHP.CommentedOutCode.Found
@@ -1110,16 +1113,16 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'customize-css-migration' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'customize-css-migration' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'label-css' => $this->add_label( Footnotes_Settings::C_STR_CUSTOM_CSS, __( 'Your existing Custom CSS code:', 'footnotes' ) ),
- 'css' => $this->add_textarea( Footnotes_Settings::C_STR_CUSTOM_CSS ),
+ 'label-css' => $this->add_label( Includes\Settings::C_STR_CUSTOM_CSS, __( 'Your existing Custom CSS code:', 'footnotes' ) ),
+ 'css' => $this->add_textarea( Includes\Settings::C_STR_CUSTOM_CSS ),
'description-css' => __( 'Custom CSS migrates to a dedicated tab. This text area is intended to keep your data safe, and the code remains valid while visible. Please copy-paste the content into the new text area below. Set Show legacy to No. Save twice.', 'footnotes' ),
- 'label-show-legacy' => $this->add_label( Footnotes_Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE, 'Show legacy Custom CSS settings containers:' ),
- 'show-legacy' => $this->add_select_box( Footnotes_Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE, $l_arr_enabled ),
+ 'label-show-legacy' => $this->add_label( Includes\Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE, 'Show legacy Custom CSS settings containers:' ),
+ 'show-legacy' => $this->add_select_box( Includes\Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE, $l_arr_enabled ),
'notice-show-legacy' => __( 'Please set to No when you are done migrating, for the legacy Custom CSS containers to disappear.', 'footnotes' ),
// Translators: %s: Referres and tooltips.
'description-show-legacy' => sprintf( __( 'The legacy Custom CSS under the %s tab and its mirror here are emptied, and the select box saved as No, when the settings tab is saved while the settings container is not displayed.', 'footnotes' ), __( 'Referrers and tooltips', 'footnotes' ) ),
@@ -1139,11 +1142,11 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
*/
public function custom_css_new() {
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'customize-css-new' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'customize-css-new' );
// Replace all placeholders.
$l_obj_template->replace(
array(
- 'css' => $this->add_textarea( Footnotes_Settings::C_STR_CUSTOM_CSS_NEW ),
+ 'css' => $this->add_textarea( Includes\Settings::C_STR_CUSTOM_CSS_NEW ),
'headline' => $this->add_text( __( 'Recommended CSS classes:', 'footnotes' ) ),
@@ -1169,7 +1172,7 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
*/
public function lookup_hooks() {
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'expert-lookup' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'expert-lookup' );
// Replace all placeholders.
$l_obj_template->replace(
@@ -1186,29 +1189,29 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
'head-numbox' => __( 'Priority level', 'footnotes' ),
'head-url' => __( 'WordPress documentation', 'footnotes' ),
- 'label-the-title' => $this->add_label( Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_TITLE, 'the_title' ),
- 'the-title' => $this->add_checkbox( Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_TITLE ),
- 'priority-the-title' => $this->add_num_box( Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL, -1, PHP_INT_MAX ),
+ 'label-the-title' => $this->add_label( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_TITLE, 'the_title' ),
+ 'the-title' => $this->add_checkbox( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_TITLE ),
+ 'priority-the-title' => $this->add_num_box( Includes\Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL, -1, PHP_INT_MAX ),
'url-the-title' => 'https://developer.wordpress.org/reference/hooks/the_title/',
- 'label-the-content' => $this->add_label( Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_CONTENT, 'the_content' ),
- 'the-content' => $this->add_checkbox( Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_CONTENT ),
- 'priority-the-content' => $this->add_num_box( Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL, -1, PHP_INT_MAX ),
+ 'label-the-content' => $this->add_label( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_CONTENT, 'the_content' ),
+ 'the-content' => $this->add_checkbox( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_CONTENT ),
+ 'priority-the-content' => $this->add_num_box( Includes\Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL, -1, PHP_INT_MAX ),
'url-the-content' => 'https://developer.wordpress.org/reference/hooks/the_content/',
- 'label-the-excerpt' => $this->add_label( Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_EXCERPT, 'the_excerpt' ),
- 'the-excerpt' => $this->add_checkbox( Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_EXCERPT ),
- 'priority-the-excerpt' => $this->add_num_box( Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL, -1, PHP_INT_MAX ),
+ 'label-the-excerpt' => $this->add_label( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_EXCERPT, 'the_excerpt' ),
+ 'the-excerpt' => $this->add_checkbox( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_EXCERPT ),
+ 'priority-the-excerpt' => $this->add_num_box( Includes\Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL, -1, PHP_INT_MAX ),
'url-the-excerpt' => 'https://developer.wordpress.org/reference/functions/the_excerpt/',
- 'label-widget-title' => $this->add_label( Footnotes_Settings::C_STR_EXPERT_LOOKUP_WIDGET_TITLE, 'widget_title' ),
- 'widget-title' => $this->add_checkbox( Footnotes_Settings::C_STR_EXPERT_LOOKUP_WIDGET_TITLE ),
- 'priority-widget-title' => $this->add_num_box( Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL, -1, PHP_INT_MAX ),
+ 'label-widget-title' => $this->add_label( Includes\Settings::C_STR_EXPERT_LOOKUP_WIDGET_TITLE, 'widget_title' ),
+ 'widget-title' => $this->add_checkbox( Includes\Settings::C_STR_EXPERT_LOOKUP_WIDGET_TITLE ),
+ 'priority-widget-title' => $this->add_num_box( Includes\Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL, -1, PHP_INT_MAX ),
'url-widget-title' => 'https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_title',
- 'label-widget-text' => $this->add_label( Footnotes_Settings::C_STR_EXPERT_LOOKUP_WIDGET_TEXT, 'widget_text' ),
- 'widget-text' => $this->add_checkbox( Footnotes_Settings::C_STR_EXPERT_LOOKUP_WIDGET_TEXT ),
- 'priority-widget-text' => $this->add_num_box( Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL, -1, PHP_INT_MAX ),
+ 'label-widget-text' => $this->add_label( Includes\Settings::C_STR_EXPERT_LOOKUP_WIDGET_TEXT, 'widget_text' ),
+ 'widget-text' => $this->add_checkbox( Includes\Settings::C_STR_EXPERT_LOOKUP_WIDGET_TEXT ),
+ 'priority-widget-text' => $this->add_num_box( Includes\Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL, -1, PHP_INT_MAX ),
'url-widget-text' => 'https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_text',
)
);
@@ -1226,13 +1229,13 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
public function Help() {
global $footnotes;
// Load footnotes starting and end tag.
- $l_arr_footnote_starting_tag = $this->load_setting( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
- $l_arr_footnote_ending_tag = $this->load_setting( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
+ $l_arr_footnote_starting_tag = $this->load_setting( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
+ $l_arr_footnote_ending_tag = $this->load_setting( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
if ( 'userdefined' === $l_arr_footnote_starting_tag['value'] || 'userdefined' === $l_arr_footnote_ending_tag['value'] ) {
// Load user defined starting and end tag.
- $l_arr_footnote_starting_tag = $this->load_setting( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
- $l_arr_footnote_ending_tag = $this->load_setting( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
+ $l_arr_footnote_starting_tag = $this->load_setting( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
+ $l_arr_footnote_ending_tag = $this->load_setting( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
}
$l_str_example = 'Hello' . $l_arr_footnote_starting_tag['value'] .
'Sed ut perspiciatis, unde omnis iste natus error ' .
@@ -1250,7 +1253,7 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
$l_arr_footnote_ending_tag['value'] . ' World!';
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'how-to-help' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'how-to-help' );
// Replace all placeholders.
$l_obj_template->replace(
array(
@@ -1267,7 +1270,7 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
);
/*
- * Call {@see Footnotes_Parser::footnotes_output_head()} function to get
+ * Call {@see Includes\Parser::footnotes_output_head()} function to get
* the styling of the mouse-over box.
*
* The name of the callback function ought to be distinct from
@@ -1289,7 +1292,7 @@ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine {
*/
public function donate() {
// Load template file.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_DASHBOARD, 'how-to-donate' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'how-to-donate' );
// Replace all placeholders.
$l_obj_template->replace(
array(
diff --git a/src/footnotes.php b/src/footnotes.php
index 3d93e39..40ad273 100755
--- a/src/footnotes.php
+++ b/src/footnotes.php
@@ -7,10 +7,8 @@
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
- * @package footnotes
- * @license GPL-3.0-only
- * @copyright 2021 Mark Cheret (email: mark@cheret.de)
- * @since 1.0.0
+ * @package footnotes
+ * @since 1.0.0
*
* @wordpress-plugin
* Plugin Name: footnotes
@@ -27,6 +25,9 @@
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
+namespace footnotes;
+
+
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
@@ -37,9 +38,10 @@ if ( ! defined( 'WPINC' ) ) {
*
* @link https://github.com/markcheret/footnotes/wiki/Versioning Versioning Guide
*
- * @since 2.1.4
- * @todo Draw from envfile rather than hard-coding.
- * @var string PLUGIN_VERSION The version of this instance of the plugin.
+ * @since 2.1.4
+ * @todo Draw from envfile rather than hard-coding.
+ *
+ * @global string PLUGIN_VERSION The version of this instance of the plugin.
*/
define( 'PLUGIN_VERSION', '2.8.0d' );
@@ -49,41 +51,46 @@ define( 'PLUGIN_VERSION', '2.8.0d' );
* This primarily affects whether minified or unminified CSS/JS files are
* requested.
*
- * @since 2.5.5
- * @todo Draw from envfile rather than hard-coding.
- * @todo Replace with string for >2 environment options.
- * @var bool PRODUCTION_ENV Whether the plugin is running in production mode or not. Default `false`.
+ * @since 2.5.5
+ * @todo Draw from envfile rather than hard-coding.
+ * @todo Replace with string for >2 environment options.
+ *
+ * @global bool PRODUCTION_ENV Whether the plugin is running in production mode or not.
*/
define( 'PRODUCTION_ENV', false );
/**
* Handles the activation of the plugin.
*
- * @since 2.8.0
- * @see Footnotes_Activator::activate()
+ * @since 2.8.0
+ * @see includes\Activator::activate()
+ *
+ * @return void
*/
function activate_footnotes() {
/**
* Provides plugin activation functionality.
*/
- require_once plugin_dir_path( __FILE__ ) . 'includes/class-footnotes-activator.php';
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-activator.php';
- Footnotes_Activator::activate();
+ includes\Activator::activate();
}
/**
* Handles the deactivation of the plugin.
*
- * @since 2.8.0
- * @see Footnotes_Deactivator::deactivate()
+ * @since 2.8.0
+ * @see includes\Deactivator::deactivate()
+ *
+ * @return void
*/
function deactivate_footnotes() {
/**
* Provides plugin deactivation functionality.
*/
- require_once plugin_dir_path( __FILE__ ) . 'includes/class-footnotes-deactivator.php';
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-deactivator.php';
- Footnotes_Deactivator::deactivate();
+ includes\Deactivator::deactivate();
}
register_activation_hook( __FILE__, 'activate_footnotes' );
@@ -93,7 +100,7 @@ register_deactivation_hook( __FILE__, 'deactivate_footnotes' );
* The core plugin class that defines internationalization, admin-specific and
* public-facing site hooks and functionality.
*/
-require plugin_dir_path( __FILE__ ) . 'includes/class-footnotes.php';
+require_once plugin_dir_path( __FILE__ ) . 'includes/class-core.php';
/**
* Begins execution of the plugin.
@@ -101,11 +108,18 @@ require plugin_dir_path( __FILE__ ) . 'includes/class-footnotes.php';
* Since everything within the plugin is registered via hooks, then kicking off
* the plugin from this point in the file does not affect the page life cycle.
*
- * @since 2.8.0
+ * @since 2.8.0
+ *
+ * @return void
*/
function run_footnotes() {
+ /**
+ * The plugin core.
+ *
+ * @global includes\Core $footnotes
+ */
global $footnotes;
- $footnotes = new Footnotes();
+ $footnotes = new includes\Core();
$footnotes->run();
}
run_footnotes();
diff --git a/src/includes/class-activator.php b/src/includes/class-activator.php
new file mode 100644
index 0000000..d8f9380
--- /dev/null
+++ b/src/includes/class-activator.php
@@ -0,0 +1,53 @@
+footnotes';
@@ -45,44 +64,44 @@ class Footnotes_Config {
* The only working solution found so far is using `position:fixed` in one heading
* that isn't translated, and dropping the logo in another, translatable heading.
*
- * @var string
- *
- * @since 2.0.4
- * @todo Remove.
+ * @since 2.0.4
+ * @todo Remove.
* @deprecated
+ *
+ * @var string
*/
const C_STR_PLUGIN_HEADING_NAME = 'footnotes';
/**
* HTML element for the ‘love’ symbol.
*
- * @var string
- *
- * @since 1.5.0
- * @todo Remove.
+ * @since 1.5.0
+ * @todo Remove.
* @deprecated
+ *
+ * @var string
*/
const C_STR_LOVE_SYMBOL = '♥';
/**
* HTML element for the ‘love’ symbol used in dashboard heading
*
- * @var string
- *
- * @since 2.0.4
- * @todo Remove.
+ * @since 2.0.4
+ * @todo Remove.
* @deprecated
+ *
+ * @var string
*/
const C_STR_LOVE_SYMBOL_HEADING = '♥';
/**
* Shortcode to NOT display the ‘LOVE ME’ slug on certain pages.
*
- * @var string
- *
- * @since 1.5.0
- * @todo Remove.
+ * @since 1.5.0
+ * @todo Remove.
* @deprecated
+ *
+ * @var string
*/
const C_STR_NO_LOVE_SLUG = '[[no footnotes: love]]';
}
diff --git a/src/includes/class-footnotes-convert.php b/src/includes/class-convert.php
similarity index 95%
rename from src/includes/class-footnotes-convert.php
rename to src/includes/class-convert.php
index 2752df9..02509e7 100644
--- a/src/includes/class-footnotes-convert.php
+++ b/src/includes/class-convert.php
@@ -1,24 +1,21 @@
loader = new Footnotes_Loader();
+ $this->loader = new Loader();
}
/**
* Define the locale for this plugin for internationalization.
*
- * Uses {@see Footnotes_i18n} in order to set the domain and to
+ * Uses {@see i18n} in order to set the domain and to
* register the hook with WordPress.
*
* @since 2.8.0
- * @uses Footnotes_i18n Handles initialization functions.
+ * @uses i18n Handles initialization functions.
*
* @return void
*/
private function set_locale() {
- $plugin_i18n = new Footnotes_i18n();
+ $plugin_i18n = new i18n();
$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
@@ -158,19 +181,19 @@ class Footnotes {
* plugin.
*
* @since 1.5.0
- * @since 2.8.0 Moved hook registrations from various classes into `Footnotes_Admin`.
- * @uses Footnotes_Admin Defines admin functionality.
+ * @since 2.8.0 Moved hook registrations from various classes into `Admin\Admin`.
+ * @see Admin\Admin Defines admin functionality.
*
* @return void
*/
private function define_admin_hooks() {
- $plugin_admin = new Footnotes_Admin( $this->get_plugin_name(), $this->get_version() );
+ $plugin_admin = new Admin\Admin( $this->get_plugin_name(), $this->get_version() );
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
- $this->loader->add_filter( 'plugin_action_links_footnotes/footnotes.php', $plugin_admin, 'footnotes_action_links' );
+ $this->loader->add_filter( 'plugin_action_links_footnotes/footnotes.php', $plugin_admin, 'action_links' );
$this->loader->add_filter( 'mce_buttons', $plugin_admin->wysiwyg, 'new_visual_editor_button' );
$this->loader->add_action( 'admin_print_footer_scripts', $plugin_admin->wysiwyg, 'new_plain_text_editor_button' );
@@ -190,13 +213,13 @@ class Footnotes {
* the plugin.
*
* @since 2.8.0
- * @uses Footnotes_Admin Defines public-facing functionality.
+ * @see General\General Defines public-facing functionality.
*
* @return void
*/
private function define_public_hooks() {
- $plugin_public = new Footnotes_Public( $this->get_plugin_name(), $this->get_version() );
+ $plugin_public = new General\General( $this->get_plugin_name(), $this->get_version() );
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
@@ -230,7 +253,7 @@ class Footnotes {
*
* @since 2.8.0
*/
- public function get_loader(): Footnotes_Loader {
+ public function get_loader(): Loader {
return $this->loader;
}
diff --git a/src/includes/class-footnotes-deactivator.php b/src/includes/class-deactivator.php
similarity index 57%
rename from src/includes/class-footnotes-deactivator.php
rename to src/includes/class-deactivator.php
index 4514089..ab0f437 100644
--- a/src/includes/class-footnotes-deactivator.php
+++ b/src/includes/class-deactivator.php
@@ -1,31 +1,29 @@
load_dependencies();
// Set conditions re-used for stylesheet enqueuing and in class/task.php.
- self::$a_bool_amp_enabled = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE ) );
- self::$a_bool_tooltips_enabled = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED ) );
- self::$a_bool_alternative_tooltips_enabled = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE ) );
- self::$a_str_script_mode = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE );
+ self::$a_bool_amp_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_AMP_COMPATIBILITY_ENABLE ) );
+ self::$a_bool_tooltips_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED ) );
+ self::$a_bool_alternative_tooltips_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE ) );
+ self::$a_str_script_mode = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE );
}
/**
@@ -123,23 +126,23 @@ class Footnotes_Public {
* Include the following files that provide the public-facing functionality
* of this plugin:
*
- * - {@see Footnotes_Parser}: parses Posts and Pages for footnote shortcodes; and
- * - {@see Footnotes_Widget_Reference_Container}: defines the Reference Container widget.
+ * - {@see Parser}: parses Posts and Pages for footnote shortcodes; and
+ * - {@see Widget\Reference_Container}: defines the Reference Container widget.
*
* @since 2.8.0
*/
private function load_dependencies() {
// TODO: neaten up and document once placements and names are settled.
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-footnotes-config.php';
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-footnotes-settings.php';
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-footnotes-convert.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-config.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-settings.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-convert.php';
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-footnotes-parser.php';
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/widget/class-footnotes-widget-reference-container.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-parser.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/widget/class-reference-container.php';
- $this->reference_container_widget = new Footnotes_Widget_Reference_Container( $this->plugin_name );
+ $this->reference_container_widget = new Widget\Reference_Container( $this->plugin_name );
- $this->a_obj_task = new Footnotes_Parser();
+ $this->a_obj_task = new Parser();
}
/**
@@ -150,7 +153,7 @@ class Footnotes_Public {
*
* @since 1.5.0
* @since 2.5.5 Change stylesheet schema.
- * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Includes\Public}.
*/
public function enqueue_styles() {
if ( PRODUCTION_ENV ) {
@@ -176,7 +179,7 @@ class Footnotes_Public {
}
// Set basic responsive page layout mode for use in stylesheet name.
- $l_str_page_layout_option = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT );
+ $l_str_page_layout_option = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT );
switch ( $l_str_page_layout_option ) {
case 'reference-container':
$l_str_layout_mode = '1';
@@ -215,7 +218,7 @@ class Footnotes_Public {
* @since 2.0.0 Add jQueryUI dependency.
* @since 2.1.2 Add jQuery Tools dependency.
* @since 2.5.6 Add jQuery dependency.
- * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Includes\Public}.
*/
public function enqueue_scripts() {
/*
@@ -264,7 +267,7 @@ class Footnotes_Public {
* Register the widget(s) for the public-facing side of the site.
*
* @since 1.5.0
- * @since 2.8.0 Moved from {@see Footnotes} to {@see Footnotes_Public}.
+ * @since 2.8.0 Moved from {@see Footnotes} to {@see Includes\Public}.
*/
public function register_widgets() {
register_widget( $this->reference_container_widget );
diff --git a/src/public/class-footnotes-parser.php b/src/public/class-parser.php
similarity index 74%
rename from src/public/class-footnotes-parser.php
rename to src/public/class-parser.php
index 9ae74f0..43b09b5 100644
--- a/src/public/class-footnotes-parser.php
+++ b/src/public/class-parser.php
@@ -2,43 +2,46 @@
/**
* Includes the core function of the Plugin - Search and Replace the Footnotes.
*
- * @package footnotes\public
- * @since 1.5.0
- * @since 2.0.5 Enable all hoooks by default.
- * @since 2.8.0 Rename file from `task.php` to `class-footnotes-parser.php`,
+ * @package footnotes
+ * @since 1.5.0
+ * @since 2.0.5 Enable all hoooks by default.
+ * @since 2.8.0 Rename file from `task.php` to `class-footnotes-parser.php`,
* move from `class/` sub-directory to `public/`.
*/
+
+namespace footnotes\general;
+use footnotes\includes as Includes;
/**
* Searches and replaces the footnotes and generates the reference container.
*
- * @package footnotes\public
- * @since 1.5.0
- * @since 2.8.0 Rename class from `Footnotes_Task` to `Footnotes_Parser`.
+ * @package footnotes
+ * @since 1.5.0
+ * @since 2.8.0 Rename class from `Footnotes_Task` to `Parser`.
*/
-class Footnotes_Parser {
+class Parser {
/**
* Contains all footnotes found in the searched content.
*
- * @since 1.5.0
- * @var string[]
+ * @since 1.5.0
+ * @var string[]
*/
public static $a_arr_footnotes = array();
/**
* Flag if the display of 'LOVE FOOTNOTES' is allowed on the current public page.
*
- * @since 1.5.0
- * @var bool
+ * @since 1.5.0
+ * @var bool
*/
public static $a_bool_allow_love_me = true;
/**
* Prefix for the Footnote html element ID.
*
- * @since 1.5.8
- * @var string
+ * @since 1.5.8
+ * @var string
*/
public static $a_str_prefix = '';
@@ -48,8 +51,8 @@ class Footnotes_Parser {
* As multiple posts are appended to each other, functions and fragment IDs must be disambiguated.
* post ID to make everything unique wrt infinite scroll and archive view.
*
- * @since 2.0.6
- * @var int
+ * @since 2.0.6
+ * @var int
*/
public static $a_int_post_id = 0;
@@ -60,8 +63,8 @@ class Footnotes_Parser {
* as they may occur when the widget_text hook is active and the page
* is built with Elementor and has an accordion or similar toggle sections.
*
- * @since 2.2.9
- * @var int Incremented every time after a reference container is inserted.
+ * @since 2.2.9
+ * @var int Incremented every time after a reference container is inserted.
*/
public static $a_int_reference_container_id = 1;
@@ -70,43 +73,43 @@ class Footnotes_Parser {
*
* A property because used both in {@see search()} and {@see reference_container()}.
*
- * @since 2.0.0
- * @var bool
+ * @since 2.0.0
+ * @var bool
*/
public static $a_bool_hard_links_enabled = false;
/**
* The referrer slug.
*
- * @since 2.3.0
- * @var string
+ * @since 2.3.0
+ * @var string
*/
public static $a_str_referrer_link_slug = 'r';
/**
* The footnote slug.
*
- * @since 2.3.0
+ * @since 2.3.0
*
- * @var string
+ * @var string
*/
public static $a_str_footnote_link_slug = 'f';
/**
* The slug and identifier separator.
*
- * @since 2.3.0
+ * @since 2.3.0
*
- * @var string
+ * @var string
*/
private static $a_str_link_ids_separator = '+';
/**
* Contains the concatenated fragment ID base.
*
- * @since 2.3.0
+ * @since 2.3.0
*
- * @var string
+ * @var string
*/
public static $a_str_post_container_id_compound = '';
@@ -117,8 +120,8 @@ class Footnotes_Parser {
* Scroll offset may now need to get into inline CSS.
* Hence it needs to be loaded twice, because priority levels may not match.
*
- * @since 2.1.4
- * @var int
+ * @since 2.1.4
+ * @var int
*/
public static $a_int_scroll_offset = 34;
@@ -144,27 +147,27 @@ class Footnotes_Parser {
/**
* The span element name.
*
- * @since 2.3.0
- * @todo Remove.
- * @var string
+ * @since 2.3.0
+ * @todo Remove.
+ * @var string
*/
public static $a_str_link_span = 'span';
/**
* The opening tag.
*
- * @since 2.3.0
- * @todo Remove.
- * @var string
+ * @since 2.3.0
+ * @todo Remove.
+ * @var string
*/
public static $a_str_link_open_tag = '';
/**
* The closing tag.
*
- * @since 2.3.0
- * @todo Remove.
- * @var string
+ * @since 2.3.0
+ * @todo Remove.
+ * @var string
*/
public static $a_str_link_close_tag = '';
@@ -180,60 +183,60 @@ class Footnotes_Parser {
/**
* The tooltip delimiter shortcode.
*
- * @since 2.5.2
- * @var string
+ * @since 2.5.2
+ * @var string
*/
public static $a_str_tooltip_shortcode = '[[/tooltip]]';
/**
* The tooltip delimiter shortcode length.
*
- * @since 2.5.2
- * @var int
+ * @since 2.5.2
+ * @var int
*/
public static $a_int_tooltip_shortcode_length = 12;
/**
* Whether to mirror the tooltip text in the reference container.
*
- * @since 2.5.2
- * @var bool
+ * @since 2.5.2
+ * @var bool
*/
public static $a_bool_mirror_tooltip_text = false;
/**
* Footnote delimiter start short code.
*
- * @since 1.5.0
- * @since 2.6.2 Move from constant to class property.
- * @var string
+ * @since 1.5.0
+ * @since 2.6.2 Move from constant to class property.
+ * @var string
*/
public static $a_str_start_tag = '';
/**
* Footnote delimiter end short code.
*
- * @since 1.5.0
- * @since 2.6.2 Move from constant to class property.
- * @var string
+ * @since 1.5.0
+ * @since 2.6.2 Move from constant to class property.
+ * @var string
*/
public static $a_str_end_tag = '';
/**
* Footnote delimiter start short code in RegEx format.
*
- * @since 2.4.0
- * @since 2.6.2 Move from global constant to class property.
- * @var string
+ * @since 2.4.0
+ * @since 2.6.2 Move from global constant to class property.
+ * @var string
*/
public static $a_str_start_tag_regex = '';
/**
* Footnote delimiter end short code in RegEx format.
*
- * @since 2.4.0
- * @since 2.6.2 Move from global constant to class property.
- * @var string
+ * @since 2.4.0
+ * @since 2.6.2 Move from global constant to class property.
+ * @var string
*/
public static $a_str_end_tag_regex = '';
@@ -248,45 +251,45 @@ class Footnotes_Parser {
* is considered a design flaw, and the feature is released as a bug fix after overdue 2.3.0
* released in urgency to provide AMP compat before 2021.
*
- * @since 2.4.0
- * @var bool
+ * @since 2.4.0
+ * @var bool
*/
public static $a_bool_syntax_error_flag = true;
/**
* Initialize the class and set its properties.
*
- * @since 2.8.0
- * @todo Reorganise dependencies.
- * @todo Move call to `register_hooks()` to {@see Footnotes_Public}.
+ * @since 2.8.0
+ * @todo Reorganise dependencies.
+ * @todo Move call to `register_hooks()` to {@see General}.
*/
public function __construct() {
// TODO: Reorg dependencies.
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-footnotes-config.php';
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-footnotes-convert.php';
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-footnotes-settings.php';
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-footnotes-template.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-config.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-convert.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-settings.php';
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-template.php';
- // TODO: Move to `Footnotes_Public`.
+ // TODO: Move to `General`.
$this->register_hooks();
}
/**
* Register WordPress hooks to replace Footnotes in the content of a public page.
*
- * @since 1.5.0
- * @since 1.5.4 Add support for @see 'the_post' hook.
- * @since 2.0.5 Enable all hooks by default.
- * @since 2.1.0 Remove @see 'the_post' support.
- * @todo Move to {@see Footnotes_Public}.
+ * @since 1.5.0
+ * @since 1.5.4 Add support for @see 'the_post' hook.
+ * @since 2.0.5 Enable all hooks by default.
+ * @since 2.1.0 Remove @see 'the_post' support.
+ * @todo Move to {@see General}.
*/
public function register_hooks() {
// Get values from settings.
- $l_int_the_title_priority = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL ) );
- $l_int_the_content_priority = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL ) );
- $l_int_the_excerpt_priority = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL ) );
- $l_int_widget_title_priority = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL ) );
- $l_int_widget_text_priority = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL ) );
+ $l_int_the_title_priority = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL ) );
+ $l_int_the_content_priority = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL ) );
+ $l_int_the_excerpt_priority = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL ) );
+ $l_int_widget_title_priority = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL ) );
+ $l_int_widget_text_priority = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL ) );
// PHP_INT_MAX can be set by -1.
$l_int_the_title_priority = ( -1 === $l_int_the_title_priority ) ? PHP_INT_MAX : $l_int_the_title_priority;
@@ -301,12 +304,12 @@ class Footnotes_Parser {
// Append the love and share me slug to the footer.
add_filter( 'wp_footer', array( $this, 'footnotes_output_footer' ), PHP_INT_MAX );
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_TITLE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_TITLE ) ) ) {
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 ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_CONTENT ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_CONTENT ) ) ) {
add_filter( 'the_content', array( $this, 'footnotes_in_content' ), $l_int_the_content_priority );
/**
@@ -319,7 +322,7 @@ class Footnotes_Parser {
*
* @link https://docs.woocommerce.com/document/allow-html-in-term-category-tag-descriptions/
*
- * @since 2.5.0
+ * @since 2.5.0
*/
add_filter( 'term_description', array( $this, 'footnotes_in_content' ), $l_int_the_content_priority );
@@ -331,31 +334,31 @@ class Footnotes_Parser {
* @reporter @squatcher
* @link https://wordpress.org/support/topic/footnotes-use-in-popup-maker/
*
- * @since 2.5.1
+ * @since 2.5.1
*/
add_filter( 'pum_popup_content', array( $this, 'footnotes_in_content' ), $l_int_the_content_priority );
}
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_EXPERT_LOOKUP_THE_EXCERPT ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_EXCERPT ) ) ) {
/**
* Adds a filter to the excerpt hook.
*
- * @since 1.5.0 The hook @see 'get_the_excerpt' is filtered too.
- * @since 1.5.5 The hook @see 'get_the_excerpt' is removed but not documented in changelog or docblock.
- * @since 2.6.2 The hook @see 'get_the_excerpt' is readded when attempting to debug excerpt handling.
- * @since 2.6.6 The hook @see 'get_the_excerpt' is removed again because it seems to cause issues in some themes.
+ * @since 1.5.0 The hook @see 'get_the_excerpt' is filtered too.
+ * @since 1.5.5 The hook @see 'get_the_excerpt' is removed but not documented in changelog or docblock.
+ * @since 2.6.2 The hook @see 'get_the_excerpt' is readded when attempting to debug excerpt handling.
+ * @since 2.6.6 The hook @see 'get_the_excerpt' is removed again because it seems to cause issues in some themes.
*/
add_filter( 'the_excerpt', array( $this, 'footnotes_in_excerpt' ), $l_int_the_excerpt_priority );
}
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_EXPERT_LOOKUP_WIDGET_TITLE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_EXPERT_LOOKUP_WIDGET_TITLE ) ) ) {
/**
* TODO
*/
add_filter( 'widget_title', array( $this, 'footnotes_in_widget_title' ), $l_int_widget_title_priority );
}
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_EXPERT_LOOKUP_WIDGET_TEXT ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_EXPERT_LOOKUP_WIDGET_TEXT ) ) ) {
/**
* TODO
*/
@@ -370,8 +373,8 @@ class Footnotes_Parser {
/**
* Outputs the custom css to the header of the public page.
*
- * @since 1.5.0
- * @todo Refactor to enqueue stylesheets properly in {@see Footnotes_Public}.
+ * @since 1.5.0
+ * @todo Refactor to enqueue stylesheets properly in {@see General}.
*/
public function footnotes_output_head() {
@@ -383,7 +386,7 @@ class Footnotes_Parser {
*
* Native smooth scrolling only works in recent browsers.
*/
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING ) ) ) {
echo "html {scroll-behavior: smooth;}\r\n";
}
@@ -393,7 +396,7 @@ class Footnotes_Parser {
* Cannot be included in external stylesheet, as it is only optional.
* The scope is variable too: referrers only, or all superscript elements.
*/
- $l_str_normalize_superscript = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT );
+ $l_str_normalize_superscript = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT );
if ( 'no' !== $l_str_normalize_superscript ) {
if ( 'all' === $l_str_normalize_superscript ) {
echo 'sup {';
@@ -404,14 +407,14 @@ class Footnotes_Parser {
}
// Reference container display on home page.
- if ( ! Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE ) ) ) {
+ if ( ! Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE ) ) ) {
echo ".home .footnotes_reference_container { display: none; }\r\n";
}
// Reference container top and bottom margins.
- $l_int_reference_container_top_margin = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_REFERENCE_CONTAINER_TOP_MARGIN ) );
- $l_int_reference_container_bottom_margin = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_REFERENCE_CONTAINER_BOTTOM_MARGIN ) );
+ $l_int_reference_container_top_margin = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_REFERENCE_CONTAINER_TOP_MARGIN ) );
+ $l_int_reference_container_bottom_margin = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_REFERENCE_CONTAINER_BOTTOM_MARGIN ) );
echo '.footnotes_reference_container {margin-top: ';
echo empty( $l_int_reference_container_top_margin ) ? '0' : $l_int_reference_container_top_margin;
echo 'px !important; margin-bottom: ';
@@ -419,9 +422,9 @@ class Footnotes_Parser {
echo "px !important;}\r\n";
// Reference container label bottom border.
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER ) ) ) {
echo '.footnote_container_prepare > ';
- echo Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT );
+ echo Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT );
echo " {border-bottom: 1px solid #aaaaaa !important;}\r\n";
}
@@ -434,7 +437,7 @@ class Footnotes_Parser {
* issues as browsers won’t reload these style sheets after settings are
* changed while the version string is not.
*/
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_ROW_BORDERS_ENABLE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_ROW_BORDERS_ENABLE ) ) ) {
echo '.footnotes_table, .footnotes_plugin_reference_row {';
echo 'border: 1px solid #060606;';
echo " !important;}\r\n";
@@ -444,16 +447,16 @@ class Footnotes_Parser {
}
// Ref container first column width and max-width.
- $l_bool_column_width_enabled = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED ) );
- $l_bool_column_max_width_enabled = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED ) );
+ $l_bool_column_width_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED ) );
+ $l_bool_column_max_width_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED ) );
if ( $l_bool_column_width_enabled || $l_bool_column_max_width_enabled ) {
echo '.footnote-reference-container { table-layout: fixed; }';
echo '.footnote_plugin_index, .footnote_plugin_index_combi {';
if ( $l_bool_column_width_enabled ) {
- $l_int_column_width_scalar = Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR );
- $l_str_column_width_unit = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT );
+ $l_int_column_width_scalar = Includes\Settings::instance()->get( Includes\Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR );
+ $l_str_column_width_unit = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT );
if ( ! empty( $l_int_column_width_scalar ) ) {
if ( '%' === $l_str_column_width_unit ) {
@@ -469,8 +472,8 @@ class Footnotes_Parser {
}
if ( $l_bool_column_max_width_enabled ) {
- $l_int_column_max_width_scalar = Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR );
- $l_str_column_max_width_unit = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT );
+ $l_int_column_max_width_scalar = Includes\Settings::instance()->get( Includes\Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR );
+ $l_str_column_max_width_unit = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT );
if ( ! empty( $l_int_column_max_width_scalar ) ) {
if ( '%' === $l_str_column_max_width_unit ) {
@@ -489,14 +492,14 @@ class Footnotes_Parser {
}
// Hard links scroll offset.
- self::$a_bool_hard_links_enabled = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_HARD_LINKS_ENABLE ) );
+ self::$a_bool_hard_links_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_HARD_LINKS_ENABLE ) );
// Correct hard links enabled status depending on AMP-compatible or alternative reference container enabled status.
- if ( Footnotes_Public::$a_bool_amp_enabled || 'jquery' !== Footnotes_Public::$a_str_script_mode ) {
+ if ( General::$a_bool_amp_enabled || 'jquery' !== General::$a_str_script_mode ) {
self::$a_bool_hard_links_enabled = true;
}
- self::$a_int_scroll_offset = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET ) );
+ self::$a_int_scroll_offset = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_OFFSET ) );
if ( self::$a_bool_hard_links_enabled ) {
echo '.footnote_referrer_anchor, .footnote_item_anchor {bottom: ';
echo self::$a_int_scroll_offset;
@@ -504,51 +507,51 @@ class Footnotes_Parser {
}
// Tooltips.
- if ( Footnotes_Public::$a_bool_tooltips_enabled ) {
+ if ( General::$a_bool_tooltips_enabled ) {
echo '.footnote_tooltip {';
// Tooltip appearance: Tooltip font size.
echo ' font-size: ';
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED ) ) ) {
- echo Footnotes_Settings::instance()->get( Footnotes_Settings::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR );
- echo Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT );
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED ) ) ) {
+ echo Includes\Settings::instance()->get( Includes\Settings::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR );
+ echo Includes\Settings::instance()->get( Includes\Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT );
} else {
echo 'inherit';
}
echo ' !important;';
// Tooltip Text color.
- $l_str_color = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR );
+ $l_str_color = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR );
if ( ! empty( $l_str_color ) ) {
printf( ' color: %s !important;', $l_str_color );
}
// Tooltip Background color.
- $l_str_background = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND );
+ $l_str_background = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND );
if ( ! empty( $l_str_background ) ) {
printf( ' background-color: %s !important;', $l_str_background );
}
// Tooltip Border width.
- $l_int_border_width = Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH );
+ $l_int_border_width = Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH );
if ( ! empty( $l_int_border_width ) && intval( $l_int_border_width ) > 0 ) {
printf( ' border-width: %dpx !important; border-style: solid !important;', $l_int_border_width );
}
// Tooltip Border color.
- $l_str_border_color = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR );
+ $l_str_border_color = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR );
if ( ! empty( $l_str_border_color ) ) {
printf( ' border-color: %s !important;', $l_str_border_color );
}
// Tooltip Corner radius.
- $l_int_border_radius = Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS );
+ $l_int_border_radius = Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS );
if ( ! empty( $l_int_border_radius ) && intval( $l_int_border_radius ) > 0 ) {
printf( ' border-radius: %dpx !important;', $l_int_border_radius );
}
// Tooltip Shadow color.
- $l_str_box_shadow_color = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR );
+ $l_str_box_shadow_color = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR );
if ( ! empty( $l_str_box_shadow_color ) ) {
printf( ' -webkit-box-shadow: 2px 2px 11px %s;', $l_str_box_shadow_color );
printf( ' -moz-box-shadow: 2px 2px 11px %s;', $l_str_box_shadow_color );
@@ -556,13 +559,13 @@ class Footnotes_Parser {
}
// Tooltip position, dimensions and timing.
- if ( ! Footnotes_Public::$a_bool_alternative_tooltips_enabled && ! Footnotes_Public::$a_bool_amp_enabled ) {
+ if ( ! General::$a_bool_alternative_tooltips_enabled && ! General::$a_bool_amp_enabled ) {
/*
* Dimensions of jQuery tooltips.
*
* Position and timing of jQuery tooltips are script-defined.
*/
- $l_int_max_width = Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH );
+ $l_int_max_width = Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH );
if ( ! empty( $l_int_max_width ) && intval( $l_int_max_width ) > 0 ) {
printf( ' max-width: %dpx !important;', $l_int_max_width );
}
@@ -573,7 +576,7 @@ class Footnotes_Parser {
echo "}\r\n";
// Dimensions.
- $l_int_alternative_tooltip_width = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH ) );
+ $l_int_alternative_tooltip_width = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH ) );
echo '.footnote_tooltip.position {';
echo ' width: max-content; ';
@@ -581,8 +584,8 @@ class Footnotes_Parser {
echo ' max-width: ' . $l_int_alternative_tooltip_width . 'px;';
// Position.
- $l_str_alternative_position = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION );
- $l_int_offset_x = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X ) );
+ $l_str_alternative_position = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION );
+ $l_int_offset_x = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X ) );
if ( 'top left' === $l_str_alternative_position || 'bottom left' === $l_str_alternative_position ) {
echo ' right: ' . ( ! empty( $l_int_offset_x ) ? $l_int_offset_x : 0 ) . 'px;';
@@ -590,7 +593,7 @@ class Footnotes_Parser {
echo ' left: ' . ( ! empty( $l_int_offset_x ) ? $l_int_offset_x : 0 ) . 'px;';
}
- $l_int_offset_y = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y ) );
+ $l_int_offset_y = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y ) );
if ( 'top left' === $l_str_alternative_position || 'top right' === $l_str_alternative_position ) {
echo ' bottom: ' . ( ! empty( $l_int_offset_y ) ? $l_int_offset_y : 0 ) . 'px;';
@@ -600,13 +603,13 @@ class Footnotes_Parser {
echo "}\r\n";
// Timing.
- $l_int_fade_in_delay = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY ) );
+ $l_int_fade_in_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY ) );
$l_int_fade_in_delay = ! empty( $l_int_fade_in_delay ) ? $l_int_fade_in_delay : '0';
- $l_int_fade_in_duration = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION ) );
+ $l_int_fade_in_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION ) );
$l_int_fade_in_duration = ! empty( $l_int_fade_in_duration ) ? $l_int_fade_in_duration : '0';
- $l_int_fade_out_delay = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY ) );
+ $l_int_fade_out_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY ) );
$l_int_fade_out_delay = ! empty( $l_int_fade_out_delay ) ? $l_int_fade_out_delay : '0';
- $l_int_fade_out_duration = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION ) );
+ $l_int_fade_out_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION ) );
$l_int_fade_out_duration = ! empty( $l_int_fade_out_duration ) ? $l_int_fade_out_duration : '0';
/*
@@ -614,7 +617,7 @@ class Footnotes_Parser {
*
* To streamline internal CSS, immutable rules are in external stylesheet.
*/
- if ( Footnotes_Public::$a_bool_amp_enabled ) {
+ if ( General::$a_bool_amp_enabled ) {
echo 'span.footnote_referrer > span.footnote_tooltip {';
echo 'transition-delay: ' . $l_int_fade_out_delay . 'ms;';
@@ -652,11 +655,11 @@ class Footnotes_Parser {
* Set custom CSS to override settings, not conversely.
* Legacy Custom CSS is used until it’s set to disappear after dashboard tab migration.
*/
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE ) ) ) {
- echo Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_CUSTOM_CSS );
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE ) ) ) {
+ echo Includes\Settings::instance()->get( Includes\Settings::C_STR_CUSTOM_CSS );
echo "\r\n";
}
- echo Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_CUSTOM_CSS_NEW );
+ echo Includes\Settings::instance()->get( Includes\Settings::C_STR_CUSTOM_CSS_NEW );
// Insert end tag without switching out of PHP.
echo "\r\n\r\n";
@@ -667,7 +670,7 @@ class Footnotes_Parser {
* The script for alternative tooltips is printed formatted, not minified,
* for transparency. It isn’t indented though (the PHP open tag neither).
*/
- if ( Footnotes_Public::$a_bool_alternative_tooltips_enabled ) {
+ if ( General::$a_bool_alternative_tooltips_enabled ) {
// Start internal script.
?>
@@ -690,20 +693,20 @@ class Footnotes_Parser {
/**
* Displays the 'LOVE FOOTNOTES' slug if enabled.
*
- * @since 1.5.0
+ * @since 1.5.0
*/
public function footnotes_output_footer() {
- if ( 'footer' === Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ) {
+ if ( 'footer' === Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ) {
echo $this->reference_container();
}
// Get setting for love and share this plugin.
- $l_str_love_me_index = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_LOVE );
+ $l_str_love_me_index = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_LOVE );
// Check if the admin allows to add a link to the footer.
if ( empty( $l_str_love_me_index ) || 'no' === strtolower( $l_str_love_me_index ) || ! self::$a_bool_allow_love_me ) {
return;
}
// Set a hyperlink to the word "footnotes" in the Love slug.
- $l_str_linked_name = sprintf( '%s', Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME );
+ $l_str_linked_name = sprintf( '%s', Includes\Config::C_STR_PLUGIN_PUBLIC_NAME );
// Get random love me text.
if ( 'random' === strtolower( $l_str_love_me_index ) ) {
$l_str_love_me_index = 'text-' . wp_rand( 1, 7 );
@@ -712,7 +715,7 @@ class Footnotes_Parser {
// Options named wrt backcompat, simplest is default.
case 'text-1':
/* Translators: 2: Link to plugin page 1: Love heart symbol */
- $l_str_love_me_text = sprintf( __( 'I %2$s %1$s', 'footnotes' ), $l_str_linked_name, Footnotes_Config::C_STR_LOVE_SYMBOL );
+ $l_str_love_me_text = sprintf( __( 'I %2$s %1$s', 'footnotes' ), $l_str_linked_name, Includes\Config::C_STR_LOVE_SYMBOL );
break;
case 'text-2':
/* Translators: %s: Link to plugin page */
@@ -720,11 +723,11 @@ class Footnotes_Parser {
break;
case 'text-4':
/* Translators: 1: Link to plugin page 2: Love heart symbol */
- $l_str_love_me_text = sprintf( '%1$s %2$s', $l_str_linked_name, Footnotes_Config::C_STR_LOVE_SYMBOL );
+ $l_str_love_me_text = sprintf( '%1$s %2$s', $l_str_linked_name, Includes\Config::C_STR_LOVE_SYMBOL );
break;
case 'text-5':
/* Translators: 1: Love heart symbol 2: Link to plugin page */
- $l_str_love_me_text = sprintf( '%1$s %2$s', Footnotes_Config::C_STR_LOVE_SYMBOL, $l_str_linked_name );
+ $l_str_love_me_text = sprintf( '%1$s %2$s', Includes\Config::C_STR_LOVE_SYMBOL, $l_str_linked_name );
break;
case 'text-6':
/* Translators: %s: Link to plugin page */
@@ -746,10 +749,10 @@ class Footnotes_Parser {
/**
* Replaces footnotes in the post/page title.
*
- * @since 1.5.0
+ * @since 1.5.0
*
- * @param string $p_str_content Title.
- * @return string $p_str_content Title with replaced footnotes.
+ * @param string $p_str_content Title.
+ * @return string $p_str_content Title with replaced footnotes.
*/
public function footnotes_in_title( $p_str_content ) {
// Appends the reference container if set to "post_end".
@@ -759,15 +762,15 @@ class Footnotes_Parser {
/**
* Replaces footnotes in the content of the current page/post.
*
- * @since 1.5.0
+ * @since 1.5.0
*
- * @param string $p_str_content Page/Post content.
- * @return string $p_str_content Content with replaced footnotes.
+ * @param string $p_str_content Page/Post content.
+ * @return string $p_str_content Content with replaced footnotes.
*/
public function footnotes_in_content( $p_str_content ) {
- $l_str_ref_container_position = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION );
- $l_str_footnote_section_shortcode = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTE_SECTION_SHORTCODE );
+ $l_str_ref_container_position = Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION );
+ $l_str_footnote_section_shortcode = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTE_SECTION_SHORTCODE );
$l_int_footnote_section_shortcode_length = strlen( $l_str_footnote_section_shortcode );
if ( strpos( $p_str_content, $l_str_footnote_section_shortcode ) === false ) {
@@ -807,13 +810,13 @@ class Footnotes_Parser {
* But issue #65 brought up that manual excerpts can include processable footnotes.
* Default 'manual' is fallback and is backwards-compatible with the initial setup.
*
- * @since 1.5.0
+ * @since 1.5.0
*
- * @param string $p_str_excerpt Excerpt content.
- * @return string $p_str_excerpt Processed or new excerpt.
+ * @param string $p_str_excerpt Excerpt content.
+ * @return string $p_str_excerpt Processed or new excerpt.
*/
public function footnotes_in_excerpt( $p_str_excerpt ) {
- $l_str_excerpt_mode = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_IN_EXCERPT );
+ $l_str_excerpt_mode = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_IN_EXCERPT );
if ( 'yes' === $l_str_excerpt_mode ) {
return $this->generate_excerpt_with_footnotes( $p_str_excerpt );
@@ -834,10 +837,10 @@ class Footnotes_Parser {
* @link https://developer.wordpress.org/reference/functions/wp_trim_excerpt/
* @link https://developer.wordpress.org/reference/functions/wp_trim_words/
*
- * @since 2.6.2
+ * @since 2.6.2
*
- * @param string $p_str_content The post.
- * @return string $p_str_content An excerpt of the post.
+ * @param string $p_str_content The post.
+ * @return string $p_str_content An excerpt of the post.
*/
public function generate_excerpt( $p_str_content ) {
@@ -879,10 +882,10 @@ class Footnotes_Parser {
* Uses information and some code from Advanced Excerpt.
* @link https://wordpress.org/plugins/advanced-excerpt/
*
- * @since 2.6.3
+ * @since 2.6.3
*
- * @param string $p_str_content The post.
- * @return string $p_str_content An excerpt of the post.
+ * @param string $p_str_content The post.
+ * @return string $p_str_content An excerpt of the post.
*/
public function generate_excerpt_with_footnotes( $p_str_content ) {
@@ -980,10 +983,10 @@ class Footnotes_Parser {
/**
* Replaces footnotes in the widget title.
*
- * @since 1.5.0
+ * @since 1.5.0
*
- * @param string $p_str_content Widget content.
- * @return string $p_str_content Content with replaced footnotes.
+ * @param string $p_str_content Widget content.
+ * @return string $p_str_content Content with replaced footnotes.
*/
public function footnotes_in_widget_title( $p_str_content ) {
// Appends the reference container if set to "post_end".
@@ -993,27 +996,27 @@ class Footnotes_Parser {
/**
* Replaces footnotes in the content of the current widget.
*
- * @since 1.5.0
+ * @since 1.5.0
*
- * @param string $p_str_content Widget content.
- * @return string $p_str_content Content with replaced footnotes.
+ * @param string $p_str_content Widget content.
+ * @return string $p_str_content Content with replaced footnotes.
*/
public function footnotes_in_widget_text( $p_str_content ) {
// phpcs:disable WordPress.PHP.YodaConditions.NotYoda
// Appends the reference container if set to "post_end".
- return $this->exec( $p_str_content, 'post_end' === Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ? true : false );
+ return $this->exec( $p_str_content, 'post_end' === Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ? true : false );
// phpcs:enable WordPress.PHP.YodaConditions.NotYoda
}
/**
* Replaces all footnotes that occur in the given content.
*
- * @since 1.5.0
+ * @since 1.5.0
*
- * @param string $p_str_content Any string that may contain footnotes to be replaced.
- * @param bool $p_bool_output_references Appends the Reference Container to the output if set to true, default true.
- * @param bool $p_bool_hide_footnotes_text Hide footnotes found in the string.
- * @return string
+ * @param string $p_str_content Any string that may contain footnotes to be replaced.
+ * @param bool $p_bool_output_references Appends the Reference Container to the output if set to true, default true.
+ * @param bool $p_bool_hide_footnotes_text Hide footnotes found in the string.
+ * @return string
*/
public function exec( $p_str_content, $p_bool_output_references = false, $p_bool_hide_footnotes_text = false ) {
@@ -1025,7 +1028,7 @@ class Footnotes_Parser {
*/
// Append the reference container or insert at shortcode.
- $l_str_reference_container_position_shortcode = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE );
+ $l_str_reference_container_position_shortcode = Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE );
if ( empty( $l_str_reference_container_position_shortcode ) ) {
$l_str_reference_container_position_shortcode = '[[references]]';
}
@@ -1050,9 +1053,9 @@ class Footnotes_Parser {
$p_str_content = str_replace( $l_str_reference_container_position_shortcode, '', $p_str_content );
// Take a look if the LOVE ME slug should NOT be displayed on this page/post, remove the short code if found.
- if ( strpos( $p_str_content, Footnotes_Config::C_STR_NO_LOVE_SLUG ) ) {
+ if ( strpos( $p_str_content, Includes\Config::C_STR_NO_LOVE_SLUG ) ) {
self::$a_bool_allow_love_me = false;
- $p_str_content = str_replace( Footnotes_Config::C_STR_NO_LOVE_SLUG, '', $p_str_content );
+ $p_str_content = str_replace( Includes\Config::C_STR_NO_LOVE_SLUG, '', $p_str_content );
}
// Return the content with replaced footnotes and optional reference container appended.
return $p_str_content;
@@ -1066,18 +1069,18 @@ class Footnotes_Parser {
* when the opening tag is already escaped. In visual mode, the Block Editor
* does not escape the greater-than sign.
*
- * @since 2.1.14
+ * @since 2.1.14
*
- * @param string $p_str_content The footnote, including delimiters.
+ * @param string $p_str_content The footnote, including delimiters.
*/
public function unify_delimiters( $p_str_content ) {
// Get footnotes start and end tag short codes.
- $l_str_starting_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
- $l_str_ending_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
+ $l_str_starting_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
+ $l_str_ending_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
if ( 'userdefined' === $l_str_starting_tag || 'userdefined' === $l_str_ending_tag ) {
- $l_str_starting_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
- $l_str_ending_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
+ $l_str_starting_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
+ $l_str_ending_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
}
// If any footnotes short code is empty, return the content without changes.
@@ -1130,12 +1133,12 @@ class Footnotes_Parser {
/**
* Replaces all footnotes in the given content and appends them to the static property.
*
- * @since 1.5.0
- * @todo Refactor to parse DOM rather than using RegEx.
+ * @since 1.5.0
+ * @todo Refactor to parse DOM rather than using RegEx.
*
- * @param string $p_str_content Any content to be parsed for footnotes.
- * @param bool $p_bool_hide_footnotes_text Hide footnotes found in the string.
- * @return string
+ * @param string $p_str_content Any content to be parsed for footnotes.
+ * @param bool $p_bool_hide_footnotes_text Hide footnotes found in the string.
+ * @return string
*/
public function search( $p_str_content, $p_bool_hide_footnotes_text ) {
@@ -1150,7 +1153,7 @@ class Footnotes_Parser {
*/
// If enabled.
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE ) ) ) {
// Apply different regex depending on whether start shortcode is double/triple opening parenthesis.
if ( '((' === self::$a_str_start_tag || '(((' === self::$a_str_start_tag ) {
@@ -1219,7 +1222,7 @@ class Footnotes_Parser {
} while ( preg_match( $l_str_value_regex, $p_str_content ) );
// Optionally moves footnotes outside at the end of the label element.
- $l_str_label_issue_solution = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION );
+ $l_str_label_issue_solution = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION );
if ( 'move' === $l_str_label_issue_solution ) {
@@ -1287,32 +1290,32 @@ class Footnotes_Parser {
if ( ! $p_bool_hide_footnotes_text ) {
// Whether AMP compatibility mode is enabled.
- if ( Footnotes_Public::$a_bool_amp_enabled ) {
+ if ( General::$a_bool_amp_enabled ) {
// Whether first clicking a referrer needs to expand the reference container.
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
// Load 'public/partials/amp-footnote-expand.html'.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'amp-footnote-expand' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-footnote-expand' );
} else {
// Load 'public/partials/amp-footnote.html'.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'amp-footnote' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-footnote' );
}
- } elseif ( Footnotes_Public::$a_bool_alternative_tooltips_enabled ) {
+ } elseif ( General::$a_bool_alternative_tooltips_enabled ) {
// Load 'public/partials/footnote-alternative.html'.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'footnote-alternative' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'footnote-alternative' );
// Else jQuery tooltips are enabled.
} else {
// Load 'public/partials/footnote.html'.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'footnote' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'footnote' );
// Load tooltip inline script.
- $l_obj_template_tooltip = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'tooltip' );
+ $l_obj_template_tooltip = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'tooltip' );
}
}
@@ -1341,7 +1344,7 @@ class Footnotes_Parser {
$l_str_footnote_text = substr( $p_str_content, $l_int_pos_start + strlen( self::$a_str_start_tag ), $l_int_length - strlen( self::$a_str_start_tag ) );
// Get tooltip text if present.
- self::$a_str_tooltip_shortcode = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER );
+ self::$a_str_tooltip_shortcode = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER );
self::$a_int_tooltip_shortcode_length = strlen( self::$a_str_tooltip_shortcode );
$l_int_tooltip_text_length = strpos( $l_str_footnote_text, self::$a_str_tooltip_shortcode );
$l_bool_has_tooltip_text = ! $l_int_tooltip_text_length ? false : true;
@@ -1369,7 +1372,7 @@ class Footnotes_Parser {
*
* TODO: Split into own method.
*/
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED ) ) ) {
$l_str_footnote_text = preg_replace(
'#(?get( Footnotes_Settings::C_STR_REFERRER_FRAGMENT_ID_SLUG );
- self::$a_str_footnote_link_slug = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG );
- self::$a_str_link_ids_separator = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_HARD_LINK_IDS_SEPARATOR );
+ self::$a_str_referrer_link_slug = Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERRER_FRAGMENT_ID_SLUG );
+ self::$a_str_footnote_link_slug = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG );
+ self::$a_str_link_ids_separator = Includes\Settings::instance()->get( Includes\Settings::C_STR_HARD_LINK_IDS_SEPARATOR );
// Streamline ID concatenation.
self::$a_str_post_container_id_compound = self::$a_str_link_ids_separator;
@@ -1400,11 +1403,11 @@ class Footnotes_Parser {
// Display the footnote referrers and the tooltips.
if ( ! $p_bool_hide_footnotes_text ) {
- $l_int_index = Footnotes_Convert::index( $l_int_footnote_index, Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
+ $l_int_index = Includes\Convert::index( $l_int_footnote_index, Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
// Display only a truncated footnote text if option enabled.
- $l_bool_enable_excerpt = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED ) );
- $l_int_max_length = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH ) );
+ $l_bool_enable_excerpt = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED ) );
+ $l_int_max_length = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH ) );
// Define excerpt text as footnote text by default.
$l_str_excerpt_text = $l_str_footnote_text;
@@ -1417,7 +1420,7 @@ class Footnotes_Parser {
* This is equivalent to the WordPress default excerpt generation, i.e. without a
* custom excerpt and without a delimiter. But WordPress does word count, usually 55.
*/
- if ( Footnotes_Public::$a_bool_tooltips_enabled && $l_bool_enable_excerpt ) {
+ if ( General::$a_bool_tooltips_enabled && $l_bool_enable_excerpt ) {
$l_str_dummy_text = wp_strip_all_tags( $l_str_footnote_text );
if ( is_int( $l_int_max_length ) && strlen( $l_str_dummy_text ) > $l_int_max_length ) {
$l_str_excerpt_text = substr( $l_str_dummy_text, 0, $l_int_max_length );
@@ -1427,10 +1430,10 @@ class Footnotes_Parser {
$l_str_excerpt_text .= ' class="footnote_tooltip_continue" ';
// If AMP compatibility mode is enabled.
- if ( Footnotes_Public::$a_bool_amp_enabled ) {
+ if ( General::$a_bool_amp_enabled ) {
// If the reference container is also collapsed by default.
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
$l_str_excerpt_text .= ' on="tap:footnote_references_container_';
$l_str_excerpt_text .= self::$a_int_post_id . '_' . self::$a_int_reference_container_id;
@@ -1464,7 +1467,7 @@ class Footnotes_Parser {
$l_str_excerpt_text .= '>';
// Configurable read-on button label.
- $l_str_excerpt_text .= Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL );
+ $l_str_excerpt_text .= Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL );
$l_str_excerpt_text .= self::$a_bool_hard_links_enabled ? '' : '';
}
@@ -1475,7 +1478,7 @@ class Footnotes_Parser {
*
* Define the HTML element to use for the referrers.
*/
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS ) ) ) {
$l_str_sup_span = 'sup';
@@ -1518,7 +1521,7 @@ class Footnotes_Parser {
$l_str_referrer_anchor_element = '';
// The link element is set independently as it may be needed for styling.
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_LINK_ELEMENT_ENABLED ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_LINK_ELEMENT_ENABLED ) ) ) {
self::$a_str_link_span = 'a';
self::$a_str_link_open_tag = '';
@@ -1528,7 +1531,7 @@ class Footnotes_Parser {
}
// Determine tooltip content.
- if ( Footnotes_Public::$a_bool_tooltips_enabled ) {
+ if ( General::$a_bool_tooltips_enabled ) {
$l_str_tooltip_content = $l_bool_has_tooltip_text ? $l_str_tooltip_text : $l_str_excerpt_text;
/*
@@ -1544,7 +1547,7 @@ class Footnotes_Parser {
// Determine shrink width if alternative tooltips are enabled.
$l_str_tooltip_style = '';
- if ( Footnotes_Public::$a_bool_alternative_tooltips_enabled && Footnotes_Public::$a_bool_tooltips_enabled ) {
+ if ( General::$a_bool_alternative_tooltips_enabled && General::$a_bool_tooltips_enabled ) {
$l_int_tooltip_length = strlen( wp_strip_all_tags( $l_str_tooltip_content ) );
if ( $l_int_tooltip_length < 70 ) {
$l_str_tooltip_style = ' style="width: ';
@@ -1562,9 +1565,9 @@ class Footnotes_Parser {
'note_id' => $l_int_index,
'hard-link' => $l_str_footnote_link_argument,
'sup-span' => $l_str_sup_span,
- 'before' => Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE ),
+ 'before' => Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_STYLING_BEFORE ),
'index' => $l_int_index,
- 'after' => Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER ),
+ 'after' => Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_STYLING_AFTER ),
'anchor-element' => $l_str_referrer_anchor_element,
'style' => $l_str_tooltip_style,
'text' => $l_str_tooltip_content,
@@ -1576,14 +1579,14 @@ class Footnotes_Parser {
$l_obj_template->reload();
// If tooltips are enabled but neither AMP nor alternative are.
- if ( Footnotes_Public::$a_bool_tooltips_enabled && ! Footnotes_Public::$a_bool_amp_enabled && ! Footnotes_Public::$a_bool_alternative_tooltips_enabled ) {
+ if ( General::$a_bool_tooltips_enabled && ! General::$a_bool_amp_enabled && ! General::$a_bool_alternative_tooltips_enabled ) {
- $l_int_offset_y = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y ) );
- $l_int_offset_x = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X ) );
- $l_int_fade_in_delay = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY ) );
- $l_int_fade_in_duration = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION ) );
- $l_int_fade_out_delay = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY ) );
- $l_int_fade_out_duration = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION ) );
+ $l_int_offset_y = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y ) );
+ $l_int_offset_x = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X ) );
+ $l_int_fade_in_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY ) );
+ $l_int_fade_in_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION ) );
+ $l_int_fade_out_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY ) );
+ $l_int_fade_out_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION ) );
// Fill in 'public/partials/tooltip.html'.
$l_obj_template_tooltip->replace(
@@ -1591,7 +1594,7 @@ class Footnotes_Parser {
'post_id' => self::$a_int_post_id,
'container_id' => self::$a_int_reference_container_id,
'note_id' => $l_int_index,
- 'position' => Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION ),
+ 'position' => Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION ),
'offset-y' => ! empty( $l_int_offset_y ) ? $l_int_offset_y : 0,
'offset-x' => ! empty( $l_int_offset_x ) ? $l_int_offset_x : 0,
'fade-in-delay' => ! empty( $l_int_fade_in_delay ) ? $l_int_fade_in_delay : 0,
@@ -1649,9 +1652,9 @@ class Footnotes_Parser {
/**
* Generates the reference container.
*
- * @since 1.5.0
+ * @since 1.5.0
*
- * @return string
+ * @return string
*/
public function reference_container() {
@@ -1665,16 +1668,16 @@ class Footnotes_Parser {
*/
// If the backlink symbol is enabled.
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE ) ) ) {
// Get html arrow.
- $l_str_arrow = Footnotes_Convert::get_arrow( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_HYPERLINK_ARROW ) );
+ $l_str_arrow = Includes\Convert::get_arrow( Includes\Settings::instance()->get( Includes\Settings::C_STR_HYPERLINK_ARROW ) );
// Set html arrow to the first one if invalid index defined.
if ( is_array( $l_str_arrow ) ) {
- $l_str_arrow = Footnotes_Convert::get_arrow( 0 );
+ $l_str_arrow = Includes\Convert::get_arrow( 0 );
}
// Get user defined arrow.
- $l_str_arrow_user_defined = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_HYPERLINK_ARROW_USER_DEFINED );
+ $l_str_arrow_user_defined = Includes\Settings::instance()->get( Includes\Settings::C_STR_HYPERLINK_ARROW_USER_DEFINED );
if ( ! empty( $l_str_arrow_user_defined ) ) {
$l_str_arrow = $l_str_arrow_user_defined;
}
@@ -1697,15 +1700,15 @@ class Footnotes_Parser {
* Initially an appended comma was hard-coded in this algorithm for enumerations.
* The comma in enumerations is not universally preferred.
*/
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_ENABLED ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_SEPARATOR_ENABLED ) ) ) {
// Check if it is input-configured.
- $l_str_separator = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_CUSTOM );
+ $l_str_separator = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_SEPARATOR_CUSTOM );
if ( empty( $l_str_separator ) ) {
// If it is not, check which option is on.
- $l_str_separator_option = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_OPTION );
+ $l_str_separator_option = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_SEPARATOR_OPTION );
switch ( $l_str_separator_option ) {
case 'comma':
$l_str_separator = ',';
@@ -1728,15 +1731,15 @@ class Footnotes_Parser {
*
* Initially a dot was appended in the table row template.
*/
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_ENABLED ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_TERMINATOR_ENABLED ) ) ) {
// Check if it is input-configured.
- $l_str_terminator = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_CUSTOM );
+ $l_str_terminator = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_TERMINATOR_CUSTOM );
if ( empty( $l_str_terminator ) ) {
// If it is not, check which option is on.
- $l_str_terminator_option = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_OPTION );
+ $l_str_terminator_option = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_TERMINATOR_OPTION );
switch ( $l_str_terminator_option ) {
case 'period':
$l_str_terminator = '.';
@@ -1762,7 +1765,7 @@ class Footnotes_Parser {
* Variable number length and proportional character width require explicit line breaks.
* Otherwise, an ordinary space character offering a line break opportunity is inserted.
*/
- $l_str_line_break = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED ) ) ? ' ' : ' ';
+ $l_str_line_break = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED ) ) ? ' ' : ' ';
/*
* Line breaks for source readability.
@@ -1776,33 +1779,33 @@ class Footnotes_Parser {
/*
* Reference container table row template load.
*/
- $l_bool_combine_identical_footnotes = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_COMBINE_IDENTICAL_FOOTNOTES ) );
+ $l_bool_combine_identical_footnotes = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_COMBINE_IDENTICAL_FOOTNOTES ) );
// AMP compatibility requires a full set of AMP compatible table row templates.
- if ( Footnotes_Public::$a_bool_amp_enabled ) {
+ if ( General::$a_bool_amp_enabled ) {
// When combining identical footnotes is turned on, another template is needed.
if ( $l_bool_combine_identical_footnotes ) {
// The combining template allows for backlink clusters and supports cell clicking for single notes.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'amp-reference-container-body-combi' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container-body-combi' );
} else {
// When 3-column layout is turned on (only available if combining is turned off).
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE ) ) ) {
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'amp-reference-container-body-3column' );
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE ) ) ) {
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container-body-3column' );
} else {
// When switch symbol and index is turned on, and combining and 3-columns are off.
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) ) ) {
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'amp-reference-container-body-switch' );
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) ) ) {
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container-body-switch' );
} else {
// Default is the standard template.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'amp-reference-container-body' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container-body' );
}
}
@@ -1813,24 +1816,24 @@ class Footnotes_Parser {
if ( $l_bool_combine_identical_footnotes ) {
// The combining template allows for backlink clusters and supports cell clicking for single notes.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'reference-container-body-combi' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'reference-container-body-combi' );
} else {
// When 3-column layout is turned on (only available if combining is turned off).
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE ) ) ) {
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'reference-container-body-3column' );
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE ) ) ) {
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'reference-container-body-3column' );
} else {
// When switch symbol and index is turned on, and combining and 3-columns are off.
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) ) ) {
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'reference-container-body-switch' );
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) ) ) {
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'reference-container-body-switch' );
} else {
// Default is the standard template.
- $l_obj_template = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'reference-container-body' );
+ $l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'reference-container-body' );
}
}
@@ -1840,7 +1843,7 @@ class Footnotes_Parser {
/*
* Switch backlink symbol and footnote number.
*/
- $l_bool_symbol_switch = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) );
+ $l_bool_symbol_switch = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) );
// Loop through all footnotes found in the page.
$num_footnotes = count( self::$a_arr_footnotes );
@@ -1860,7 +1863,7 @@ class Footnotes_Parser {
// Get the footnote index string and.
// Keep supporting legacy index placeholder.
- $l_str_footnote_id = Footnotes_Convert::index( ( $l_int_index + 1 ), Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
+ $l_str_footnote_id = Includes\Convert::index( ( $l_int_index + 1 ), Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
/**
* Case of only one backlink per table row.
@@ -1878,11 +1881,11 @@ class Footnotes_Parser {
* This tooltip hints to use the backbutton instead, so the history gets streamlined again.
* @link https://wordpress.org/support/topic/making-it-amp-compatible/#post-13837359
*
- * @since 2.5.4
+ * @since 2.5.4
*/
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE ) ) ) {
$l_str_use_backbutton_hint = ' title="';
- $l_str_use_backbutton_hint .= Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT );
+ $l_str_use_backbutton_hint .= Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT );
$l_str_use_backbutton_hint .= '"';
} else {
$l_str_use_backbutton_hint = '';
@@ -1921,7 +1924,7 @@ class Footnotes_Parser {
* optional hard link need to be set to cover the table cell,
* for better usability and UX.
*
- * @since 2.1.1
+ * @since 2.1.1
*/
// Set a flag to check for the combined status of a footnote item.
@@ -2008,7 +2011,7 @@ class Footnotes_Parser {
$l_bool_flag_combined = true;
// Update the footnote ID.
- $l_str_footnote_id = Footnotes_Convert::index( ( $l_int_check_index + 1 ), Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
+ $l_str_footnote_id = Includes\Convert::index( ( $l_int_check_index + 1 ), Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
// Resume composing the backlinks enumeration.
$l_str_footnote_backlinks .= "$l_str_separator";
@@ -2071,10 +2074,10 @@ class Footnotes_Parser {
$l_bool_has_tooltip_text = ! $l_int_tooltip_text_length ? false : true;
if ( $l_bool_has_tooltip_text ) {
$l_str_not_tooltip_text = substr( $l_str_footnote_text, ( $l_int_tooltip_text_length + self::$a_int_tooltip_shortcode_length ) );
- self::$a_bool_mirror_tooltip_text = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE ) );
+ self::$a_bool_mirror_tooltip_text = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE ) );
if ( self::$a_bool_mirror_tooltip_text ) {
$l_str_tooltip_text = substr( $l_str_footnote_text, 0, $l_int_tooltip_text_length );
- $l_str_reference_text_introducer = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR );
+ $l_str_reference_text_introducer = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR );
$l_str_reference_text = $l_str_tooltip_text . $l_str_reference_text_introducer . $l_str_not_tooltip_text;
} else {
$l_str_reference_text = $l_str_not_tooltip_text;
@@ -2093,7 +2096,7 @@ class Footnotes_Parser {
// Used in standard layout W/O COMBINED FOOTNOTES.
'post_id' => self::$a_int_post_id,
'container_id' => self::$a_int_reference_container_id,
- 'note_id' => Footnotes_Convert::index( $l_int_first_footnote_index, Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) ),
+ 'note_id' => Includes\Convert::index( $l_int_first_footnote_index, Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) ),
'link-start' => self::$a_str_link_open_tag,
'link-end' => self::$a_str_link_close_tag,
'link-span' => self::$a_str_link_span,
@@ -2122,10 +2125,10 @@ class Footnotes_Parser {
}
// Call again for robustness when priority levels don’t match any longer.
- self::$a_int_scroll_offset = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET ) );
+ self::$a_int_scroll_offset = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_OFFSET ) );
// Streamline.
- $l_bool_collapse_default = Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) );
+ $l_bool_collapse_default = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) );
/*
* Reference container label.
@@ -2134,32 +2137,32 @@ class Footnotes_Parser {
* In case of empty label that would apply to the left half button character.
* Hence the point in setting an empty label to U+202F NARROW NO-BREAK SPACE.
*/
- $l_str_reference_container_label = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME );
+ $l_str_reference_container_label = Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_NAME );
// Select the reference container template.
// Whether AMP compatibility mode is enabled.
- if ( Footnotes_Public::$a_bool_amp_enabled ) {
+ if ( General::$a_bool_amp_enabled ) {
// Whether the reference container is collapsed by default.
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
// Load 'public/partials/amp-reference-container-collapsed.html'.
- $l_obj_template_container = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'amp-reference-container-collapsed' );
+ $l_obj_template_container = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container-collapsed' );
} else {
// Load 'public/partials/amp-reference-container.html'.
- $l_obj_template_container = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'amp-reference-container' );
+ $l_obj_template_container = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container' );
}
- } elseif ( 'js' === Footnotes_Public::$a_str_script_mode ) {
+ } elseif ( 'js' === General::$a_str_script_mode ) {
// Load 'public/partials/js-reference-container.html'.
- $l_obj_template_container = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'js-reference-container' );
+ $l_obj_template_container = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'js-reference-container' );
} else {
// Load 'public/partials/reference-container.html'.
- $l_obj_template_container = new Footnotes_Template( Footnotes_Template::C_STR_PUBLIC, 'reference-container' );
+ $l_obj_template_container = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'reference-container' );
}
$l_int_scroll_offset = '';
@@ -2168,14 +2171,14 @@ class Footnotes_Parser {
$l_int_scroll_up_delay = '';
$l_int_scroll_up_duration = '';
- if ( 'jquery' === Footnotes_Public::$a_str_script_mode ) {
+ if ( 'jquery' === General::$a_str_script_mode ) {
$l_int_scroll_offset = ( self::$a_int_scroll_offset / 100 );
- $l_int_scroll_up_duration = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION ) );
+ $l_int_scroll_up_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DURATION ) );
- if ( Footnotes_Convert::to_bool( Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY ) ) ) {
+ if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY ) ) ) {
- $l_int_scroll_down_duration = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION ) );
+ $l_int_scroll_down_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION ) );
} else {
@@ -2183,8 +2186,8 @@ class Footnotes_Parser {
}
- $l_int_scroll_down_delay = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY ) );
- $l_int_scroll_up_delay = intval( Footnotes_Settings::instance()->get( Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY ) );
+ $l_int_scroll_down_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY ) );
+ $l_int_scroll_up_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY ) );
}
@@ -2192,7 +2195,7 @@ class Footnotes_Parser {
array(
'post_id' => self::$a_int_post_id,
'container_id' => self::$a_int_reference_container_id,
- 'element' => Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT ),
+ 'element' => Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT ),
'name' => empty( $l_str_reference_container_label ) ? ' ' : $l_str_reference_container_label,
'button-style' => ! $l_bool_collapse_default ? 'display: none;' : '',
'style' => $l_bool_collapse_default ? 'display: none;' : '',
diff --git a/src/public/widget/class-footnotes-widget-base.php b/src/public/widget/class-base.php
similarity index 81%
rename from src/public/widget/class-footnotes-widget-base.php
rename to src/public/widget/class-base.php
index b472674..563e76d 100644
--- a/src/public/widget/class-footnotes-widget-base.php
+++ b/src/public/widget/class-base.php
@@ -1,15 +1,18 @@
get( Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ) {
+ if ( 'widget' === Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ) {
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $footnotes->a_obj_task->reference_container();
// phpcs:enable
diff --git a/src/uninstall.php b/src/uninstall.php
index 0683715..092260d 100644
--- a/src/uninstall.php
+++ b/src/uninstall.php
@@ -12,9 +12,8 @@
* - Repeat with other user roles. Best directly by using the links/query string parameters.
* - Repeat things for multisite. Once for a single site in the network, once sitewide.
*
- * @since 2.8.0
- *
- * @package footnotes
+ * @package footnotes
+ * @since 2.8.0
*/
// If uninstall not called from WordPress, then exit.
From a2d9609e5d50651c36b85090f583f95efce8d8f7 Mon Sep 17 00:00:00 2001
From: Rumperuu
Date: Sat, 1 May 2021 21:38:11 +0100
Subject: [PATCH 58/99] chore: lint
---
src/admin/layout/class-engine.php | 1 +
src/admin/layout/class-init.php | 1 +
src/admin/layout/class-settings.php | 1 +
src/footnotes.php | 1 -
src/includes/class-activator.php | 6 +++---
src/includes/class-config.php | 8 ++++----
src/includes/class-core.php | 10 +++++-----
src/includes/class-i18n.php | 2 +-
src/includes/class-settings.php | 2 +-
src/public/class-general.php | 1 +
src/public/class-parser.php | 3 ++-
src/public/widget/class-base.php | 1 +
src/public/widget/class-reference-container.php | 1 +
13 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/src/admin/layout/class-engine.php b/src/admin/layout/class-engine.php
index 6f4c2b7..212513e 100644
--- a/src/admin/layout/class-engine.php
+++ b/src/admin/layout/class-engine.php
@@ -14,6 +14,7 @@
*/
namespace footnotes\admin\layout;
+
use footnotes\includes as Includes;
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-init.php';
diff --git a/src/admin/layout/class-init.php b/src/admin/layout/class-init.php
index 4e567c8..4363a93 100644
--- a/src/admin/layout/class-init.php
+++ b/src/admin/layout/class-init.php
@@ -14,6 +14,7 @@
*/
namespace footnotes\admin\layout;
+
use footnotes\includes as Includes;
/**
diff --git a/src/admin/layout/class-settings.php b/src/admin/layout/class-settings.php
index 2b7dbde..923d618 100644
--- a/src/admin/layout/class-settings.php
+++ b/src/admin/layout/class-settings.php
@@ -14,6 +14,7 @@
*/
namespace footnotes\admin\layout;
+
use footnotes\includes as Includes;
/**
diff --git a/src/footnotes.php b/src/footnotes.php
index 40ad273..6a1431a 100755
--- a/src/footnotes.php
+++ b/src/footnotes.php
@@ -27,7 +27,6 @@
namespace footnotes;
-
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
diff --git a/src/includes/class-activator.php b/src/includes/class-activator.php
index d8f9380..c11e313 100644
--- a/src/includes/class-activator.php
+++ b/src/includes/class-activator.php
@@ -1,13 +1,13 @@
Date: Sat, 1 May 2021 21:39:33 +0100
Subject: [PATCH 59/99] docs: update documentation
---
docs/classes/Deactivator.html | 221 +
docs/classes/Footnotes-Activator.html | 53 +-
docs/classes/Footnotes-Admin.html | 112 +-
docs/classes/Footnotes-Config.html | 199 +-
docs/classes/Footnotes-Convert.html | 298 +-
docs/classes/Footnotes-Core.html | 929 +++
docs/classes/Footnotes-Deactivator.html | 54 +-
docs/classes/Footnotes-Layout-Engine.html | 821 ++-
docs/classes/Footnotes-Layout-Init.html | 117 +-
docs/classes/Footnotes-Layout-Settings.html | 1371 ++--
docs/classes/Footnotes-Loader.html | 133 +-
docs/classes/Footnotes-Parser.html | 1077 +--
docs/classes/Footnotes-Public.html | 107 +-
docs/classes/Footnotes-Settings.html | 2096 ++----
docs/classes/Footnotes-Template.html | 207 +-
docs/classes/Footnotes-WYSIWYG.html | 82 +-
docs/classes/Footnotes-Widget-Base.html | 114 +-
.../Footnotes-Widget-Reference-Container.html | 132 +-
docs/classes/Footnotes-i18n.html | 64 +-
docs/classes/Footnotes.html | 264 +-
docs/classes/footnotes-Activator.html | 248 +
docs/classes/footnotes-Config.html | 527 ++
docs/classes/footnotes-Core.html | 930 +++
docs/classes/footnotes-admin-Admin.html | 713 ++
docs/classes/footnotes-admin-WYSIWYG.html | 570 ++
.../footnotes-admin-layout-Engine.html | 2321 ++++++
docs/classes/footnotes-admin-layout-Init.html | 674 ++
.../footnotes-admin-layout-Settings.html | 3720 ++++++++++
docs/classes/footnotes-general-General.html | 1055 +++
docs/classes/footnotes-general-Parser.html | 2561 +++++++
.../footnotes-general-Widget-Base.html | 493 ++
...es-general-Widget-Reference-Container.html | 746 ++
.../classes/footnotes-includes-Activator.html | 224 +
docs/classes/footnotes-includes-Config.html | 530 ++
docs/classes/footnotes-includes-Convert.html | 720 ++
docs/classes/footnotes-includes-Core.html | 943 +++
.../footnotes-includes-Deactivator.html | 224 +
docs/classes/footnotes-includes-Loader.html | 746 ++
docs/classes/footnotes-includes-Settings.html | 6453 +++++++++++++++++
docs/classes/footnotes-includes-Template.html | 935 +++
docs/classes/footnotes-includes-i18n.html | 252 +
docs/classes/footnotes-public-Parser.html | 2561 +++++++
docs/classes/footnotes-public-Pub.html | 1055 +++
.../classes/footnotes-public-widget-Base.html | 493 ++
...tes-public-widget-Reference-Container.html | 746 ++
docs/files/src-admin-class-admin.html | 125 +
.../src-admin-class-footnotes-admin.html | 24 +-
.../src-admin-class-footnotes-wysiwyg.html | 24 +-
docs/files/src-admin-class-wysiwyg.html | 125 +
docs/files/src-admin-layout-class-engine.html | 125 +
...-layout-class-footnotes-layout-engine.html | 25 +-
...in-layout-class-footnotes-layout-init.html | 25 +-
...ayout-class-footnotes-layout-settings.html | 25 +-
docs/files/src-admin-layout-class-init.html | 125 +
.../src-admin-layout-class-settings.html | 125 +
docs/files/src-footnotes.html | 120 +-
docs/files/src-includes-class-activator.html | 125 +
docs/files/src-includes-class-config.html | 125 +
docs/files/src-includes-class-convert.html | 125 +
docs/files/src-includes-class-core.html | 125 +
.../files/src-includes-class-deactivator.html | 125 +
...rc-includes-class-footnotes-activator.html | 24 +-
.../src-includes-class-footnotes-config.html | 24 +-
.../src-includes-class-footnotes-convert.html | 24 +-
...-includes-class-footnotes-deactivator.html | 24 +-
.../src-includes-class-footnotes-i18n.html | 24 +-
.../src-includes-class-footnotes-loader.html | 24 +-
...src-includes-class-footnotes-settings.html | 24 +-
...src-includes-class-footnotes-template.html | 24 +-
docs/files/src-includes-class-footnotes.html | 24 +-
docs/files/src-includes-class-i18n.html | 125 +
docs/files/src-includes-class-loader.html | 125 +
docs/files/src-includes-class-settings.html | 125 +
docs/files/src-includes-class-template.html | 125 +
.../src-public-class-footnotes-parser.html | 22 +-
.../src-public-class-footnotes-public.html | 24 +-
docs/files/src-public-class-general.html | 125 +
docs/files/src-public-class-parser.html | 125 +
docs/files/src-public-widget-class-base.html | 125 +
...ic-widget-class-footnotes-widget-base.html | 25 +-
...-footnotes-widget-reference-container.html | 23 +-
...blic-widget-class-reference-container.html | 125 +
docs/files/src-uninstall.html | 19 +-
docs/graphs/classes.html | 18 +-
docs/index.html | 200 +-
docs/indices/files.html | 63 +-
docs/js/searchIndex.js | 2163 +++---
docs/namespaces/default.html | 191 +-
docs/namespaces/footnotes-admin-layout.html | 130 +
docs/namespaces/footnotes-admin.html | 135 +
docs/namespaces/footnotes-general-widget.html | 128 +
docs/namespaces/footnotes-general.html | 135 +
docs/namespaces/footnotes-includes.html | 141 +
docs/namespaces/footnotes-public-widget.html | 128 +
docs/namespaces/footnotes-public.html | 135 +
docs/namespaces/footnotes.html | 294 +
docs/packages/Default.html | 11 +-
docs/packages/default.html | 19 +-
docs/packages/footnotes-admin-layout.html | 33 +-
docs/packages/footnotes-admin.html | 29 +-
docs/packages/footnotes-includes.html | 30 +-
docs/packages/footnotes-public-widget.html | 20 +-
docs/packages/footnotes-public.html | 22 +-
docs/packages/footnotes.html | 164 +-
docs/reports/deprecated.html | 100 +-
docs/reports/errors.html | 44 +-
docs/reports/markers.html | 428 +-
107 files changed, 39813 insertions(+), 6661 deletions(-)
create mode 100644 docs/classes/Deactivator.html
create mode 100644 docs/classes/Footnotes-Core.html
create mode 100644 docs/classes/footnotes-Activator.html
create mode 100644 docs/classes/footnotes-Config.html
create mode 100644 docs/classes/footnotes-Core.html
create mode 100644 docs/classes/footnotes-admin-Admin.html
create mode 100644 docs/classes/footnotes-admin-WYSIWYG.html
create mode 100644 docs/classes/footnotes-admin-layout-Engine.html
create mode 100644 docs/classes/footnotes-admin-layout-Init.html
create mode 100644 docs/classes/footnotes-admin-layout-Settings.html
create mode 100644 docs/classes/footnotes-general-General.html
create mode 100644 docs/classes/footnotes-general-Parser.html
create mode 100644 docs/classes/footnotes-general-Widget-Base.html
create mode 100644 docs/classes/footnotes-general-Widget-Reference-Container.html
create mode 100644 docs/classes/footnotes-includes-Activator.html
create mode 100644 docs/classes/footnotes-includes-Config.html
create mode 100644 docs/classes/footnotes-includes-Convert.html
create mode 100644 docs/classes/footnotes-includes-Core.html
create mode 100644 docs/classes/footnotes-includes-Deactivator.html
create mode 100644 docs/classes/footnotes-includes-Loader.html
create mode 100644 docs/classes/footnotes-includes-Settings.html
create mode 100644 docs/classes/footnotes-includes-Template.html
create mode 100644 docs/classes/footnotes-includes-i18n.html
create mode 100644 docs/classes/footnotes-public-Parser.html
create mode 100644 docs/classes/footnotes-public-Pub.html
create mode 100644 docs/classes/footnotes-public-widget-Base.html
create mode 100644 docs/classes/footnotes-public-widget-Reference-Container.html
create mode 100644 docs/files/src-admin-class-admin.html
create mode 100644 docs/files/src-admin-class-wysiwyg.html
create mode 100644 docs/files/src-admin-layout-class-engine.html
create mode 100644 docs/files/src-admin-layout-class-init.html
create mode 100644 docs/files/src-admin-layout-class-settings.html
create mode 100644 docs/files/src-includes-class-activator.html
create mode 100644 docs/files/src-includes-class-config.html
create mode 100644 docs/files/src-includes-class-convert.html
create mode 100644 docs/files/src-includes-class-core.html
create mode 100644 docs/files/src-includes-class-deactivator.html
create mode 100644 docs/files/src-includes-class-i18n.html
create mode 100644 docs/files/src-includes-class-loader.html
create mode 100644 docs/files/src-includes-class-settings.html
create mode 100644 docs/files/src-includes-class-template.html
create mode 100644 docs/files/src-public-class-general.html
create mode 100644 docs/files/src-public-class-parser.html
create mode 100644 docs/files/src-public-widget-class-base.html
create mode 100644 docs/files/src-public-widget-class-reference-container.html
create mode 100644 docs/namespaces/footnotes-admin-layout.html
create mode 100644 docs/namespaces/footnotes-admin.html
create mode 100644 docs/namespaces/footnotes-general-widget.html
create mode 100644 docs/namespaces/footnotes-general.html
create mode 100644 docs/namespaces/footnotes-includes.html
create mode 100644 docs/namespaces/footnotes-public-widget.html
create mode 100644 docs/namespaces/footnotes-public.html
create mode 100644 docs/namespaces/footnotes.html
diff --git a/docs/classes/Deactivator.html b/docs/classes/Deactivator.html
new file mode 100644
index 0000000..5745e0b
--- /dev/null
+++ b/docs/classes/Deactivator.html
@@ -0,0 +1,221 @@
+
+
+
+
+ Documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
After properly displaying in dashboard headings until WPv5.4, the above started
-in WPv5.5 being torn apart as if the headline was text-align:justify and not
-the last line. That ugly display bug badly affected the plugin’s communication.
-The only working solution found so far is using position:fixed in one heading
-that isn’t translated, and dropping the logo in another, translatable heading.
+in WP 5.5 being torn apart as if the headline was text-align:justify and not
+the last line. That ugly display bug badly affected the plugin's communication.
+The only working solution found so far is using position:fixed in one heading
+that isn't translated, and dropping the logo in another, translatable heading.
@@ -349,11 +414,28 @@ that isn’t translated, and dropping the logo in another, translatable heading.
+
+
+ todo
+
+
+
+
Remove.
+
+
+
+
+ deprecated
+
+
+
+
+
-
+
C_STR_PLUGIN_PUBLIC_NAME
@@ -362,12 +444,12 @@ that isn’t translated, and dropping the logo in another, translatable heading.
-
Public Plugin name.
+
Public plugin name.
-
+ publicstringC_STR_PLUGIN_PUBLIC_NAME
@@ -391,6 +473,23 @@ that isn’t translated, and dropping the logo in another, translatable heading.
+
+
Set the plugin name and the plugin version that can be used throughout the
+plugin. Load the dependencies, define the locale, and set the hooks for
+the admin area and the public-facing side of the site.
+
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 1.0.0
+
+
+
+
+
+ see
+
+
+ PLUGIN_VERSION
+
+
+
+
+
+
+
Return values
+ void
+ —
+
+
+
+
+
+
+ get_loader()
+
+
+
+
+
Returns a reference to the class that orchestrates the hooks with the plugin.
Bugfix: Dashboard: Referrers and tooltips: Backlink symbol: debug select box by reverting identity check to equality check, thanks to @lolzim bug report.
-
-
-
-
-
- since
-
-
- 2.5.13
-
-
-
- since
-
-
- 2.5.15
-
-
Bugfix: Dashboard: General settings: Footnote start and end short codes: debug select box for shortcodes with pointy brackets.
-
-
-
-
- since
-
-
- 2.6.1
-
-
Restore esc_attr() in load_setting(), remove htmlspecialchars() here.
-
-
- reporter
+ todo
-
@lolzim
+
Refactor HTML generation.
@@ -1450,10 +1474,10 @@ ull
-
Returns a simple text inside html <span> text.
+
Returns a simple text inside HTML `<span>` element.
protected
@@ -1468,7 +1492,7 @@ ull
: string
-
Message to be surrounded with simple html tag (span).
+
Message to be surrounded with <span> tags.
@@ -1481,6 +1505,15 @@ ull
+ access
+
+
+
+
protected
+
+
+
+
since
@@ -1488,6 +1521,15 @@ ull
+
+
+ todo
+
+
+
+
Refactor HTML generation.
+
+
@@ -1511,10 +1553,10 @@ ull
-
Returns the html tag for an input [type = text].
+
Constructs the HTML for a text `<input>` element.
protected
@@ -1529,7 +1571,7 @@ ull
: string
-
Name of the Settings key to pre load the input field.
+
Setting key.
@@ -1538,7 +1580,7 @@ ull
: int
= 999
-
Maximum length of the input, default 999 characters.
+
Maximum length of the input. Default length 999 chars.
@@ -1547,7 +1589,7 @@ ull
: bool
= false
-
Set the input to be read only, default false.
+
Set the input to be read only. Default false.
@@ -1556,7 +1598,7 @@ ull
: bool
= false
-
Set the input to be hidden, default false.
+
Set the input to be hidden. Default false.
@@ -1569,6 +1611,15 @@ ull
+ access
+
+
+
+
protected
+
+
+
+
since
@@ -1576,6 +1627,15 @@ ull
+
+
+ todo
+
+
+
+
Refactor HTML generation.
+
+
@@ -1599,10 +1659,10 @@ ull
-
Returns the html tag for a text area.
+
Constructs the HTML for a `<textarea>` element.
protected
@@ -1617,7 +1677,7 @@ ull
: string
-
Name of the Settings key to pre fill the text area.
+
Setting key.
@@ -1630,6 +1690,15 @@ ull
+ access
+
+
+
+
protected
+
+
+
+
since
@@ -1637,6 +1706,15 @@ ull
+
+
+ todo
+
+
+
+
Refactor HTML generation.
+
+
@@ -1660,7 +1738,7 @@ ull
Returns an array of all registered meta boxes.
@@ -1679,6 +1757,23 @@ ull
+ abstract
+
+
+
+
+
+
+
+ access
+
+
+
+
protected
+
+
+
+
since
@@ -1709,10 +1804,10 @@ ull
-
Returns an array of all registered sections for a sub page.
+
Returns an array of all registered sections for a sub-page.
protected
@@ -1728,6 +1823,23 @@ ull
+ abstract
+
+
+
+
+
+
+
+ access
+
+
+
+
protected
+
+
+
+
since
@@ -1758,10 +1870,10 @@ ull
-
Returns the unique slug of the child sub page.
+
Returns the unique slug of the child sub-page.
protected
@@ -1777,6 +1889,23 @@ ull
+ abstract
+
+
+
+
+
+
+
+ access
+
+
+
+
protected
+
+
+
+
since
@@ -1807,10 +1936,10 @@ ull
-
Returns the title of the child sub page.
+
Returns the title of the child sub-page.
protected
@@ -1826,6 +1955,23 @@ ull
+ abstract
+
+
+
+
+
+
+
+ access
+
+
+
+
protected
+
+
+
+
since
@@ -1856,10 +2002,10 @@ ull
-
Loads specific setting and returns an array with the keys [id, name, value].
+
Loads a specified setting.
protected
@@ -1874,7 +2020,7 @@ ull
: string
-
Settings Array key name.
+
Setting key.
@@ -1887,6 +2033,15 @@ ull
+ access
+
+
+
+
protected
+
+
+
+
since
@@ -1901,19 +2056,7 @@ ull
2.5.11
-
Remove escapement function.
-When refactoring the codebase after 2.5.8, all and every output was escaped.
-After noticing that the plugin was broken, all escapement functions were removed.
-
-
-
-
- since
-
-
- 2.5.15
-
-
To fix it, the data was escaped in add_select_box() instead.
+
Broken due to accidental removal of esc_attr() call.
@@ -1923,41 +2066,7 @@ After noticing that the plugin was broken, all escapement functions were removed
@@ -1552,7 +1371,7 @@ list directly in the template, as CSS is in English anyway
Displays the setting for the input label issue solution.
@@ -1601,7 +1420,7 @@ list directly in the template, as CSS is in English anyway
Displays available Hooks to look for Footnote short codes.
@@ -1610,7 +1429,12 @@ list directly in the template, as CSS is in English anyway
publiclookup_hooks() : mixed
-
+
Priority level was initially a hard-coded default
+shows ‘9223372036854775807’ in the numbox
+empty should be interpreted as PHP_INT_MAX,
+but a numbox cannot be set to empty, see here
+define -1 as PHP_INT_MAX instead
+
@@ -1625,53 +1449,7 @@ list directly in the template, as CSS is in English anyway
1.5.5
-
Edited:
-
-
-
-
- since
-
-
- 2.1.1
-
-
priority level setting for the_content
-
-
-
-
- since
-
-
- 2.1.4
-
-
priority level settings for the other hooks
-
priority level was initially hard-coded default
-shows "9223372036854775807" in the numbox
-empty should be interpreted as PHP_INT_MAX,
-but a numbox cannot be set to empty: https://github.com/Modernizr/Modernizr/issues/171
-define -1 as PHP_INT_MAX instead
-
-
-
-
- since
-
-
- 2.2.9
-
-
removed the warning about the widget text hook
-
-
-
-
- since
-
-
- 2.2.9
-
-
added guidance for the widget text hook
-
+
@@ -1696,10 +1474,10 @@ define -1 as PHP_INT_MAX instead
-
Displays all settings for 'I love Footnotes'.
+
Displays all settings for ‘I love Footnotes’ note.
public
@@ -1720,28 +1498,7 @@ define -1 as PHP_INT_MAX instead
1.5.0
-
Edited:
-
-
-
-
- since
-
-
- 2.2.0
-
-
position-sensitive placeholders to support more locales
-
-
-
-
- since
-
-
- 2.2.0
-
-
more options
-
+
@@ -1766,7 +1523,7 @@ define -1 as PHP_INT_MAX instead
Displays enabled status for the footnotes mouse-over box.
@@ -1790,28 +1547,7 @@ define -1 as PHP_INT_MAX instead
1.5.2
-
Edited:
-
-
-
-
- since
-
-
- 2.2.0
-
-
5 parts to address increased settings number
-
-
-
-
- since
-
-
- 2.2.5
-
-
position settings for alternative tooltips
-
+
@@ -1836,7 +1572,7 @@ define -1 as PHP_INT_MAX instead
Displays style settings for the footnotes mouse-over box.
@@ -1885,7 +1621,7 @@ define -1 as PHP_INT_MAX instead
Displays dimensions setting for the footnotes mouse-over box.
@@ -1934,7 +1670,7 @@ define -1 as PHP_INT_MAX instead
Displays position settings for the footnotes mouse-over box.
@@ -1983,7 +1719,7 @@ define -1 as PHP_INT_MAX instead
Displays dedicated tooltip text settings for the footnotes mouse-over box.
@@ -2032,7 +1768,7 @@ define -1 as PHP_INT_MAX instead
Displays timing settings for the footnotes mouse-over box.
@@ -2081,7 +1817,7 @@ define -1 as PHP_INT_MAX instead
Displays truncation settings for the footnotes mouse-over box.
@@ -2130,7 +1866,7 @@ define -1 as PHP_INT_MAX instead
Displays all options for the footnotes numbering.
@@ -2179,7 +1915,7 @@ define -1 as PHP_INT_MAX instead
Displays all settings for the reference container.
@@ -2203,36 +1939,8 @@ define -1 as PHP_INT_MAX instead
1.5.0
-
Completed:
-
+
-
-
- since
-
-
- 2.1.4:
-
-
layout and typography options
-
-
-
-
- since
-
-
- 2.2.5
-
-
options for label element and label bottom border, thanks to @markhillyer
For more information on the
+meta box array format.
+
+
+
+
since
@@ -3523,72 +3203,18 @@ define -1 as PHP_INT_MAX instead
since
- 2.0.0
+ 2.2.0
-
discontinued
-
-
-
-
- since
-
-
- 2.0.4
-
-
restored to meet user demand for arrow symbol semantics
-
-
-
-
- since
-
-
- 2.1.4
-
-
discontinued, content moved to Settings > Reference container > Display a backlink symbol
-
-
-
-
- since
-
-
- 2.0.4
-
-
to reflect changes in meta box label display since WPv5.5
-spans need position:fixed and become unlocalizable
-fix: logo is kept only in the label that doesn't need to be translated:
-Change string "%s styling" to "Footnotes styling" to fix layout in WPv5.5
@@ -3683,10 +3303,10 @@ Change string "%s styling" to "Footnotes styling" to fix lay
-
Returns the unique slug of the sub page.
+
Returns the unique slug of the sub-page.
protected
@@ -3732,10 +3352,10 @@ Change string "%s styling" to "Footnotes styling" to fix lay
-
Returns the title of the sub page.
+
Returns the title of the sub-page.
protected
@@ -3781,10 +3401,10 @@ Change string "%s styling" to "Footnotes styling" to fix lay
-
Loads specific setting and returns an array with the keys [id, name, value].
+
Loads a specified setting.
protected
@@ -3799,7 +3419,7 @@ Change string "%s styling" to "Footnotes styling" to fix lay
: string
-
Settings Array key name.
+
Setting key.
@@ -3812,6 +3432,15 @@ Change string "%s styling" to "Footnotes styling" to fix lay
+ access
+
+
+
+
protected
+
+
+
+
since
@@ -3826,19 +3455,7 @@ Change string "%s styling" to "Footnotes styling" to fix lay
2.5.11
-
Remove escapement function.
-When refactoring the codebase after 2.5.8, all and every output was escaped.
-After noticing that the plugin was broken, all escapement functions were removed.
-
-
-
-
- since
-
-
- 2.5.15
-
-
To fix it, the data was escaped in add_select_box() instead.
+
Broken due to accidental removal of esc_attr() call.
@@ -3848,41 +3465,7 @@ After noticing that the plugin was broken, all escapement functions were removed
Class defining action/filter registration for the plugin.
-
Maintain a list of all hooks that are registered throughout
-the plugin, and register them with the WordPress API. Call the
-run function to execute the list of actions and filters.
+
Maintain a list of all hooks that are registered throughout the plugin, and
+register them with the WordPress API. Call the run function to execute the
+list of actions and filters.
@@ -126,6 +112,15 @@ run function to execute the list of actions and filters.
includes
+
+
+ since
+
+
+ 2.8.0
+
+
+
@@ -180,7 +175,7 @@ run function to execute the list of actions and filters.
: mixed
-
A property because used both in search() and reference_container().
+
@@ -551,81 +541,8 @@
2.0.0
-
Bugfix: footnote links script independent.
-
-
Bugfix: Referrers and backlinks: remove hard links to streamline browsing history, thanks to @theroninjedi47 bug report.
-
-
-
-
-
- since
-
-
- 2.0.4
-
-
-
Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro issue report, thanks to @martinneumannat issue report and code contribution.
Whether to mirror the tooltip text in the reference container.
@@ -693,7 +610,7 @@
Footnote delimiter syntax validation enabled.
@@ -704,9 +621,12 @@
$a_bool_syntax_error_flag
= rue
-
-
Adding: Footnote delimiters: syntax validation for balanced footnote start and end tag short codes.
-
+
The algorithm first checks for balanced footnote opening and closing tag short codes.
+The first encountered error triggers the display of a warning below the post title.
+
Unbalanced short codes have caused significant trouble because they are hard to detect.
+Any compiler or other tool reports syntax errors in the first place. Footnotes' exception
+is considered a design flaw, and the feature is released as a bug fix after overdue 2.3.0
+released in urgency to provide AMP compat before 2021.
@@ -743,7 +663,7 @@
Autoload a.k.a. infinite scroll, or archive view.
@@ -754,9 +674,8 @@
$a_int_post_id
= 0
-
-
Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness issue report and code contribution
-
+
As multiple posts are appended to each other, functions and fragment IDs must be disambiguated.
+post ID to make everything unique wrt infinite scroll and archive view.
Bugfix: Reference container, widget_text hook: support for multiple containers in a page, thanks to @justbecuz bug report.
-
+
This ID disambiguates multiple reference containers in a page
+as they may occur when the widget_text hook is active and the page
+is built with Elementor and has an accordion or similar toggle sections.
Bugfix: Scroll offset: make configurable to fix site-dependent issues related to fixed headers.
-
+
Websites may use high fixed headers not contracting at scroll.
+Scroll offset may now need to get into inline CSS.
+Hence it needs to be loaded twice, because priority levels may not match.
@@ -926,36 +790,8 @@
2.1.4
-
-
Bugfix: Scroll offset: initialize to safer one third window height for more robustness, thanks to @lukashuggenberg bug report.
The input was already the processed excerpt, no more footnotes to search.
+But issue #65 brought up that manual excerpts can include processable footnotes.
+Default 'manual' is fallback and is backwards-compatible with the initial setup.
+
Parameters
@@ -1938,57 +1790,6 @@
-
-
- since
-
-
- 2.6.2
-
-
Debug No option.
-
-
-
-
- since
-
-
- 2.6.3
-
-
Debug Yes option, the setting becomes fully effective.
-
-
Bugfix: Excerpts: make excerpt handling backward compatible, thanks to @mfessler bug report.
-
-
-
-
-
- since
-
-
- 2.7.0
-
-
The input was already the processed excerpt, no more footnotes to search.
-But issue #65 brought up that manual excerpts can include processable footnotes.
-Default 'manual' is fallback and is backward compatible with the initial setup.
@@ -2013,7 +1814,7 @@ Default 'manual' is fallback and is backward compatible with the initial setup.<
Replaces footnotes in the post/page title.
@@ -2075,7 +1876,7 @@ Default 'manual' is fallback and is backward compatible with the initial setup.<
Replaces footnotes in the content of the current widget.
@@ -2137,7 +1938,7 @@ Default 'manual' is fallback and is backward compatible with the initial setup.<
Replaces footnotes in the widget title.
@@ -2199,7 +2000,7 @@ Default 'manual' is fallback and is backward compatible with the initial setup.<
Displays the 'LOVE FOOTNOTES' slug if enabled.
@@ -2225,16 +2026,6 @@ Default 'manual' is fallback and is backward compatible with the initial setup.<
-
-
- since
-
-
- 2.2.0
-
-
More options.
-
-
@@ -2258,7 +2049,7 @@ Default 'manual' is fallback and is backward compatible with the initial setup.<
Outputs the custom css to the header of the public page.
@@ -2285,93 +2076,12 @@ Default 'manual' is fallback and is backward compatible with the initial setup.<
-
- since
+
+ todo
- 2.1.1
-
Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report.
-
-
-
-
- since
-
-
- 2.1.1
-
-
Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage, thanks to @andreasra feedback.
-
-
-
-
- since
-
-
- 2.1.3
-
-
raise settings priority to override theme stylesheets
-
-
-
-
- since
-
-
- 2.1.4
-
-
Bugfix: Tooltips: Styling: fix font size issue by adding font size to settings with legacy as default.
-
-
-
-
- since
-
-
- 2.1.4
-
-
Bugfix: Reference container: fix layout issues by moving backlink column width to settings.
-
-
-
-
- since
-
-
- 2.2.5
-
-
Bugfix: Reference container: Label: make bottom border an option, thanks to @markhillyer issue report.
-
-
-
-
- since
-
-
- 2.2.5
-
-
Bugfix: Reference container: Label: option to select paragraph or heading element, thanks to @markhillyer issue report.
-
-
-
-
- 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.
@@ -2397,7 +2107,7 @@ Default 'manual' is fallback and is backward compatible with the initial setup.<
Generates excerpt on the basis of the post.
@@ -2406,9 +2116,7 @@ Default 'manual' is fallback and is backward compatible with the initial setup.<
publicgenerate_excerpt(string $p_str_content) : string
-
-
Bugfix: Excerpts: debug the 'No' option by generating excerpts on the basis of the post without footnotes, thanks to @nikelaos @markcheret @martinneumannat bug reports.
-
+
Applies full WordPress excerpt processing.
Parameters
@@ -2431,61 +2139,6 @@ Default 'manual' is fallback and is backward compatible with the initial setup.<
Bugfix: Excerpts: debug the 'Yes' option by generating excerpts with footnotes on the basis of the posts, thanks to @nikelaos @martinneumannat bug reports.
-
+
Does not apply full WordPress excerpt processing.
Parameters
@@ -2566,95 +2216,18 @@ Applies full WordPress excerpt processing.
- reporter
+ see
-
-
@nikelaos
-
-
-
-
- reporter
-
-
-
-
@martinneumannat
-
-
-
-
- reporter
-
-
-
-
@scroom
-
-
-
-
- reporter
-
-
-
-
@copylefter
-
-
-
-
- reporter
-
-
-
-
@lagoon24
+ self::generate_excerpt()
+
+
Uses information and some code from Advanced Excerpt.
Bugfix: Process: remove trailing comma after last argument in multiline function calls for PHP < 7.3, thanks to @scroom @copylefter @lagoon24 bug reports.
-
-
-
-
-
- since
-
-
- 2.6.4
-
-
-
- see
-
-
- self::generate_excerpt()
-
-
Uses information and some code from Advanced Excerpt.
-
-
Return values
string
—
-
$p_str_content An excerpt of the post.
-Does not apply full WordPress excerpt processing.
+
$p_str_content An excerpt of the post.
@@ -2714,7 +2264,7 @@ Does not apply full WordPress excerpt processing.
Generates the reference container.
@@ -2740,66 +2290,6 @@ Does not apply full WordPress excerpt processing.
-
-
- since
-
-
- 2.0.0
-
-
Update: remove backlink symbol along with column 2 of the reference container
-
-
-
-
- since
-
-
- 2.0.3
-
-
Bugfix: prepend an arrow on user request
-
-
-
-
- since
-
-
- 2.0.6
-
-
Bugfix: Reference container: fix line breaking behavior in footnote number clusters.
-
-
-
-
- since
-
-
- 2.0.4
-
-
Bugfix: restore the arrow select and backlink symbol input settings
-
-
-
-
- since
-
-
- 2.1.1
-
-
Bugfix: Referrers, reference container: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report.
-
-
-
-
- since
-
-
- 2.1.1
-
-
Bugfix: Reference container: Backlink symbol: make optional, not suggest configuring it to invisible, thanks to @spaceling feedback.
-
-
@@ -2823,7 +2313,7 @@ Does not apply full WordPress excerpt processing.
Register WordPress hooks to replace Footnotes in the content of a public page.
@@ -2856,7 +2346,7 @@ Does not apply full WordPress excerpt processing.
1.5.4
-
Adding: Hooks: support 'the_post' in response to user request for custom post types.
+
Add support for @see 'the_post' hook.
@@ -2866,57 +2356,7 @@ Does not apply full WordPress excerpt processing.
2.0.5
-
Bugfix: Reference container: fix relative position through priority level, thanks to @june01 @imeson @spaceling bug reports, thanks to @spaceling code contribution.
-
-
-
-
- since
-
-
- 2.0.5
-
-
Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts.
-
-
-
-
- since
-
-
- 2.0.6
-
-
Bugfix: Priority level back to PHP_INT_MAX (ref container positioning not this plugin’s responsibility).
@@ -2992,7 +2401,7 @@ Does not apply full WordPress excerpt processing.
Replaces all footnotes in the given content and appends them to the static property.
@@ -3010,7 +2419,7 @@ Does not apply full WordPress excerpt processing.
: string
-
Any content to be searched for footnotes.
+
Any content to be parsed for footnotes.
@@ -3039,100 +2448,15 @@ Does not apply full WordPress excerpt processing.
-
-
- since
-
-
- 2.0.0
-
-
various.
-
-
-
-
- since
-
-
- 2.4.0
-
-
Adding: Footnote delimiters: syntax validation for balanced footnote start and end tag short codes.
-
-
-
-
- since
-
-
- 2.5.0
-
-
Bugfix: Footnote delimiters: Syntax validation: exclude certain cases involving scripts, thanks to @andreasra bug report.
-
-
-
-
- since
-
-
- 2.5.0
-
-
Bugfix: Footnote delimiters: Syntax validation: complete message with hint about setting, thanks to @andreasra bug report.
-
-
-
-
- since
-
-
- 2.5.0
-
-
Bugfix: Footnote delimiters: Syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra bug report.
-
-
Bugfix: Footnote delimiter short codes: debug closing pointy brackets in the Block Editor by accounting for unbalanced HTML escapement, thanks to @patrick_here @alifarahani8000 bug reports.
@@ -3156,7 +2480,7 @@ Does not apply full WordPress excerpt processing.
Brings the delimiters and unifies their various HTML escapement schemas.
@@ -3165,7 +2489,11 @@ Does not apply full WordPress excerpt processing.
publicunify_delimiters(string $p_str_content) : mixed
-
+
While the Classic Editor (visual mode) escapes both pointy brackets,
+the Block Editor enforces balanced escapement only in code editor mode
+when the opening tag is already escaped. In visual mode, the Block Editor
+does not escape the greater-than sign.
+
Parameters
@@ -3174,10 +2502,7 @@ Does not apply full WordPress excerpt processing.
: string
-
TODO.
-
-
Bugfix: Footnote delimiter short codes: fix numbering bug by cross-editor HTML escapement schema unification, thanks to @patrick_here @alifarahani8000 @gova bug reports.
-
+
The footnote, including delimiters.
@@ -3190,64 +2515,12 @@ Does not apply full WordPress excerpt processing.
While the Classic Editor (visual mode) escapes both pointy brackets,
-the Block Editor enforces balanced escapement only in code editor mode
-when the opening tag is already escaped. In visual mode, the Block Editor
-does not escape the greater-than sign.
Settings container key for the backlinks column max width scalar.
@@ -1064,7 +1057,7 @@
Settings container key for the backlinks column width scalar.
@@ -1106,10 +1099,10 @@
-
Settings container key for 'the_content' hook priority level.
+
Settings container key for `the_content` hook priority level.
public
@@ -1119,9 +1112,17 @@
-
-
Bugfix: Reference container: fix relative position through priority level, thanks to @june01 @imeson @spaceling bug reports, thanks to @spaceling code contribution.
-
+
Priority level of the_content and of widget_text as the only relevant
+hooks must be less than 99 because social buttons may yield scripts
+that contain the strings ‘((’ and ‘))’ (i.e., the default footnote
+start and end shortcodes), which causes issues with fake footnotes.
+
Setting the_content priority to 10 instead of PHP_INT_MAX makes the
+footnotes reference container display beneath the post and above other
+features added by other plugins, e.g. related post lists and social buttons.
+
For the YARPP plugin to display related posts below the Footnotes reference container,
+priority needs to be at least 1,200.
+
PHP_INT_MAX cannot be reset by leaving the number box empty, because
+WebKit browsers don't allow it, so we must resort to -1.
Bugfix: Priority levels: set the_content priority level to 98 to prevent plugin conflict, thanks to @marthalindeman bug report.
-
-
-
-
-
- since
-
-
- 2.1.6
-
-
Priority level of the_content and of widget_text as the only relevant
-hooks must be less than 99 because social buttons may yield scripts
-that contain the strings '((' and '))', i.e. the default footnote
-start and end short codes, causing issues with fake footnotes.
-
Setting the_content priority to 10 instead of PHP_INT_MAX i.e. 9223372036854775807
-makes the footnotes reference container display beneath the post and above other
-features added by other plugins, e.g. related post lists and social buttons.
-
For YARPP to display related posts below the Footnotes reference container,
-priority needs to be at least 1200 (i.e. 0 =< $l_int_the_content_priority =< 1200).
-
PHP_INT_MAX cannot be reset by leaving the number box empty. because browsers
-(WebKit) don’t allow it, so we must resort to -1.
-
-
@@ -1280,10 +1152,10 @@ priority needs to be at least 1200 (i.e. 0 =< $l_int_the_content_priority =&l
-
Settings container key for 'the_excerpt' hook priority level.
+
Settings container key for `the_excerpt` hook priority level.
public
@@ -1322,10 +1194,10 @@ priority needs to be at least 1200 (i.e. 0 =< $l_int_the_content_priority =&l
-
Settings container key for 'the_title' hook priority level.
+
Settings container key for `the_title` hook priority level.
public
@@ -1335,10 +1207,7 @@ priority needs to be at least 1200 (i.e. 0 =< $l_int_the_content_priority =&l
-
-
Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report.
-
-
+
@@ -1347,22 +1216,6 @@ priority needs to be at least 1200 (i.e. 0 =< $l_int_the_content_priority =&l
@@ -2382,14 +2166,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key to enable a max width for the backlinks column.
public
- str
+ stringC_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED
= 'footnotes_inputfield_backlinks_column_max_width_enabled'
@@ -2424,14 +2208,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key for the backlinks column max width unit.
public
- str
+ stringC_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT
= 'footnotes_inputfield_backlinks_column_max_width_unit'
@@ -2466,14 +2250,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key to enable the backlinks column width.
public
- str
+ stringC_STR_BACKLINKS_COLUMN_WIDTH_ENABLED
= 'footnotes_inputfield_backlinks_column_width_enabled'
@@ -2508,14 +2292,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key for the backlinks column width unit.
public
- str
+ stringC_STR_BACKLINKS_COLUMN_WIDTH_UNIT
= 'footnotes_inputfield_backlinks_column_width_unit'
@@ -2550,14 +2334,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key to enable line breaks between backlinks.
public
- str
+ stringC_STR_BACKLINKS_LINE_BREAKS_ENABLED
= 'footnotes_inputfield_backlinks_line_breaks_enabled'
@@ -2577,7 +2361,8 @@ The width should be limited to start with, for the box to have shape.
2.1.4
-
+
Whether a tag is inserted.
+
@@ -2592,14 +2377,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key for a custom backlink separator.
public
- str
+ stringC_STR_BACKLINKS_SEPARATOR_CUSTOM
= 'footnotes_inputfield_backlinks_separator_custom'
@@ -2634,22 +2419,21 @@ The width should be limited to start with, for the box to have shape.
Settings container key to enable the presence of a backlink separator.
public
- str
+ stringC_STR_BACKLINKS_SEPARATOR_ENABLED
= 'footnotes_inputfield_backlinks_separator_enabled'
-
-
Bugfix: Reference container: make separating and terminating punctuation optional and configurable, thanks to @docteurfitness issue report and code contribution.
-
+
Backlink separators and terminators are often not preferred, but a choice
+should be provided along with the ability to customize.
@@ -2659,22 +2443,6 @@ The width should be limited to start with, for the box to have shape.
@@ -2695,14 +2463,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key for the backlink separator options.
public
- str
+ stringC_STR_BACKLINKS_SEPARATOR_OPTION
= 'footnotes_inputfield_backlinks_separator_option'
@@ -2737,14 +2505,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key for a custom backlink terminator.
public
- str
+ stringC_STR_BACKLINKS_TERMINATOR_CUSTOM
= 'footnotes_inputfield_backlinks_terminator_custom'
@@ -2779,14 +2547,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key to enable the presence of a backlink terminator.
public
- str
+ stringC_STR_BACKLINKS_TERMINATOR_ENABLED
= 'footnotes_inputfield_backlinks_terminator_enabled'
@@ -2821,14 +2589,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key for the backlink terminator options.
public
- str
+ stringC_STR_BACKLINKS_TERMINATOR_OPTION
= 'footnotes_inputfield_backlinks_terminator_option'
@@ -2863,14 +2631,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key for combining identical footnotes.
public
- str
+ stringC_STR_COMBINE_IDENTICAL_FOOTNOTES
= 'footnote_inputfield_combine_identical'
@@ -2905,14 +2673,14 @@ The width should be limited to start with, for the box to have shape.
Settings container key for the Custom CSS.
public
- str
+ stringC_STR_CUSTOM_CSS
= 'footnote_inputfield_custom_css'
@@ -2934,16 +2702,6 @@ The width should be limited to start with, for the box to have shape.
-
-
- since
-
-
- 1.3.0
-
-
Adding: new settings tab for custom CSS settings.
-
-
@@ -2957,20 +2715,22 @@ The width should be limited to start with, for the box to have shape.
Settings container key to enable display of legacy Custom CSS metaboxes.
public
- str
+ stringC_STR_CUSTOM_CSS_LEGACY_ENABLE
= 'footnote_inputfield_custom_css_legacy_enable'
-
+
This must be false if its setting is contained in the container to be hidden
+because when saving, all missing constants are emptied, and Footnotes_Convert::to_bool() converts empty to false.
+
@@ -2993,8 +2753,8 @@ The width should be limited to start with, for the box to have shape.
2.3.0
-
The Boolean must be false if its setting is contained in the container to be hidden,
-because when saving, all missing constants are emptied, and to_bool() converts empty to false.
+
Swap migration Boolean, meaning ‘show legacy’ instead of
+‘migration complete’, due to storage data structure constraints.
@@ -3010,23 +2770,20 @@ because when saving, all missing constants are emptied, and to_bool() converts e
Settings container key for the Custom CSS migrated to a dedicated tab.
public
- str
+ stringC_STR_CUSTOM_CSS_NEW
= 'footnote_inputfield_custom_css_new'
-
-
Update: Dashboard: Custom CSS: unearth text area and migrate to dedicated tab as designed.
-
-
+
@@ -3055,14 +2812,14 @@ because when saving, all missing constants are emptied, and to_bool() converts e
-
Settings container key to enable the 'the_content' hook.
+
Settings container key to enable the `the_content` hook.
public
- str
+ stringC_STR_EXPERT_LOOKUP_THE_CONTENT
= 'footnote_inputfield_expert_lookup_the_content'
@@ -3097,14 +2854,14 @@ because when saving, all missing constants are emptied, and to_bool() converts e
-
Settings container key to enable the 'the_excerpt' hook.
+
Settings container key to enable the `the_excerpt` hook.
public
- str
+ stringC_STR_EXPERT_LOOKUP_THE_EXCERPT
= 'footnote_inputfield_expert_lookup_the_excerpt'
@@ -3119,23 +2876,20 @@ because when saving, all missing constants are emptied, and to_bool() converts e
+ see
+
+
+ C_STR_FOOTNOTES_IN_EXCERPT
+
+
+
+
+
since
1.5.5
-
-
Bugfix: Hooks: disable the_excerpt hook by default to fix issues, thanks to @nikelaos bug report.
-
-
-
-
-
- since
-
-
- 2.1.3
-
@@ -3145,83 +2899,9 @@ because when saving, all missing constants are emptied, and to_bool() converts e
2.6.3
-
Enable by default after debugging the 'Footnotes in excerpts' setting.
-
-
Bugfix: Hooks: default-disable the_excerpt hook with respect to theme-specific excerpt handling, thanks to @mmallett bug reports.
@@ -3235,20 +2915,25 @@ because when saving, all missing constants are emptied, and to_bool() converts e
-
Settings container key to enable the 'the_title' hook.
+
Settings container key to enable the `the_title` hook.
public
- str
+ stringC_STR_EXPERT_LOOKUP_THE_TITLE
= 'footnote_inputfield_expert_lookup_the_title'
-
+
These are checkboxes; the keyword checked is converted to true, whilst
+an empty string (the default) is converted to false.
+
Hooks should all be enabled by default to prevent users from thinking at
+first that the feature is broken in post titles (see here for more
+information).
+
@@ -3266,14 +2951,15 @@ because when saving, all missing constants are emptied, and to_bool() converts e
In titles, footnotes are still buggy, because WordPress uses the
+title string in menus and in the title element, but Footnotes doesn't
+delete footnotes in them.
Settings container key to enable the 'widget_text' hook.
+
Settings container key to enable the `widget_text` hook.
public
- str
+ stringC_STR_EXPERT_LOOKUP_WIDGET_TEXT
= 'footnote_inputfield_expert_lookup_widget_text'
-
+
The widget_text hook must be disabled by default, because it causes
+multiple reference containers to appear in Elementor accordions, but
+it must be enabled if multiple reference containers are desired, as
+in Elementor toggles.
Settings container key to enable superscript style normalization.
public
- str
+ stringC_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT
= 'footnotes_inputfield_referrers_normal_superscript'
-
-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.
@@ -3765,22 +3358,24 @@ Unicode-compliant browsers break URLs at slashes.
Settings container key to enable backlink tooltips.
public
- str
+ stringC_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE
= 'footnotes_inputfield_backlink_tooltip_enable'
-
-
Update: Reference container: Hard backlinks (optional): optional configurable tooltip hinting to use the backbutton instead, thanks to @theroninjedi47 bug report.
-
+
When hard links are enabled, clicks on the backlinks are logged in the
+browsing history, along with clicks on the referrers.
+This tooltip hints to use the backbutton instead, so the history gets
+streamlined again.
+See here for more information.
@@ -3790,29 +3385,6 @@ Unicode-compliant browsers break URLs at slashes.
@@ -3833,23 +3405,20 @@ Unicode-compliant browsers break URLs at slashes.
Settings container key to configure the backlink tooltip.
public
- str
+ stringC_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT
= 'footnotes_inputfield_backlink_tooltip_text'
-
-
Update: Reference container: Hard backlinks (optional): optional configurable tooltip hinting to use the backbutton instead, thanks to @theroninjedi47 bug report.
-
-
+
@@ -3858,22 +3427,6 @@ Unicode-compliant browsers break URLs at slashes.
Since the removal of the the_post hook, the tab is no danger zone any longer.
+All users, not experts only, need to be able to control relative positioning.
+
@@ -4049,9 +3570,24 @@ Unicode-compliant browsers break URLs at slashes.
2.1.6
-
This setting removed as irrelevant since priority level settings need permanent visibility.
-
Since the removal of the the_post hook, the tab is no danger zone any longer.
-All users, not experts only, need to be able to control relative positioning.
+
Setting deprecated.
+
+
+
+
+ deprecated
+
+
+
+
+
+
+
+ todo
+
+
+
+
Un-deprecate.
@@ -4067,22 +3603,20 @@ All users, not experts only, need to be able to control relative positioning.
class-footnotes-settings.php
:
- 977
+ 894
Settings container key to enable hard links.
public
- str
+ stringC_STR_FOOTNOTES_HARD_LINKS_ENABLE
= 'footnotes_inputfield_hard_links_enable'
-
-
Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro issue report, thanks to @martinneumannat issue report and code contribution.
-
+
When the alternative reference container is enabled, hard links are too.
@@ -4092,38 +3626,6 @@ All users, not experts only, need to be able to control relative positioning.
@@ -4144,14 +3646,14 @@ All users, not experts only, need to be able to control relative positioning.
class-footnotes-settings.php
:
- 139
+ 136
Settings container key to look for footnotes in post excerpts.
public
- str
+ stringC_STR_FOOTNOTES_IN_EXCERPT
= 'footnote_inputfield_search_in_excerpt'
@@ -4166,6 +3668,15 @@ All users, not experts only, need to be able to control relative positioning.
+ see
+
+
+ C_STR_EXPERT_LOOKUP_THE_EXCERPT
+
+
+
+
+
since
@@ -4177,59 +3688,12 @@ All users, not experts only, need to be able to control relative positioning.
since
-
- 2.6.2
-
-
Debug No option.
-
-
-
-
- since
-
2.6.3
-
Enable by default after debugging both Yes and No options.
-
-
Bugfix: Excerpts: make excerpt handling backward compatible, thanks to @mfessler bug report.
@@ -4243,20 +3707,25 @@ All users, not experts only, need to be able to control relative positioning.
class-footnotes-settings.php
:
- 1175
+ 1078
Settings container key to set the solution of the input element label issue.
public
- str
+ stringC_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION
= 'footnotes_inputfield_label_issue_solution'
-
+
If hard links are not enabled, clicking a referrer in an input element label
+toggles the state of the input element the label is connected to.
+Beside hard links, other solutions include moving footnotes off the label and
+append them, or disconnecting this label from the input element (discouraged).
+See here for more information.
+
@@ -4274,11 +3743,13 @@ All users, not experts only, need to be able to control relative positioning.
@@ -4292,14 +3763,14 @@ All users, not experts only, need to be able to control relative positioning.
class-footnotes-settings.php
:
- 180
+ 177
-
Settings container key for the 'I love footnotes' text.
+
Settings container key for the ‘I love footnotes’ text.
public
- str
+ stringC_STR_FOOTNOTES_LOVE
= 'footnote_inputfield_love'
@@ -4334,22 +3805,23 @@ All users, not experts only, need to be able to control relative positioning.
class-footnotes-settings.php
:
- 446
+ 422
Settings container key to enable the alternative tooltips.
public
- str
+ stringC_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE
= 'footnote_inputfield_custom_mouse_over_box_alternative'
-
-
Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage, thanks to @andreasra feedback.
-
+
These alternative tooltips work around a website-related jQuery UI
+outage. They are low-script but use the AMP-incompatible onmouseover
+and onmouseout arguments, along with CSS transitions for fade-in/out.
+The very small script is inserted after the plugin's internal stylesheet.
@@ -4359,22 +3831,6 @@ All users, not experts only, need to be able to control relative positioning.
@@ -4512,6 +3883,15 @@ But theme default background color doesn’t seem to exist.
+
+
+ since
+
+
+ 1.5.6
+
+
+
@@ -4525,14 +3905,14 @@ But theme default background color doesn’t seem to exist.
Settings container key for the mouse-over box to define the border color.
public
- str
+ stringC_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR
= 'footnote_inputfield_custom_mouse_over_box_border_color'
@@ -4567,14 +3947,14 @@ But theme default background color doesn’t seem to exist.
Settings container key for the mouse-over box to define the color.
public
- str
+ stringC_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR
= 'footnote_inputfield_custom_mouse_over_box_color'
@@ -4589,43 +3969,6 @@ But theme default background color doesn’t seem to exist.
- since
-
-
- 1.5.6
-
-
-
Bugfix: Tooltips: Styling: Font color: set to black for maximum contrast with respect to white default background, thanks to 4msc bug report.
@@ -4633,6 +3976,15 @@ But theme default background color doesn’t seem to exist.
+
+
+ since
+
+
+ 1.5.6
+
+
+
@@ -4646,14 +3998,14 @@ But theme default background color doesn’t seem to exist.
Settings container key to enable the mouse-over box.
public
- str
+ stringC_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED
= 'footnote_inputfield_custom_mouse_over_box_enabled'
@@ -4688,14 +4040,14 @@ But theme default background color doesn’t seem to exist.
Settings container key to enable tooltip truncation.
public
- str
+ stringC_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED
= 'footnote_inputfield_custom_mouse_over_box_excerpt_enabled'
@@ -4717,6 +4069,17 @@ But theme default background color doesn’t seem to exist.
+
+
+ todo
+
+
+
+
The mouse-over content truncation should be enabled by default to raise
+awareness of the functionality, prevent the screen from being filled on
+mouse-over, and allow the use of ‘Continue Reading’ functionality.
+
+
@@ -4730,20 +4093,23 @@ But theme default background color doesn’t seem to exist.
Settings container key for the mouse-over box to define the position.
public
- str
+ stringC_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION
= 'footnote_inputfield_custom_mouse_over_box_position'
-
+
The default position should not be lateral because of the risk
+the box gets squeezed between note anchor at line end and window edge,
+and top because reading at the bottom of the window is more likely.
+
@@ -4772,14 +4138,14 @@ But theme default background color doesn’t seem to exist.
Settings container key for the mouse-over box to define the box-shadow color.
public
- str
+ stringC_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR
= 'footnote_inputfield_custom_mouse_over_box_shadow_color'
@@ -4814,20 +4180,21 @@ But theme default background color doesn’t seem to exist.
Settings container key for basic responsive page layout support options.
public
- str
+ stringC_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT
= 'footnotes_inputfield_page_layout_support'
-
+
Whether to concatenate an additional stylesheet.
+
@@ -4856,23 +4223,20 @@ But theme default background color doesn’t seem to exist.
Settings container key to select the script mode for the reference container.
public
- str
+ stringC_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE
= 'footnotes_inputfield_reference_container_script_mode'
-
-
Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports.
-
-
+
@@ -4881,22 +4245,6 @@ But theme default background color doesn’t seem to exist.
@@ -4978,14 +4307,14 @@ But theme default background color doesn’t seem to exist.
Settings container key for scroll duration asymmetricity.
public
- str
+ intC_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY
= 'footnotes_inputfield_scroll_duration_asymmetricity'
@@ -5020,14 +4349,14 @@ But theme default background color doesn’t seem to exist.
-
Settings container key for the short code of the footnote’s end.
+
Settings container key for the short code of the footnote's end.
public
- str
+ stringC_STR_FOOTNOTES_SHORT_CODE_END
= 'footnote_inputfield_placeholder_end'
@@ -5062,14 +4391,14 @@ But theme default background color doesn’t seem to exist.
Settings container key for the user-defined short code of the footnotes end.
public
- str
+ stringC_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED
= 'footnote_inputfield_placeholder_end_user_defined'
@@ -5104,14 +4433,14 @@ But theme default background color doesn’t seem to exist.
-
Settings container key for the short code of the footnote’s start.
+
Settings container key for the short code of the footnote's start.
public
- str
+ stringC_STR_FOOTNOTES_SHORT_CODE_START
= 'footnote_inputfield_placeholder_start'
@@ -5146,14 +4475,14 @@ But theme default background color doesn’t seem to exist.
Settings container key for the user-defined short code of the footnotes start.
public
- str
+ stringC_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED
= 'footnote_inputfield_placeholder_start_user_defined'
@@ -5188,14 +4517,14 @@ But theme default background color doesn’t seem to exist.
Settings container key for the string after the footnote referrer.
public
- str
+ stringC_STR_FOOTNOTES_STYLING_AFTER
= 'footnote_inputfield_custom_styling_after'
@@ -5230,20 +4559,24 @@ But theme default background color doesn’t seem to exist.
Settings container key for the string before the footnote referrer.
public
- str
+ stringC_STR_FOOTNOTES_STYLING_BEFORE
= 'footnote_inputfield_custom_styling_before'
-
+
The default footnote referrer surroundings should be square brackets, as
+in English or US American typesetting, for better UX thanks to a more
+button-like appearance, as well as for stylistic consistency with the
+expand-collapse button.
+
@@ -5272,24 +4605,25 @@ But theme default background color doesn’t seem to exist.
Settings container key to configure the tooltip excerpt delimiter.
public
- str
+ stringC_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER
= 'footnotes_inputfield_tooltip_excerpt_delimiter'
-
-
Update: Tooltips: ability to display dedicated content before [[/tooltip]], thanks to @jbj2199 issue report.
-
-
The first implementation used a fixed shortcode provided in the changelog.
-But Footnotes’ UI design policy is to make shortcodes freely configurable.
+
The first implementation used a fixed shortcode provided in the changelog,
+but footnotes should have freely-configurable shortcodes.
+
Tooltips can display another content than the footnote entry in the
+reference container. The trigger is a shortcode in the footnote text
+separating the tooltip text from the note. That is consistent with what
+WordPress does for excerpts.
@@ -5299,22 +4633,6 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
@@ -5335,20 +4653,24 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
-
Settings container key to enable mirroring the tooltip excerpt in the reference container.
+
Settings container key to enable mirroring the tooltip excerpt in the
+reference container.
public
- str
+ stringC_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE
= 'footnotes_inputfield_tooltip_excerpt_mirror_enable'
-
+
Tooltips, even jQuery-driven, may be hard to consult on mobiles.
+This option allows users to read the tooltip content in the reference
+container too. See here for more information, and here for why this must not be the default behavior.
+
@@ -5364,21 +4686,6 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
-
@@ -5392,14 +4699,15 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
-
Settings container key to configure the tooltip excerpt separator in the reference container.
+
Settings container key to configure the tooltip excerpt separator in the
+reference container.
public
- str
+ stringC_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR
= 'footnotes_inputfield_tooltip_excerpt_mirror_separator'
@@ -5434,23 +4742,20 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key for the label of the Read-on button in truncated tooltips.
public
- str
+ stringC_STR_FOOTNOTES_TOOLTIP_READON_LABEL
= 'footnote_inputfield_readon_label'
-
-
Adding: Tooltips: Read-on button: Label: configurable instead of localizable, thanks to @rovanov example provision.
-
-
+
@@ -5459,22 +4764,6 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
@@ -5495,14 +4784,14 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key for the ID separator in fragment IDs.
public
- str
+ stringC_STR_HARD_LINK_IDS_SEPARATOR
= 'footnotes_inputfield_hard_link_ids_separator'
@@ -5537,14 +4826,14 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key for the backlink symbol selection.
public
- str
+ stringC_STR_HYPERLINK_ARROW
= 'footnote_inputfield_custom_hyperlink_symbol'
@@ -5564,36 +4853,8 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
1.5.0
-
-
Update: Restore arrow settings to customize or disable the now prepended arrow symbol, thanks to @mmallett issue report.
@@ -5607,14 +4868,14 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key for the user-defined backlink symbol.
public
- str
+ stringC_STR_HYPERLINK_ARROW_USER_DEFINED
= 'footnote_inputfield_custom_hyperlink_symbol_user'
@@ -5649,80 +4910,19 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key for the link element option.
public
- str
+ stringC_STR_LINK_ELEMENT_ENABLED
= 'footnote_inputfield_link_element_enabled'
-
-
Bugfix: Referrers and backlinks: Styling: make link elements optional to fix issues, thanks to @docteurfitness issue report and code contribution.
Tooltip font size reset to legacy by default since 2.1.4;
+Was set to inherit since 2.1.1 as it overrode custom CSS,
+Called mouse over box not tooltip for consistency.
+
+
+
+
+
@@ -5752,14 +4997,14 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key for the unit of the tooltip font size.
public
- str
+ stringC_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT
= 'footnotes_inputfield_mouse_over_box_font_size_unit'
@@ -5794,23 +5039,20 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key to enable the legacy layout of the reference container.
public
- str
+ stringC_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE
= 'footnotes_inputfield_reference_container_3column_layout_enable'
-
-
Bugfix: Reference container: option to restore pre-2.0.0 layout with the backlink symbol in an extra column.
-
-
+
@@ -5839,23 +5081,20 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key to enable the display of a backlink symbol.
public
- str
+ stringC_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE
= 'footnotes_inputfield_reference_container_backlink_symbol_enable'
-
-
Bugfix: Reference container: Backlink symbol: make optional, not suggest configuring it to invisible, thanks to @spaceling feedback.
-
-
+
@@ -5864,22 +5103,6 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
@@ -6141,7 +5308,7 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
public
- str
+ stringC_STR_REFERENCE_CONTAINER_NAME
= 'footnote_inputfield_references_label'
@@ -6176,14 +5343,14 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key for the position of the reference container.
public
- str
+ stringC_STR_REFERENCE_CONTAINER_POSITION
= 'footnote_inputfield_reference_container_place'
@@ -6218,23 +5385,20 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key for reference container position shortcode.
public
- str
+ stringC_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE
= 'footnote_inputfield_reference_container_position_shortcode'
-
-
Adding: Reference container: support for custom position shortcode, thanks to @hamshe issue report.
-
-
+
@@ -6243,22 +5407,6 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
@@ -6401,14 +5511,14 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Settings container key for the fragment ID slug in referrers.
public
- str
+ stringC_STR_REFERRER_FRAGMENT_ID_SLUG
= 'footnotes_inputfield_referrer_fragment_id_slug'
@@ -6458,18 +5568,19 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
These are the storage container names, one per dashboard tab.
+
@@ -6505,14 +5616,14 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
-
Contains all Default Settings for each Settings Container.
+
Contains all default values for each Settings Container.
private
- array<string|int, mixed>
+ array<string|int, string|int>$a_arr_default
= array(
// General settings.
@@ -6664,6 +5775,15 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
+ see
+
+
+
+
C_STR_*
+
+
+
+
since
@@ -6671,6 +5791,16 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
+
+
+ todo
+
+
+
+
Review. Why are the constants just initialised with these values?
+At the very least, we should stop using ‘yes’ to mean true etc.
+
+
@@ -6691,14 +5821,14 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
-
Contains all Settings from each Settings container as soon as this class is initialized.
+
Contains all Settings from each Settings Container.
private
- array<string|int, mixed>
+ array<string|int, string|int>$a_arr_settings
= array()
@@ -6738,7 +5868,7 @@ But Footnotes’ UI design policy is to make shortcodes freely configurable.
Stores a singleton reference of this class.
@@ -6782,68 +5912,6 @@ ull
-method
-public
"
->
-
- clear_all()
-
-
-
-
-
Deletes each Settings Container and loads the default values for each Settings Container.
-
-
- public
- clear_all() : mixed
-
-
-
-
-
-
- Tags
-
-
-
-
- since
-
-
- 1.5.0
-
-
Edit: This didn’t actually work.
-
-
-
-
- since
-
-
- 2.2.0
-
-
this function is not called any longer when deleting the plugin,
-to protect user data against loss, since manually updating a plugin is safer
-done by deleting and reinstalling (see the warning about database backup).
-
-
-
-
-
-
Return values
- mixed
- —
-
-
-
-
-
get()
@@ -6852,14 +5920,14 @@ done by deleting and reinstalling (see the warning about database backup).
-
Returns the value of specified Settings name.
+
Returns the value of specified Setting.
public
- get(string $p_str_key) : mixed
+ get(string $p_str_key) : string|int|null
@@ -6870,7 +5938,7 @@ done by deleting and reinstalling (see the warning about database backup).
: string
-
Settings Array Key name.
+
Setting key.
@@ -6894,9 +5962,9 @@ done by deleting and reinstalling (see the warning about database backup).
Return values
- mixed
+ string|int|null
—
-
Value of the Setting on Success or Null in Settings name is invalid.
+
Setting value, or null if setting key is invalid.
@@ -6914,7 +5982,7 @@ done by deleting and reinstalling (see the warning about database backup).
Returns the name of a specified Settings Container.
@@ -6932,7 +6000,7 @@ done by deleting and reinstalling (see the warning about database backup).
: int
-
Settings Container Array Key Index.
+
Settings Container index.
@@ -6976,14 +6044,14 @@ done by deleting and reinstalling (see the warning about database backup).
-
Returns the default values of a specific Settings Container.
+
Returns the default value(s) of a specific Settings Container.
public
- get_defaults(int $p_int_index) : array<string|int, mixed>
+ get_defaults(int $p_int_index) : array<string|int, string|int>
@@ -6994,7 +6062,7 @@ done by deleting and reinstalling (see the warning about database backup).
: int
-
Settings Container Aray Key Index.
+
Settings Container index.
@@ -7018,9 +6086,10 @@ done by deleting and reinstalling (see the warning about database backup).
+
@@ -7037,7 +6106,7 @@ done by deleting and reinstalling (see the warning about database backup).
Returns a singleton of this class.
@@ -7063,6 +6132,15 @@ done by deleting and reinstalling (see the warning about database backup).
+
+
+ todo
+
+
+
+
Remove?
+
+
@@ -7086,16 +6164,16 @@ done by deleting and reinstalling (see the warning about database backup).
-
Register all Settings Container for the Plugin Settings Page in the Dashboard.
+
Register all Settings Containers for the plugin Settings Page in the Dashboard.
publicregister_settings() : mixed
-
Settings Container Label will be the same as the Settings Container Name.
+
The Settings Container label will be the same as the Settings Container name.
@@ -7136,10 +6214,10 @@ done by deleting and reinstalling (see the warning about database backup).
-
Updates a whole Settings container.
+
Updates a whole Setting Container on save.
public
@@ -7154,7 +6232,7 @@ done by deleting and reinstalling (see the warning about database backup).
: int
-
Index of the Settings container.
+
Index of the Setting Container.
@@ -7163,7 +6241,7 @@ done by deleting and reinstalling (see the warning about database backup).
: array<string|int, mixed>
-
new Settings.
+
The new Settings value(s).
@@ -7206,10 +6284,10 @@ done by deleting and reinstalling (see the warning about database backup).
-
Class Constructor. Loads all Settings from each WordPress Settings container.
+
Loads all Settings from each WordPress Settings Container.
private
@@ -7255,14 +6333,14 @@ done by deleting and reinstalling (see the warning about database backup).
-
Loads all settings from specified settings container.
+
Loads all settings from specified Settings Containers.
private
- load(int $p_int_index) : array<string|int, mixed>
+ load(int $p_int_index) : array<string|int, string|int>
@@ -7273,7 +6351,7 @@ done by deleting and reinstalling (see the warning about database backup).
: int
-
Settings container array key index.
+
Settings container index.
@@ -7291,43 +6369,15 @@ done by deleting and reinstalling (see the warning about database backup).
1.5.0
-
-
Bugfix: Removed the 'trim' function to allow leading and trailing whitespace in settings text boxes, thanks to @compasscare bug report.
Base Class for all Plugin Widgets. Registers each Widget to WordPress.
+
Base class to be extended by all widget sub-classes.
-
The following Methods MUST be overwritten in each sub class:
-public function widget($args, $instance) -> echo the Widget Content
-public function form($instance) -> echo the Settings of the Widget
+
Any sub-class must override the appropriate method(s) provided by
+WP_Widget.
@@ -124,12 +108,11 @@
- author
+ abstract
-
Stefan Herndler
-
+
@@ -142,11 +125,11 @@
- subpackage
+ todo
-
public_widget
+
Review implemenation of Widgets API.
@@ -168,7 +151,7 @@
: mixed
-
Class Constructor. Registers the child Widget to WordPress.
Define the locale for this plugin for internationalization.
@@ -266,11 +239,11 @@ of the plugin.
-
The loader that's responsible for maintaining and registering all hooks that power
-the plugin.
+
The loader that's responsible for maintaining and registering all hooks
+that power the plugin.
protected
@@ -294,15 +267,6 @@ the plugin.
-
-
- access
-
-
-
-
protected
-
-
@@ -323,7 +287,7 @@ the plugin.
The unique identifier of this plugin
@@ -350,15 +314,6 @@ the plugin.
-
-
- access
-
-
-
-
protected
-
-
@@ -379,7 +334,7 @@ the plugin.
The current version of the plugin.
@@ -408,12 +363,12 @@ the plugin.
- access
+ see
-
-
protected
-
+ PLUGIN_VERSION
+
+
@@ -439,18 +394,18 @@ the plugin.
-
Define the core functionality of the plugin.
+
Builds the core of the plugin.
public
- __construct() : mixed
+ __construct() : void
-
Set the plugin name and the plugin version that can be used throughout the plugin.
-Load the dependencies, define the locale, and set the hooks for the admin area and
-the public-facing side of the site.
+
Set the plugin name and the plugin version that can be used throughout the
+plugin. Load the dependencies, define the locale, and set the hooks for
+the admin area and the public-facing side of the site.
@@ -468,11 +423,20 @@ the public-facing side of the site.
+
+
+ see
+
+
+ PLUGIN_VERSION
+
+
+
Return values
- mixed
+ void
—
@@ -491,10 +455,10 @@ the public-facing side of the site.
-
The reference to the class that orchestrates the hooks with the plugin.
+
Returns a reference to the class that orchestrates the hooks with the plugin.
public
@@ -513,7 +477,7 @@ the public-facing side of the site.
since
- 1.0.0
+ 2.8.0
@@ -523,8 +487,7 @@ the public-facing side of the site.
After properly displaying in dashboard headings until WPv5.4, the above started
+in WP 5.5 being torn apart as if the headline was text-align:justify and not
+the last line. That ugly display bug badly affected the plugin's communication.
+The only working solution found so far is using position:fixed in one heading
+that isn't translated, and dropping the logo in another, translatable heading.
Set the plugin name and the plugin version that can be used throughout the
+plugin. Load the dependencies, define the locale, and set the hooks for
+the admin area and the public-facing side of the site.
+
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 1.0.0
+
+
+
+
+
+ see
+
+
+ PLUGIN_VERSION
+
+
+
+
+
+
+
Return values
+ void
+ —
+
+
+
+
+
+
+ get_loader()
+
+
+
+
+
Returns a reference to the class that orchestrates the hooks with the plugin.
Displays available Hooks to look for Footnote short codes.
+
+
+ public
+ lookup_hooks() : mixed
+
+
Priority level was initially a hard-coded default
+shows ‘9223372036854775807’ in the numbox
+empty should be interpreted as PHP_INT_MAX,
+but a numbox cannot be set to empty, see here
+define -1 as PHP_INT_MAX instead
+
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 1.5.5
+
+
+
+
+
+
+
Return values
+ mixed
+ —
+
+
+
+
+
+
+ love()
+
+
+
+
+
Displays all settings for ‘I love Footnotes’ note.
+
+
+ public
+ love() : mixed
+
+
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 1.5.0
+
+
+
+
+
+
+
Return values
+ mixed
+ —
+
+
+
+
+
+
+ mouseover_box()
+
+
+
+
+
Displays enabled status for the footnotes mouse-over box.
The algorithm first checks for balanced footnote opening and closing tag short codes.
+The first encountered error triggers the display of a warning below the post title.
+
Unbalanced short codes have caused significant trouble because they are hard to detect.
+Any compiler or other tool reports syntax errors in the first place. Footnotes' exception
+is considered a design flaw, and the feature is released as a bug fix after overdue 2.3.0
+released in urgency to provide AMP compat before 2021.
As multiple posts are appended to each other, functions and fragment IDs must be disambiguated.
+post ID to make everything unique wrt infinite scroll and archive view.
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 2.0.6
+
+
+
+
+
+
+
+
+
+ $a_int_reference_container_id
+
+
+
+
+
+
+
Multiple reference containers in content and widgets.
This ID disambiguates multiple reference containers in a page
+as they may occur when the widget_text hook is active and the page
+is built with Elementor and has an accordion or similar toggle sections.
Websites may use high fixed headers not contracting at scroll.
+Scroll offset may now need to get into inline CSS.
+Hence it needs to be loaded twice, because priority levels may not match.
The input was already the processed excerpt, no more footnotes to search.
+But issue #65 brought up that manual excerpts can include processable footnotes.
+Default 'manual' is fallback and is backwards-compatible with the initial setup.
While the Classic Editor (visual mode) escapes both pointy brackets,
+the Block Editor enforces balanced escapement only in code editor mode
+when the opening tag is already escaped. In visual mode, the Block Editor
+does not escape the greater-than sign.
After properly displaying in dashboard headings until WPv5.4, the above started
+in WP 5.5 being torn apart as if the headline was text-align:justify and not
+the last line. That ugly display bug badly affected the plugin's communication.
+The only working solution found so far is using position:fixed in one heading
+that isn't translated, and dropping the logo in another, translatable heading.
Set the plugin name and the plugin version that can be used throughout the
+plugin. Load the dependencies, define the locale, and set the hooks for
+the admin area and the public-facing side of the site.
+
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 1.0.0
+
+
+
+
+
+ global
+
+
+
+
string PLUGIN_VERSION
+
+
+
+
+
+
Return values
+ void
+ —
+
+
+
+
+
+
+ get_loader()
+
+
+
+
+
Returns a reference to the class that orchestrates the hooks with the plugin.
Class defining action/filter registration for the plugin.
+
+
Maintain a list of all hooks that are registered throughout the plugin, and
+register them with the WordPress API. Call the run function to execute the
+list of actions and filters.
Settings container key for `the_content` hook priority level.
+
+
+ public
+ int
+ C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL
+ = 'footnote_inputfield_expert_lookup_the_content_priority_level'
+
+
+
+
Priority level of the_content and of widget_text as the only relevant
+hooks must be less than 99 because social buttons may yield scripts
+that contain the strings ‘((’ and ‘))’ (i.e., the default footnote
+start and end shortcodes), which causes issues with fake footnotes.
+
Setting the_content priority to 10 instead of PHP_INT_MAX makes the
+footnotes reference container display beneath the post and above other
+features added by other plugins, e.g. related post lists and social buttons.
+
For the YARPP plugin to display related posts below the Footnotes reference container,
+priority needs to be at least 1,200.
+
PHP_INT_MAX cannot be reset by leaving the number box empty, because
+WebKit browsers don't allow it, so we must resort to -1.
This must be false if its setting is contained in the container to be hidden
+because when saving, all missing constants are emptied, and Footnotes_Convert::to_bool() converts empty to false.
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 2.2.2
+
+
+
+
+
+ since
+
+
+ 2.3.0
+
+
Swap migration Boolean, meaning ‘show legacy’ instead of
+‘migration complete’, due to storage data structure constraints.
+
+
+
+
+
+
+
+
+ C_STR_CUSTOM_CSS_NEW
+
+
+
+
+
+
Settings container key for the Custom CSS migrated to a dedicated tab.
These are checkboxes; the keyword checked is converted to true, whilst
+an empty string (the default) is converted to false.
+
Hooks should all be enabled by default to prevent users from thinking at
+first that the feature is broken in post titles (see here for more
+information).
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 1.5.5
+
+
+
+
+
+ todo
+
+
+
+
In titles, footnotes are still buggy, because WordPress uses the
+title string in menus and in the title element, but Footnotes doesn't
+delete footnotes in them.
+
+
+
+
+
+
+
+
+ C_STR_EXPERT_LOOKUP_WIDGET_TEXT
+
+
+
+
+
+
Settings container key to enable the `widget_text` hook.
The widget_text hook must be disabled by default, because it causes
+multiple reference containers to appear in Elementor accordions, but
+it must be enabled if multiple reference containers are desired, as
+in Elementor toggles.
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 1.5.5
+
+
+
+
+
+
+
+
+
+ C_STR_EXPERT_LOOKUP_WIDGET_TITLE
+
+
+
+
+
+
Settings container key to enable the `widget_title` hook.
When hard links are enabled, clicks on the backlinks are logged in the
+browsing history, along with clicks on the referrers.
+This tooltip hints to use the backbutton instead, so the history gets
+streamlined again.
+See here for more information.
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 2.5.4
+
+
+
+
+
+
+
+
+
+ C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT
+
+
+
+
+
+
Settings container key to configure the backlink tooltip.
Since the removal of the the_post hook, the tab is no danger zone any longer.
+All users, not experts only, need to be able to control relative positioning.
If hard links are not enabled, clicking a referrer in an input element label
+toggles the state of the input element the label is connected to.
+Beside hard links, other solutions include moving footnotes off the label and
+append them, or disconnecting this label from the input element (discouraged).
+See here for more information.
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 2.5.12
+
+
+
+
+
+ todo
+
+
+
+
Review, remove?
+
+
+
+
+
+
+
+
+ C_STR_FOOTNOTES_LOVE
+
+
+
+
+
+
Settings container key for the ‘I love footnotes’ text.
These alternative tooltips work around a website-related jQuery UI
+outage. They are low-script but use the AMP-incompatible onmouseover
+and onmouseout arguments, along with CSS transitions for fade-in/out.
+The very small script is inserted after the plugin's internal stylesheet.
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 2.1.1
+
+
+
+
+
+
+
+
+
+ C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND
+
+
+
+
+
+
Settings container key for the mouse-over box to define the background color.
The mouse-over content truncation should be enabled by default to raise
+awareness of the functionality, prevent the screen from being filled on
+mouse-over, and allow the use of ‘Continue Reading’ functionality.
+
+
+
+
+
+
+
+
+ C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION
+
+
+
+
+
+
Settings container key for the mouse-over box to define the position.
The default position should not be lateral because of the risk
+the box gets squeezed between note anchor at line end and window edge,
+and top because reading at the bottom of the window is more likely.
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 1.5.7
+
+
+
+
+
+
+
+
+
+ C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR
+
+
+
+
+
+
Settings container key for the mouse-over box to define the box-shadow color.
The default footnote referrer surroundings should be square brackets, as
+in English or US American typesetting, for better UX thanks to a more
+button-like appearance, as well as for stylistic consistency with the
+expand-collapse button.
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 1.5.0
+
+
+
+
+
+
+
+
+
+ C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER
+
+
+
+
+
+
Settings container key to configure the tooltip excerpt delimiter.
The first implementation used a fixed shortcode provided in the changelog,
+but footnotes should have freely-configurable shortcodes.
+
Tooltips can display another content than the footnote entry in the
+reference container. The trigger is a shortcode in the footnote text
+separating the tooltip text from the note. That is consistent with what
+WordPress does for excerpts.
Tooltips, even jQuery-driven, may be hard to consult on mobiles.
+This option allows users to read the tooltip content in the reference
+container too. See here for more information, and here for why this must not be the default behavior.
Tooltip font size reset to legacy by default since 2.1.4;
+Was set to inherit since 2.1.1 as it overrode custom CSS,
+Called mouse over box not tooltip for consistency.
+
+
+
+
+
+
+
+
+ C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT
+
+
+
+
+
+
Settings container key for the unit of the tooltip font size.
The algorithm first checks for balanced footnote opening and closing tag short codes.
+The first encountered error triggers the display of a warning below the post title.
+
Unbalanced short codes have caused significant trouble because they are hard to detect.
+Any compiler or other tool reports syntax errors in the first place. Footnotes' exception
+is considered a design flaw, and the feature is released as a bug fix after overdue 2.3.0
+released in urgency to provide AMP compat before 2021.
As multiple posts are appended to each other, functions and fragment IDs must be disambiguated.
+post ID to make everything unique wrt infinite scroll and archive view.
+
+
+
+
+ Tags
+
+
+
+
+ since
+
+
+ 2.0.6
+
+
+
+
+
+
+
+
+
+ $a_int_reference_container_id
+
+
+
+
+
+
+
Multiple reference containers in content and widgets.
This ID disambiguates multiple reference containers in a page
+as they may occur when the widget_text hook is active and the page
+is built with Elementor and has an accordion or similar toggle sections.
Websites may use high fixed headers not contracting at scroll.
+Scroll offset may now need to get into inline CSS.
+Hence it needs to be loaded twice, because priority levels may not match.
The input was already the processed excerpt, no more footnotes to search.
+But issue #65 brought up that manual excerpts can include processable footnotes.
+Default 'manual' is fallback and is backwards-compatible with the initial setup.
While the Classic Editor (visual mode) escapes both pointy brackets,
+the Block Editor enforces balanced escapement only in code editor mode
+when the opening tag is already escaped. In visual mode, the Block Editor
+does not escape the greater-than sign.
Since everything within the plugin is registered via hooks,
-then kicking off the plugin from this point in the file does
-not affect the page life cycle.
+
Since everything within the plugin is registered via hooks, then kicking off
+the plugin from this point in the file does not affect the page life cycle.