2021-03-03 18:58:03 +00:00
< ? php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName, WordPress.Security.EscapeOutput.OutputNotEscaped
2021-03-02 03:09:34 +00:00
/**
* Includes the core function of the Plugin - Search and Replace the Footnotes .
*
* @ filesource
2021-03-03 18:58:03 +00:00
* @ package footnotes
2021-03-02 03:09:34 +00:00
* @ since 1.5 . 0
*
* @ since 2.0 . 0 Bugfix : various .
* @ since 2.0 . 4 Bugfix : Referrers and backlinks : remove hard links to streamline browsing history , thanks to @ theroninjedi47 bug report .
* @ since 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 .
2021-03-18 10:53:57 +00:00
* @ since 2.0 . 6 Bugfix : Infinite scroll : debug autoload by adding post ID , thanks to @ docteurfitness issue report and code contribution .
2021-03-02 03:09:34 +00:00
* @ since 2.0 . 6 Bugfix : Priority level back to PHP_INT_MAX ( ref container positioning not this plugin’ s responsibility ) .
* @ since 2.0 . 6 Bugfix : Reference container : fix line breaking behavior in footnote number clusters .
* @ since 2.0 . 7 BUGFIX : Hooks : Default - disable 'the_post' , thanks to @ spaceling @ markcheret @ nyamachi @ whichgodsaves @ spiralofhope2 @ mmallett @ andreasra @ widecast @ ymorin007 @ tashi1es bug reports .
2021-04-15 04:09:23 +00:00
* @ since 2.0 . 9 Bugfix : Remove the_post hook .
2021-03-02 03:09:34 +00:00
* @ since 2.1 . 0 Adding : Tooltips : Read - on button : Label : configurable instead of localizable , thanks to @ rovanov example provision .
* @ 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 : fix start pages by making its display optional , thanks to @ dragon013 bug report .
* @ since 2.1 . 1 Bugfix : Referrers : new setting for vertical align : superscript ( default ) or baseline ( optional ), thanks to @ cwbayer bug report .
* @ since 2.1 . 1 Bugfix : Reference container : option to append symbol ( prepended by default ), thanks to @ spaceling code contribution .
* @ since 2.1 . 1 Bugfix : Reference container : Backlink symbol : make optional , not suggest configuring it to invisible , thanks to @ spaceling feedback .
* @ since 2.1 . 1 Bugfix : Dashboard : priority level setting for the_content hook , thanks to @ imeson 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 . 1 Bugfix : Reference container : option to restore pre - 2.0 . 0 layout with the backlink symbol in an extra column .
* @ since 2.1 . 2 Bugfix : Dashboard : priority level settings for all other hooks , thanks to @ nikelaos bug report .
* @ since 2.1 . 3 Bugfix : Reference container : fix width in mobile view by URL wrapping for Unicode - non - conformant browsers , thanks to @ karolszakiel bug report .
* @ since 2.1 . 4 Bugfix : Styling : Referrers and backlinks : make link elements optional to fix issues .
* @ since 2.1 . 4 Bugfix : Reference container : Backlink symbol : support for appending when combining identicals is on .
* @ since 2.1 . 4 Bugfix : Reference container : make separating and terminating punctuation optional and configurable , thanks to @ docteurfitness issue report and code contribution .
* @ since 2.1 . 4 Bugfix : Reference container : Backlinks : fix stacked enumerations by adding optional line breaks .
* @ since 2.1 . 4 Bugfix : Reference container : fix layout issues by moving backlink column width to settings .
* @ since 2.1 . 4 Bugfix : Styling : Tooltips : fix font size issue by adding font size to settings with legacy as default .
* @ since 2.1 . 4 Bugfix : Scroll offset : make configurable to fix site - dependent issues related to fixed headers .
* @ since 2.1 . 4 Bugfix : Scroll duration : make configurable to conform to website content and style requirements .
* @ since 2.1 . 4 Bugfix : Tooltips : make display delays and fade durations configurable to conform to website style .
* @ since 2.1 . 4 Bugfix : Referrers and backlinks : Styling : make link elements optional to fix issues , thanks to @ docteurfitness issue report and code contribution .
* @ since 2.1 . 4 Bugfix : Reference container , tooltips : fix line wrapping of URLs ( hyperlinked or not ) based on pattern , not link element .
* @ since 2.1 . 4 Bugfix : Reference container : Backlink symbol : support for appending when combining identicals is on .
* @ since 2.1 . 4 Bugfix : Reference container : Backlinks : fix line breaking with respect to separators and terminators .
* @ since 2.1 . 5 Bugfix : Reference container , tooltips : URL wrap : exclude image source too , thanks to @ bjrnet21 bug report .
* @ since 2.1 . 6 Bugfix : Reference container , tooltips : URL wrap : fix regex , thanks to @ a223123131 bug report .
* @ since 2.1 . 6 Bugfix : Dashboard : URL wrap : add option to properly enable / disable URL wrap .
* @ since 2.2 . 0 Adding : Reference container : support for custom position shortcode , thanks to @ hamshe issue report .
* @ since 2.2 . 3 Bugfix : Custom CSS : insert new CSS in the public page header element after existing CSS .
* @ since 2.2 . 5 Bugfix : Reference container : delete position shortcode if unused because position may be widget or footer , thanks to @ hamshe bug report .
* @ 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.2 . 5 Update : Tooltips : Alternative tooltips : connect to position / timing settings ( for themes not supporting jQuery tooltips ) .
* @ since 2.2 . 6 Bugfix : Reference container , tooltips : URL wrap : make the quotation mark optional wrt query parameters , thanks to @ spiralofhope2 bug report .
* @ since 2.2 . 7 Bugfix : Reference container , tooltips : URL wrap : remove a bug introduced in the regex , thanks to @ rjl20 @ spaceling @ lukashuggenberg @ klusik @ friedrichnorth @ bernardzit bug reports .
* @ since 2.2 . 8 Bugfix : Reference container , tooltips : URL wrap : correctly make the quotation mark optional wrt query parameters , thanks to @ spiralofhope2 bug report .
* @ since 2.2 . 9 Bugfix : Reference container , tooltips : URL wrap : account for RFC 2396 allowed characters in parameter names .
* @ since 2.2 . 9 Bugfix : Reference container , widget_text hook : support for multiple containers in a page , thanks to @ justbecuz bug report .
* @ since 2.2 . 9 Bugfix : Reference container , tooltips : URL wrap : exclude URLs also where the equals sign is preceded by an entity or character reference .
* @ since 2.2 . 10 Bugfix : Reference container : add option for table borders to restore pre - 2.0 . 0 design , thanks to @ noobishh issue report .
* @ since 2.2 . 10 Bugfix : Reference container , tooltips : URL wrap : support also file transfer protocol URLs .
* @ since 2.3 . 0 Bugfix : Reference container : convert top padding to margin and make it a setting , thanks to @ hamshe bug report .
2021-03-18 10:53:57 +00:00
* @ since 2.3 . 0 Adding : Referrers and backlinks : optional hard links for AMP compatibility , thanks to @ psykonevro issue report , thanks to @ martinneumannat issue report and code contribution .
2021-03-02 03:09:34 +00:00
* @ since 2.3 . 0 Bugfix : Dashboard : Custom CSS : swap migration Boolean , meaning 'show legacy' instead of 'migration complete' , due to storage data structure constraints .
* @ since 2.4 . 0 Adding : Footnote delimiters : syntax validation for balanced footnote start and end tag short codes .
* @ since 2.4 . 0 Bugfix : Scroll offset : initialize to safer one third window height for more robustness , thanks to @ lukashuggenberg bug report .
* @ since 2.4 . 0 Bugfix : Reference container : Label : set empty label to U + 202 F NNBSP for more robustness , thanks to @ lukashuggenberg feedback .
* @ since 2.4 . 0 Bugfix : Templates : optimize template load and processing based on settings , thanks to @ misfist code contribution .
* @ since 2.4 . 0 Bugfix : Process : initialize hard link address variables to empty string to fix 'undefined variable' bug , thanks to @ a223123131 bug report .
* @ since 2.5 . 0 Bugfix : Hooks : support footnotes on category pages , thanks to @ vitaefit bug report , thanks to @ misfist code contribution .
* @ 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 .
* @ since 2.5 . 1 Bugfix : Hooks : support footnotes in Popup Maker popups , thanks to @ squatcher bug report .
* @ since 2.5 . 2 Update : Tooltips : ability to display dedicated content before `[[/tooltip]]` , thanks to @ jbj2199 issue report .
* @ since 2.5 . 3 Bugfix : Reference container , tooltips : URL wrap : exclude URL pattern as folder name in Wayback Machine URL , thanks to @ rumperuu 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 .
* @ since 2.5 . 4 Bugfix : Reference container , tooltips : URL wrap : account for leading space in value , thanks to @ karolszakiel example provision .
* @ since 2.5 . 4 Update : Reference container : Hard backlinks ( optional ) : optional configurable tooltip hinting to use the backbutton instead , thanks to @ theroninjedi47 bug report .
* @ since 2.5 . 4 Bugfix : Tooltips : fix display in Popup Maker popups by correcting a coding error .
* @ since 2.5 . 5 Bugfix : Process : fix numbering bug impacting footnote #2 with footnote #1 close to start, thanks to @rumperuu bug report, thanks to @lolzim code contribution.
* @ since 2.5 . 6 Bugfix : Reference container : optional alternative expanding and collapsing without jQuery for use with hard links , thanks to @ hopper87it @ pkverma99 issue reports .
* @ since 2.5 . 7 Bugfix : Process : fix footnote duplication by emptying the footnotes list every time the search algorithm is run on the content , thanks to @ inoruhana bug report .
2021-03-19 23:58:23 +00:00
* @ since 2.5 . 11 Bugfix : Forms : remove footnotes from input field values , thanks to @ bogosavljev bug report .
2021-03-25 03:07:17 +00:00
* @ since 2.5 . 14 Bugfix : Footnote delimiter short codes : fix numbering bug by cross - editor HTML escapement schema harmonization , thanks to @ patrick_here @ alifarahani8000 @ gova bug reports .
2021-03-02 03:09:34 +00:00
*/
2021-03-03 18:58:03 +00:00
// If called directly, abort.
if ( ! defined ( 'ABSPATH' ) ) {
die ;
}
2021-03-02 03:09:34 +00:00
/**
2021-03-24 21:19:07 +00:00
* Searches and replaces the footnotes and generates the reference container .
2021-03-02 03:09:34 +00:00
*
* @ since 1.5 . 0
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
class Footnotes_Task {
2021-03-02 03:09:34 +00:00
/**
2021-03-24 21:19:07 +00:00
* Contains all footnotes found in the searched content .
2021-03-02 03:09:34 +00:00
*
* @ since 1.5 . 0
* @ var array
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $footnotes = array ();
2021-03-02 03:09:34 +00:00
/**
* Flag if the display of 'LOVE FOOTNOTES' is allowed on the current public page .
*
* @ since 1.5 . 0
* @ var bool
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $allow_love_me = true ;
2021-03-02 03:09:34 +00:00
/**
* Prefix for the Footnote html element ID .
*
* @ since 1.5 . 8
* @ var string
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $prefix = '' ;
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Autoload a . k . a . infinite scroll , or archive view .
2021-03-02 03:09:34 +00:00
*
2021-03-18 10:53:57 +00:00
* - Bugfix : Infinite scroll : debug autoload by adding post ID , thanks to @ docteurfitness issue report and code contribution
2021-03-02 03:09:34 +00:00
*
2021-03-24 21:19:07 +00:00
* @ reporter @ docteurfitness
* @ link https :// wordpress . org / support / topic / auto - load - post - compatibility - update /
2021-03-02 03:09:34 +00:00
*
* @ contributor @ docteurfitness
* @ link https :// wordpress . org / support / topic / auto - load - post - compatibility - update / #post-13618833
*
2021-03-24 21:19:07 +00:00
* @ since 2.0 . 6
* @ var int
2021-03-02 03:09:34 +00:00
*
* As multiple posts are appended to each other , functions and fragment IDs must be disambiguated .
2021-03-03 18:58:03 +00:00
* post ID to make everything unique wrt infinite scroll and archive view .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $post_id = 0 ;
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Multiple reference containers in content and widgets .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container , widget_text hook : support for multiple containers in a page , thanks to @ justbecuz bug report .
*
* @ reporter @ justbecuz
* @ link https :// wordpress . org / support / topic / reset - footnotes - to - 1 /
* @ link https :// wordpress . org / support / topic / reset - footnotes - to - 1 / #post-13662830
*
2021-03-24 21:19:07 +00:00
* @ since 2.2 . 9
* @ var int Incremented every time after a reference container is inserted .
2021-03-02 03:09:34 +00:00
*
* 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 .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $reference_container_id = 1 ;
2021-03-02 03:09:34 +00:00
/**
2021-03-24 21:19:07 +00:00
* Hard links for AMP compatibility .
2021-03-02 03:09:34 +00:00
*
* @ since 2.0 . 0 Bugfix : footnote links script independent .
*
* - Bugfix : Referrers and backlinks : remove hard links to streamline browsing history , thanks to @ theroninjedi47 bug report .
*
* @ reporter @ theroninjedi47
* @ link https :// wordpress . org / support / topic / hyperlinked - footnotes - creating - excessive - back - history /
*
2021-03-24 21:19:07 +00:00
* @ since 2.0 . 4
2021-03-02 03:09:34 +00:00
*
2021-03-18 10:53:57 +00:00
* - Adding : Referrers and backlinks : optional hard links for AMP compatibility , thanks to @ psykonevro issue report , thanks to @ martinneumannat issue report and code contribution .
2021-03-02 03:09:34 +00:00
*
* @ contributor @ martinneumannat
* @ link https :// wordpress . org / support / topic / making - it - amp - compatible /
*
* @ reporter @ psykonevro
* @ link https :// wordpress . org / support / topic / footnotes - is - not - amp - compatible /
*
2021-03-03 18:58:03 +00:00
* @ since 2.3 . 0
* @ var bool
2021-03-24 21:19:07 +00:00
* A property because used both in search () and reference_container () .
2021-03-03 18:58:03 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $hard_links_enabled = false ;
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* The referrer slug .
*
* @ since 2.3 . 0
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $referrer_link_slug = 'r' ;
2021-03-03 18:58:03 +00:00
/**
* The footnote slug .
*
* @ since 2.3 . 0
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $footnote_link_slug = 'f' ;
2021-03-03 18:58:03 +00:00
/**
* The slug and identifier separator .
*
* @ since 2.3 . 0
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
private static $link_ids_separator = '+' ;
2021-03-03 18:58:03 +00:00
/**
2021-03-24 21:19:07 +00:00
* Contains the concatenated fragment ID base .
2021-03-03 18:58:03 +00:00
*
* @ since 2.3 . 0
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $post_container_id_compound = '' ;
2021-03-03 18:58:03 +00:00
/**
* Scroll offset .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Scroll offset : make configurable to fix site - dependent issues related to fixed headers .
*
* @ since 2.1 . 4
*
* - Bugfix : Scroll offset : initialize to safer one third window height for more robustness , thanks to @ lukashuggenberg bug report .
*
* @ reporter @ lukashuggenberg
* @ link https :// wordpress . org / support / topic / 2 - 2 - 6 - breaks - all - footnotes / #post-13857922
*
2021-03-24 21:19:07 +00:00
* @ since 2.4 . 0
2021-03-02 03:09:34 +00:00
* @ var int
*
* 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 .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $scroll_offset = 34 ;
2021-03-02 03:09:34 +00:00
/**
* Optional link element for footnote referrers and backlinks
*
* @ since 2.0 . 0 add link elements along with hard links .
*
* - Bugfix : Referrers and backlinks : Styling : make link elements optional to fix issues , thanks to @ docteurfitness issue report and code contribution .
*
2021-03-24 21:19:07 +00:00
* @ reporter @ docteurfitness
* @ link https :// wordpress . org / support / topic / update - 2 - 1 - 3 /
2021-03-02 03:09:34 +00:00
*
* @ contributor @ docteurfitness
* @ link https :// wordpress . org / support / topic / update - 2 - 1 - 3 / #post-13704194
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 4
2021-03-02 03:09:34 +00:00
*
2021-03-18 10:53:57 +00:00
* - Adding : Referrers and backlinks : optional hard links for AMP compatibility , thanks to @ psykonevro issue report , thanks to @ martinneumannat issue report and code contribution .
2021-03-02 03:09:34 +00:00
*
* @ contributor @ martinneumannat
* @ link https :// wordpress . org / support / topic / making - it - amp - compatible /
*
* @ reporter @ psykonevro
* @ link https :// wordpress . org / support / topic / footnotes - is - not - amp - compatible /
*
2021-03-24 21:19:07 +00:00
* @ since 2.3 . 0
*
2021-03-02 03:09:34 +00:00
* Although widely used for that purpose , hyperlinks are disliked for footnote linking .
* Browsers may need to be prevented from logging these clicks in the browsing history ,
* as logging compromises the usability of the 'return to previous' button in browsers .
* For that purpose , and for scroll animation , this linking is performed by JavaScript .
*
* Link elements raise concerns , so that mitigating their proliferation may be desired .
*
* By contrast , due to an insufficiency in the CSS standard , coloring elements with the
* theme’ s link color requires real link elements and cannot be done with named colors ,
* as CSS does not support 'color: link|hover|active|visited' , after the pseudo - classes
* of the link element .
*
* Yet styling these elements with the link color is not universally preferred , so that
* the very presence of these link elements may need to be avoided .
*
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ see self :: $hard_links_enabled
2021-03-24 21:19:07 +00:00
* A property because used both in search () and reference_container () .
2021-03-03 18:58:03 +00:00
*/
/**
* The span element name .
*
* @ since 2.3 . 0
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $link_span = 'span' ;
2021-03-03 18:58:03 +00:00
/**
* The opening tag .
*
* @ since 2.3 . 0
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $link_open_tag = '' ;
2021-03-03 18:58:03 +00:00
/**
* The closing tag .
*
* @ since 2.3 . 0
* @ var str
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $link_close_tag = '' ;
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Dedicated tooltip text .
2021-03-02 03:09:34 +00:00
*
* - Update : Tooltips : ability to display dedicated content before `[[/tooltip]]` , thanks to @ jbj2199 issue report .
*
* @ reporter @ jbj2199
* @ link https :// wordpress . org / support / topic / change - tooltip - text /
*
2021-03-24 21:19:07 +00:00
* @ since 2.5 . 2
*
2021-03-02 03:09:34 +00:00
* 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 .
*/
/**
2021-03-03 18:58:03 +00:00
* The tooltip delimiter shortcode .
*
* @ since 2.5 . 2
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $tooltip_shortcode = '[[/tooltip]]' ;
2021-03-03 18:58:03 +00:00
/**
* The tooltip delimiter shortcode length .
*
* @ since 2.5 . 2
* @ var int
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $tooltip_shortcode_length = 12 ;
2021-03-03 18:58:03 +00:00
/**
* Whether to mirror the tooltip text in the reference container .
*
* @ since 2.5 . 2
* @ var bool
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $mirror_tooltip_text = false ;
2021-03-03 18:58:03 +00:00
/**
2021-03-28 12:41:33 +00:00
* Footnote delimiter start short code .
*
* @ since 1.5 . 0 ( constant , variable )
* @ since 2.6 . 2 ( property )
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $start_tag = '' ;
2021-03-28 12:41:33 +00:00
/**
* Footnote delimiter end short code .
*
* @ since 1.5 . 0 ( constant , variable )
* @ since 2.6 . 2 ( property )
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $end_tag = '' ;
2021-03-28 12:41:33 +00:00
/**
* Footnote delimiter start short code in regex format .
*
* @ since 2.4 . 0 ( variable )
* @ since 2.6 . 2 ( property )
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $start_tag_regex = '' ;
2021-03-28 12:41:33 +00:00
/**
* Footnote delimiter end short code in regex format .
*
* @ since 2.4 . 0 ( variable )
* @ since 2.6 . 2 ( property )
* @ var str
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $end_tag_regex = '' ;
2021-03-28 12:41:33 +00:00
/**
* Footnote delimiter syntax validation enabled .
2021-03-02 03:09:34 +00:00
*
* - Adding : Footnote delimiters : syntax validation for balanced footnote start and end tag short codes .
*
* @ since 2.4 . 0
*
* @ var bool
*
* 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.
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public static $syntax_error_flag = true ;
2021-03-02 03:09:34 +00:00
/**
* Register WordPress Hooks to replace Footnotes in the content of a public page .
*
* @ since 1.5 . 0
*
* @ since 1.5 . 4 Adding : Hooks : support 'the_post' in response to user request for custom post types .
* @ since 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 ) .
* @ since 2.0 . 7 BUGFIX : Hooks : Default - disable 'the_post' , thanks to @ spaceling @ markcheret @ nyamachi @ whichgodsaves @ spiralofhope2 @ mmallett @ andreasra @ widecast @ ymorin007 @ tashi1es bug reports .
2021-04-15 04:09:23 +00:00
* @ since 2.0 . 7 Bugfix : Set priority level back to 10 assuming it is unproblematic .
2021-03-02 03:09:34 +00:00
* @ since 2.0 . 8 Bugfix : Priority level back to PHP_INT_MAX ( need to get in touch with other plugins ) .
* @ since 2.1 . 0 UPDATE : Hooks : remove 'the_post' , the plugin stops supporting this hook .
* @ since 2.1 . 1 Bugfix : Dashboard : priority level setting for the_content hook , thanks to @ imeson bug report .
* @ since 2.1 . 2 Bugfix : Dashboard : priority level settings for all other hooks , thanks to @ nikelaos bug report .
* @ since 2.5 . 0 Bugfix : Hooks : support footnotes on category pages , thanks to @ vitaefit bug report , thanks to @ misfist code contribution .
* @ since 2.5 . 1 Bugfix : Hooks : support footnotes in Popup Maker popups , thanks to @ squatcher bug report .
*/
2021-03-03 18:58:03 +00:00
public function register_hooks () {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Get values from settings.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$the_title_priority = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL ) );
$the_content_priority = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL ) );
$the_excerpt_priority = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL ) );
$widget_title_priority = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL ) );
$widget_text_priority = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL ) );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// PHP_INT_MAX can be set by -1.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$the_title_priority = ( - 1 === $the_title_priority ) ? PHP_INT_MAX : $the_title_priority ;
$the_content_priority = ( - 1 === $the_content_priority ) ? PHP_INT_MAX : $the_content_priority ;
$the_excerpt_priority = ( - 1 === $the_excerpt_priority ) ? PHP_INT_MAX : $the_excerpt_priority ;
$widget_title_priority = ( - 1 === $widget_title_priority ) ? PHP_INT_MAX : $widget_title_priority ;
$widget_text_priority = ( - 1 === $widget_text_priority ) ? PHP_INT_MAX : $widget_text_priority ;
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Append custom css to the header.
2021-03-28 12:41:33 +00:00
add_filter ( 'wp_head' , array ( $this , 'footnotes_output_head' ), PHP_INT_MAX );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Append the love and share me slug to the footer.
2021-03-28 12:41:33 +00:00
add_filter ( 'wp_footer' , array ( $this , 'footnotes_output_footer' ), PHP_INT_MAX );
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: EXPERT_LOOKUP_THE_TITLE ) ) ) {
add_filter ( 'the_title' , array ( $this , 'footnotes_in_title' ), $the_title_priority );
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Configurable priority level for reference container relative positioning; default 98.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: EXPERT_LOOKUP_THE_CONTENT ) ) ) {
add_filter ( 'the_content' , array ( $this , 'footnotes_in_content' ), $the_content_priority );
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Hook for category pages .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Hooks : support footnotes on category pages , thanks to @ vitaefit bug report , thanks to @ misfist code contribution .
*
2021-03-24 21:19:07 +00:00
* @ reporter @ vitaefit
* @ link https :// wordpress . org / support / topic / footnote - doesntwork - on - category - page /
2021-03-02 03:09:34 +00:00
*
* @ contributor @ misfist
* @ link https :// wordpress . org / support / topic / footnote - doesntwork - on - category - page / #post-13864859
*
2021-03-24 21:19:07 +00:00
* @ since 2.5 . 0
2021-03-02 03:09:34 +00:00
*
* Category pages can have rich HTML content in a term description with article status .
* For this to happen , WordPress’ built - in partial HTML blocker needs to be disabled .
* @ link https :// docs . woocommerce . com / document / allow - html - in - term - category - tag - descriptions /
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
add_filter ( 'term_description' , array ( $this , 'footnotes_in_content' ), $the_content_priority );
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Hook for popup maker popups .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Hooks : support footnotes in Popup Maker popups , thanks to @ squatcher bug report .
*
* @ reporter @ squatcher
* @ link https :// wordpress . org / support / topic / footnotes - use - in - popup - maker /
2021-03-24 21:19:07 +00:00
*
* @ since 2.5 . 1
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
add_filter ( 'pum_popup_content' , array ( $this , 'footnotes_in_content' ), $the_content_priority );
2021-03-02 03:09:34 +00:00
}
2021-04-14 23:10:29 +00:00
/**
* Adds a filter to the excerpt hook .
*
* @ since 1.5 . 0 The hook 'get_the_excerpt' is filtered too .
* @ since 1.5 . 5 The hook 'get_the_excerpt' is removed but not documented in changelog or docblock .
* @ since 2.6 . 2 The hook 'get_the_excerpt' is readded when attempting to debug excerpt handling .
* @ since 2.6 . 6 The hook 'get_the_excerpt' is removed again because it seems to cause issues in some themes .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: EXPERT_LOOKUP_THE_EXCERPT ) ) ) {
add_filter ( 'the_excerpt' , array ( $this , 'footnotes_in_excerpt' ), $the_excerpt_priority );
2021-03-02 03:09:34 +00:00
}
2021-04-14 23:10:29 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: EXPERT_LOOKUP_WIDGET_TITLE ) ) ) {
add_filter ( 'widget_title' , array ( $this , 'footnotes_in_widget_title' ), $widget_title_priority );
2021-03-02 03:09:34 +00:00
}
2021-04-14 23:10:29 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: EXPERT_LOOKUP_WIDGET_TEXT ) ) ) {
add_filter ( 'widget_text' , array ( $this , 'footnotes_in_widget_text' ), $widget_text_priority );
2021-03-02 03:09:34 +00:00
}
/**
2021-03-03 18:58:03 +00:00
* The the_post hook .
2021-03-02 03:09:34 +00:00
*
* - Adding : Hooks : support 'the_post' in response to user request for custom post types .
*
* @ since 1.5 . 4
* @ accountable @ aricura
* @ link https :// wordpress . org / support / topic / doesnt - work - in - custon - post - types / #post-5339110
*
*
* - Update : Hooks : Default - enable all hooks to prevent footnotes from seeming broken in some parts .
*
* @ since 2.0 . 5
* @ accountable @ pewgeuges
*
*
* - BUGFIX : Hooks : Default - disable 'the_post' , thanks to @ spaceling @ markcheret @ nyamachi @ whichgodsaves @ spiralofhope2 @ mmallett @ andreasra @ widecast @ ymorin007 @ tashi1es bug reports .
*
* @ reporter @ spaceling
* @ link https :// wordpress . org / support / topic / change - the - position - 5 / #post-13612697
*
* @ reporter @ markcheret on behalf of W . Beinert
* @ link https :// wordpress . org / support / topic / footnotes - now - appear - in - summaries - even - though - this - is - marked - no /
*
* @ reporter @ nyamachi
* @ link https :// wordpress . org / support / topic / footnotes - appearing - in - header /
*
* @ reporter @ whichgodsaves
* @ link https :// wordpress . org / support / topic / footnotes - appearing - in - header / #post-13622694
*
* @ reporter @ spiralofhope2
* @ link https :// wordpress . org / support / topic / 2 - 0 - 5 - broken /
*
* @ reporter @ mmallett
* @ link https :// wordpress . org / support / topic / 2 - 0 - 5 - broken / #post-13623208
*
* @ reporter @ andreasra
* @ link https :// wordpress . org / support / topic / footnotes - appearing - in - header / #post-13624091
*
* @ reporter @ widecast
* @ link https :// wordpress . org / support / topic / 2 - 0 - 5 - broken / #post-13626222
*
* @ reporter @ ymorin007
* @ link https :// wordpress . org / support / topic / footnotes - appearing - in - header / #post-13627050
*
* @ reporter @ markcheret on behalf of L . Smith
* @ link https :// wordpress . org / support / topic / footnotes - appear - in - random - places - on - academic - website /
*
* @ reporter @ tashi1es
* @ link https :// wordpress . org / support / topic / footnotes - appear - in - random - places - on - academic - website / #post-13630495
*
2021-03-24 21:19:07 +00:00
* @ since 2.0 . 7
* @ link https :// wordpress . org / support / topic / change - the - position - 5 / page / 2 / #post-13630114
* @ link https :// wordpress . org / support / topic / footnotes - appearing - in - header / #post-13630303
* @ link https :// wordpress . org / support / topic / footnotes - appearing - in - header / page / 2 / #post-13630799
* @ link https :// wordpress . org / support / topic / no - footnotes - anymore / #post-13813233
2021-03-02 03:09:34 +00:00
*
* - UPDATE : Hooks : remove 'the_post' , the plugin stops supporting this hook .
*
* @ since 2.1 . 0
* @ accountable @ pewgeuges
*/
2021-03-03 18:58:03 +00:00
// Reset stored footnotes when displaying the header.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $footnotes = array ();
self :: $allow_love_me = true ;
2021-03-02 03:09:34 +00:00
}
/**
* Outputs the custom css to the header of the public page .
*
* @ since 1.5 . 0
*
* @ since 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 .
*/
2021-03-28 12:41:33 +00:00
public function footnotes_output_head () {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Insert start tag without switching out of PHP.
2021-03-02 03:09:34 +00:00
echo " \r \n <style type= \" text/css \" media= \" all \" > \r \n " ;
2021-03-24 21:19:07 +00:00
2021-03-23 04:02:07 +00:00
/**
* Enables CSS smooth scrolling .
2021-03-24 21:19:07 +00:00
*
2021-03-23 04:02:07 +00:00
* - Update : Scrolling : CSS - based smooth scroll behavior ( optional ), thanks to @ paulgpetty and @ bogosavljev issue reports .
2021-03-24 21:19:07 +00:00
*
2021-03-23 04:02:07 +00:00
* @ reporter @ paulgpetty
* @ link https :// wordpress . org / support / topic / functionally - great / #post-13607795
2021-03-24 21:19:07 +00:00
*
2021-03-23 04:02:07 +00:00
* @ reporter @ bogosavljev
* @ link https :// wordpress . org / support / topic / compatibility - issue - with - wpforms / #post-14214720
2021-03-24 21:19:07 +00:00
*
2021-03-23 04:02:07 +00:00
* @ since 2.5 . 12
* Native smooth scrolling only works in recent browsers .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_CSS_SMOOTH_SCROLLING ) ) ) {
2021-03-23 04:02:07 +00:00
echo " html { scroll-behavior: smooth;} \r \n " ;
}
2021-03-02 03:09:34 +00:00
/**
* Normalizes the referrers’ vertical alignment and font size .
*
* - 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 .
*
* @ reporter @ tomturowski
* @ link https :// wordpress . org / support / topic / in - line - superscript - ref - rides - to - high /
*
2021-03-24 21:19:07 +00:00
* @ since 2.5 . 4
*
2021-03-02 03:09:34 +00:00
* Cannot be included in external stylesheet , as it is only optional .
* The scope is variable too : referrers only , or all superscript elements .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$normalize_superscript = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT );
if ( 'no' !== $normalize_superscript ) {
if ( 'all' === $normalize_superscript ) {
2021-03-03 18:58:03 +00:00
echo 'sup {' ;
2021-03-02 03:09:34 +00:00
} else {
2021-03-03 18:58:03 +00:00
echo '.footnote_plugin_tooltip_text {' ;
2021-03-02 03:09:34 +00:00
}
echo " vertical-align: super; font-size: smaller; position: static;} \r \n " ;
}
/**
2021-03-03 18:58:03 +00:00
* Reference container display on home page .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container : fix start pages by making its display optional , thanks to @ dragon013 bug report .
*
* @ reporter @ dragon013
* @ link https :// wordpress . org / support / topic / possible - to - hide - it - from - start - page /
2021-03-24 21:19:07 +00:00
*
* @ since 2.1 . 1
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( ! Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_START_PAGE_ENABLE ) ) ) {
2021-03-03 18:58:03 +00:00
2021-03-02 03:09:34 +00:00
echo " .home .footnotes_reference_container { display: none; } \r \n " ;
}
/**
2021-03-03 18:58:03 +00:00
* Reference container top and bottom margins .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container : convert top padding to margin and make it a setting , thanks to @ hamshe bug report .
*
* @ reporter @ hamshe
* @ link https :// wordpress . org / support / topic / reference - container - in - elementor / #post-13786635
2021-03-24 21:19:07 +00:00
*
* @ since 2.3 . 0
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$reference_container_top_margin = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_TOP_MARGIN ) );
$reference_container_bottom_margin = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_BOTTOM_MARGIN ) );
2021-03-03 18:58:03 +00:00
echo '.footnotes_reference_container {margin-top: ' ;
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo empty ( $reference_container_top_margin ) ? '0' : $reference_container_top_margin ;
2021-03-03 18:58:03 +00:00
echo 'px !important; margin-bottom: ' ;
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo empty ( $reference_container_bottom_margin ) ? '0' : $reference_container_bottom_margin ;
2021-03-02 03:09:34 +00:00
echo " px !important;} \r \n " ;
/**
2021-03-03 18:58:03 +00:00
* Reference container label bottom border .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container : Label : make bottom border an option , thanks to @ markhillyer issue report .
* - Bugfix : Reference container : Label : option to select paragraph or heading element , thanks to @ markhillyer issue report .
*
* @ reporter @ markhillyer
* @ link https :// wordpress . org / support / topic / how - do - i - eliminate - the - horizontal - line - beneath - the - reference - container - heading /
2021-03-24 21:19:07 +00:00
*
* @ since 2.2 . 5
2021-04-15 04:09:23 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER ) ) ) {
2021-03-03 18:58:03 +00:00
echo '.footnote_container_prepare > ' ;
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_LABEL_ELEMENT );
2021-03-02 03:09:34 +00:00
echo " { border-bottom: 1px solid #aaaaaa !important;} \r \n " ;
}
/**
2021-03-03 18:58:03 +00:00
* Reference container table row borders .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container : add option for table borders to restore pre - 2.0 . 0 design , thanks to @ noobishh issue report .
*
* @ reporter @ noobishh
* @ link https :// wordpress . org / support / topic / borders - 25 /
2021-03-03 18:58:03 +00:00
*
2021-03-24 21:19:07 +00:00
* @ since 2.2 . 10
* Moving this internal CSS to external using `wp_add_inline_style()` is
* discouraged , because that screws up support , and it is pointless from
* a performance point of view . Moreover , that would cause cache busting
* issues as browsers won’ t reload these style sheets after settings are
* changed while the version string is not .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_ROW_BORDERS_ENABLE ) ) ) {
2021-03-03 18:58:03 +00:00
echo '.footnotes_table, .footnotes_plugin_reference_row {' ;
echo 'border: 1px solid #060606;' ;
2021-03-02 03:09:34 +00:00
echo " !important;} \r \n " ;
2021-03-03 18:58:03 +00:00
// Adapt left padding to the presence of a border.
echo '.footnote_plugin_index, .footnote_plugin_index_combi {' ;
2021-03-02 03:09:34 +00:00
echo " padding-left: 6px !important} \r \n " ;
}
2021-03-03 18:58:03 +00:00
// Ref container first column width and max-width.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$column_width_enabled = Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_COLUMN_WIDTH_ENABLED ) );
$column_max_width_enabled = Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_COLUMN_MAX_WIDTH_ENABLED ) );
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( $column_width_enabled || $column_max_width_enabled ) {
2021-03-03 18:58:03 +00:00
echo '.footnote-reference-container { table-layout: fixed; }' ;
echo '.footnote_plugin_index, .footnote_plugin_index_combi {' ;
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( $column_width_enabled ) {
$column_width_scalar = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_COLUMN_WIDTH_SCALAR );
$column_width_unit = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_COLUMN_WIDTH_UNIT );
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( ! empty ( $column_width_scalar ) ) {
if ( '%' === $column_width_unit ) {
if ( $column_width_scalar > 100 ) {
$column_width_scalar = 100 ;
2021-03-02 03:09:34 +00:00
}
}
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$column_width_scalar = 0 ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo ' width: ' . $column_width_scalar . $column_width_unit . ' !important;' ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( $column_max_width_enabled ) {
$column_max_width_scalar = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_COLUMN_MAX_WIDTH_SCALAR );
$column_max_width_unit = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_COLUMN_MAX_WIDTH_UNIT );
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( ! empty ( $column_max_width_scalar ) ) {
if ( '%' === $column_max_width_unit ) {
if ( $column_max_width_scalar > 100 ) {
$column_max_width_scalar = 100 ;
2021-03-02 03:09:34 +00:00
}
}
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$column_max_width_scalar = 0 ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo ' max-width: ' . $column_max_width_scalar . $column_max_width_unit . ' !important;' ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
echo " } \r \n " ;
2021-03-02 03:09:34 +00:00
}
/**
2021-03-03 18:58:03 +00:00
* Hard links scroll offset .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Scroll offset : make configurable to fix site - dependent issues related to fixed headers .
*
* @ since 2.1 . 4
*
* @ since 2.5 . 6 hard links are always enabled when the alternative reference container is .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $hard_links_enabled = Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_HARD_LINKS_ENABLE ) );
2021-03-02 03:09:34 +00:00
2021-03-18 18:00:42 +00:00
// Correct hard links enabled status depending on AMP compatible or alternative reference container enabled status.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $amp_enabled || 'jquery' !== Footnotes :: $script_mode ) {
self :: $hard_links_enabled = true ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $scroll_offset = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SCROLL_OFFSET ) );
if ( self :: $hard_links_enabled ) {
2021-03-03 18:58:03 +00:00
echo '.footnote_referrer_anchor, .footnote_item_anchor {bottom: ' ;
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo self :: $scroll_offset ;
2021-03-02 03:09:34 +00:00
echo " vh;} \r \n " ;
}
2021-03-03 18:58:03 +00:00
/*
* Tooltips .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $tooltips_enabled ) {
2021-03-02 03:09:34 +00:00
echo '.footnote_tooltip {' ;
/**
2021-03-03 18:58:03 +00:00
* Tooltip appearance : Tooltip font size .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Styling : Tooltips : fix font size issue by adding font size to settings with legacy as default .
*
* @ since 2.1 . 4
*/
echo ' font-size: ' ;
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FONT_SIZE_ENABLED ) ) ) {
echo Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FONT_SIZE_SCALAR );
echo Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FONT_SIZE_UNIT );
2021-03-02 03:09:34 +00:00
} else {
echo 'inherit' ;
}
echo ' !important;' ;
2021-03-03 18:58:03 +00:00
/*
* Tooltip Text color .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$color = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_COLOR );
if ( ! empty ( $color ) ) {
printf ( ' color: %s !important;' , $color );
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
/*
* Tooltip Background color .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$background = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND );
if ( ! empty ( $background ) ) {
printf ( ' background-color: %s !important;' , $background );
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
/*
* Tooltip Border width .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$border_width = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH );
if ( ! empty ( $border_width ) && intval ( $border_width ) > 0 ) {
printf ( ' border-width: %dpx !important; border-style: solid !important;' , $border_width );
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
/*
* Tooltip Border color .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$border_color = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR );
if ( ! empty ( $border_color ) ) {
printf ( ' border-color: %s !important;' , $border_color );
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
/*
* Tooltip Corner radius .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$border_radius = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS );
if ( ! empty ( $border_radius ) && intval ( $border_radius ) > 0 ) {
printf ( ' border-radius: %dpx !important;' , $border_radius );
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
/*
* Tooltip Shadow color .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$box_shadow_color = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR );
if ( ! empty ( $box_shadow_color ) ) {
printf ( ' -webkit-box-shadow: 2px 2px 11px %s;' , $box_shadow_color );
printf ( ' -moz-box-shadow: 2px 2px 11px %s;' , $box_shadow_color );
printf ( ' box-shadow: 2px 2px 11px %s;' , $box_shadow_color );
2021-03-02 03:09:34 +00:00
}
/**
2021-03-17 15:51:49 +00:00
* Tooltip position , dimensions and timing .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Tooltips : make display delays and fade durations configurable to conform to website style .
*
* @ since 2.1 . 4
*
* - Update : Tooltips : Alternative tooltips : connect to position / timing settings ( for themes not supporting jQuery tooltips ) .
*
* @ since 2.2 . 5
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( ! Footnotes :: $alternative_tooltips_enabled && ! Footnotes :: $amp_enabled ) {
2021-03-17 15:51:49 +00:00
/**
* Dimensions of jQuery tooltips .
*
* Position and timing of jQuery tooltips are script defined .
2021-04-10 19:02:10 +00:00
*
2021-03-17 15:51:49 +00:00
* @ see templates / public / tooltip . html .
2021-03-03 18:58:03 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$max_width = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH );
if ( ! empty ( $max_width ) && intval ( $max_width ) > 0 ) {
printf ( ' max-width: %dpx !important;' , $max_width );
2021-03-02 03:09:34 +00:00
}
echo " } \r \n " ;
2021-03-17 15:51:49 +00:00
2021-03-02 03:09:34 +00:00
} else {
2021-03-03 18:58:03 +00:00
/*
2021-03-16 22:57:27 +00:00
* AMP compatible and alternative tooltips .
2021-03-03 18:58:03 +00:00
*/
2021-03-02 03:09:34 +00:00
echo " } \r \n " ;
2021-03-17 15:51:49 +00:00
/**
* Dimensions .
*
* @ see 'Determine shrink width if alternative tooltips are enabled' .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$alternative_tooltip_width = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH ) );
2021-03-03 18:58:03 +00:00
echo '.footnote_tooltip.position {' ;
2021-03-18 18:00:42 +00:00
echo ' width: max-content; ' ;
2021-03-17 15:51:49 +00:00
2021-03-03 18:58:03 +00:00
// Set also as max-width wrt short tooltip shrinking.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo ' max-width: ' . $alternative_tooltip_width . 'px;' ;
2021-03-02 03:09:34 +00:00
2021-03-17 15:51:49 +00:00
/**
* Position .
*
* @ see dev - amp - tooltips . css .
* @ see dev - tooltips - alternative . css .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$alternative_position = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION );
$offset_x = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X ) );
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( 'top left' === $alternative_position || 'bottom left' === $alternative_position ) {
echo ' right: ' . ( ! empty ( $offset_x ) ? $offset_x : 0 ) . 'px;' ;
2021-03-02 03:09:34 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo ' left: ' . ( ! empty ( $offset_x ) ? $offset_x : 0 ) . 'px;' ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$offset_y = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y ) );
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( 'top left' === $alternative_position || 'top right' === $alternative_position ) {
echo ' bottom: ' . ( ! empty ( $offset_y ) ? $offset_y : 0 ) . 'px;' ;
2021-03-02 03:09:34 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo ' top: ' . ( ! empty ( $offset_y ) ? $offset_y : 0 ) . 'px;' ;
2021-03-02 03:09:34 +00:00
}
echo " } \r \n " ;
2021-03-17 15:51:49 +00:00
/*
* Timing .
2021-03-03 18:58:03 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$fade_in_delay = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FADE_IN_DELAY ) );
$fade_in_delay = ! empty ( $fade_in_delay ) ? $fade_in_delay : '0' ;
$fade_in_duration = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FADE_IN_DURATION ) );
$fade_in_duration = ! empty ( $fade_in_duration ) ? $fade_in_duration : '0' ;
$fade_out_delay = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FADE_OUT_DELAY ) );
$fade_out_delay = ! empty ( $fade_out_delay ) ? $fade_out_delay : '0' ;
$fade_out_duration = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FADE_OUT_DURATION ) );
$fade_out_duration = ! empty ( $fade_out_duration ) ? $fade_out_duration : '0' ;
2021-03-02 03:09:34 +00:00
2021-03-17 15:51:49 +00:00
/**
* AMP compatible tooltips .
*
* To streamline internal CSS , immutable rules are in external stylesheet .
2021-04-10 19:02:10 +00:00
*
2021-03-17 15:51:49 +00:00
* @ see dev - amp - tooltips . css .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $amp_enabled ) {
2021-03-17 15:51:49 +00:00
echo 'span.footnote_referrer > span.footnote_tooltip {' ;
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo 'transition-delay: ' . $fade_out_delay . 'ms;' ;
echo 'transition-duration: ' . $fade_out_duration . 'ms;' ;
2021-03-17 15:51:49 +00:00
echo " } \r \n " ;
2021-03-16 22:57:27 +00:00
echo 'span.footnote_referrer:focus-within > span.footnote_tooltip, span.footnote_referrer:hover > span.footnote_tooltip {' ;
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo 'transition-delay: ' . $fade_in_delay . 'ms;' ;
echo 'transition-duration: ' . $fade_in_duration . 'ms;' ;
2021-03-17 15:51:49 +00:00
echo " } \r \n " ;
2021-04-10 19:02:10 +00:00
/**
* Alternative tooltips .
*
* To streamline internal CSS , immutable rules are in external stylesheet .
2021-04-15 04:09:23 +00:00
*
2021-04-10 19:02:10 +00:00
* @ see dev - tooltips - alternative . css .
*/
2021-03-16 22:57:27 +00:00
} else {
2021-03-17 15:51:49 +00:00
echo '.footnote_tooltip.hidden {' ;
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo 'transition-delay: ' . $fade_out_delay . 'ms;' ;
echo 'transition-duration: ' . $fade_out_duration . 'ms;' ;
2021-03-17 15:51:49 +00:00
echo " } \r \n " ;
2021-03-17 02:22:27 +00:00
echo '.footnote_tooltip.shown {' ;
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo 'transition-delay: ' . $fade_in_delay . 'ms;' ;
echo 'transition-duration: ' . $fade_in_duration . 'ms;' ;
2021-03-17 15:51:49 +00:00
echo " } \r \n " ;
2021-03-16 22:57:27 +00:00
}
2021-03-02 03:09:34 +00:00
}
}
/**
2021-03-03 18:58:03 +00:00
* Custom CSS .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Custom CSS : insert new CSS in the public page header element after existing CSS .
*
* @ since 2.2 . 3
*
* Set custom CSS to override settings , not conversely .
* Legacy Custom CSS is used until it’ s set to disappear after dashboard tab migration .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: CUSTOM_CSS_LEGACY_ENABLE ) ) ) {
echo Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: CUSTOM_CSS );
2021-03-03 18:58:03 +00:00
echo " \r \n " ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: CUSTOM_CSS_NEW );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Insert end tag without switching out of PHP.
2021-03-02 03:09:34 +00:00
echo " \r \n </style> \r \n " ;
/**
* Alternative tooltip implementation relying on plain JS and CSS transitions .
*
* - Bugfix : Tooltips : optional alternative JS implementation with CSS transitions to fix configuration - related outage , thanks to @ andreasra feedback .
*
* @ reporter @ andreasra
* @ link https :// wordpress . org / support / topic / footnotes - appearing - in - header / page / 2 / #post-13632566
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 1
2021-03-03 18:58:03 +00:00
* The script for alternative tooltips is printed formatted , not minified ,
* for transparency . It isn’ t indented though ( the PHP open tag neither ) .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $alternative_tooltips_enabled ) {
2021-03-03 18:58:03 +00:00
// Start internal script.
2021-03-02 03:09:34 +00:00
?>
< script content = " text/javascript " >
2021-03-03 18:58:03 +00:00
function footnote_tooltip_show ( footnote_tooltip_id ) {
document . getElementById ( footnote_tooltip_id ) . classList . remove ( 'hidden' );
document . getElementById ( footnote_tooltip_id ) . classList . add ( 'shown' );
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
function footnote_tooltip_hide ( footnote_tooltip_id ) {
document . getElementById ( footnote_tooltip_id ) . classList . remove ( 'shown' );
document . getElementById ( footnote_tooltip_id ) . classList . add ( 'hidden' );
2021-03-02 03:09:34 +00:00
}
</ script >
2021-02-26 14:40:23 +00:00
< ? php
2021-04-10 19:02:10 +00:00
// Indenting this PHP open tag would mess up the page source.
2021-03-24 21:19:07 +00:00
// End internal script.
2021-03-02 03:09:34 +00:00
};
}
/**
* Displays the 'LOVE FOOTNOTES' slug if enabled .
*
* @ since 1.5 . 0
2021-03-24 21:19:07 +00:00
* @ since 2.2 . 0 More options .
2021-03-02 03:09:34 +00:00
*/
2021-03-28 12:41:33 +00:00
public function footnotes_output_footer () {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( 'footer' === Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_POSITION ) ) {
2021-03-03 18:58:03 +00:00
echo $this -> reference_container ();
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Get setting for love and share this plugin.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$love_me_index = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_LOVE );
2021-03-03 18:58:03 +00:00
// Check if the admin allows to add a link to the footer.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( empty ( $love_me_index ) || 'no' === strtolower ( $love_me_index ) || ! self :: $allow_love_me ) {
2021-03-02 03:09:34 +00:00
return ;
}
2021-03-03 18:58:03 +00:00
// Set a hyperlink to the word "footnotes" in the Love slug.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$linked_name = sprintf ( '<a href="https://wordpress.org/plugins/footnotes/" target="_blank" style="text-decoration:none;">%s</a>' , Footnotes_Config :: PLUGIN_PUBLIC_NAME );
2021-03-03 18:58:03 +00:00
// Get random love me text.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( 'random' === strtolower ( $love_me_index ) ) {
$love_me_index = 'text-' . wp_rand ( 1 , 7 );
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
switch ( $love_me_index ) {
2021-03-03 18:58:03 +00:00
// Options named wrt backcompat, simplest is default.
case 'text-1' :
/* Translators: 2: Link to plugin page 1: Love heart symbol */
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$love_me_text = sprintf ( __ ( 'I %2$s %1$s' , 'footnotes' ), $linked_name , Footnotes_Config :: LOVE_SYMBOL );
2021-03-03 18:58:03 +00:00
break ;
case 'text-2' :
/* Translators: %s: Link to plugin page */
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$love_me_text = sprintf ( __ ( 'This website uses the awesome %s plugin.' , 'footnotes' ), $linked_name );
2021-03-03 18:58:03 +00:00
break ;
case 'text-4' :
/* Translators: 1: Link to plugin page 2: Love heart symbol */
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$love_me_text = sprintf ( '%1$s %2$s' , $linked_name , Footnotes_Config :: LOVE_SYMBOL );
2021-03-03 18:58:03 +00:00
break ;
case 'text-5' :
/* Translators: 1: Love heart symbol 2: Link to plugin page */
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$love_me_text = sprintf ( '%1$s %2$s' , Footnotes_Config :: LOVE_SYMBOL , $linked_name );
2021-03-03 18:58:03 +00:00
break ;
case 'text-6' :
/* Translators: %s: Link to plugin page */
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$love_me_text = sprintf ( __ ( 'This website uses %s.' , 'footnotes' ), $linked_name );
2021-03-03 18:58:03 +00:00
break ;
case 'text-7' :
/* Translators: %s: Link to plugin page */
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$love_me_text = sprintf ( __ ( 'This website uses the %s plugin.' , 'footnotes' ), $linked_name );
2021-03-03 18:58:03 +00:00
break ;
case 'text-3' :
default :
/* Translators: %s: Link to plugin page */
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$love_me_text = sprintf ( '%s' , $linked_name );
2021-03-03 18:58:03 +00:00
break ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
echo sprintf ( '<div style="text-align:center; color:#acacac;">%s</div>' , $love_me_text );
2021-03-02 03:09:34 +00:00
}
/**
* Replaces footnotes in the post / page title .
*
* @ since 1.5 . 0
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ param string $content Title .
* @ return string $content Title with replaced footnotes .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public function footnotes_in_title ( $content ) {
2021-03-03 18:58:03 +00:00
// Appends the reference container if set to "post_end".
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $this -> exec ( $content , false );
2021-03-02 03:09:34 +00:00
}
/**
* Replaces footnotes in the content of the current page / post .
*
* @ since 1.5 . 0
2021-04-14 23:10:29 +00:00
*
* - Adding : Reference container : optionally per section by shortcode , thanks to @ grflukas issue report .
*
* @ reporter @ grflukas
* @ link https :// wordpress . org / support / topic / multiple - reference - containers - in - single - post /
*
* @ since 2.7 . 0
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ param string $content Page / Post content .
* @ return string $content Content with replaced footnotes .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public function footnotes_in_content ( $content ) {
2021-03-19 23:58:23 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$ref_container_position = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_POSITION );
$footnote_section_shortcode = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTE_SECTION_SHORTCODE );
$footnote_section_shortcode_length = strlen ( $footnote_section_shortcode );
2021-04-14 23:10:29 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( strpos ( $content , $footnote_section_shortcode ) === false ) {
2021-04-14 23:10:29 +00:00
// phpcs:disable WordPress.PHP.YodaConditions.NotYoda
// Appends the reference container if set to "post_end".
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $this -> exec ( $content , 'post_end' === $ref_container_position );
2021-04-14 23:10:29 +00:00
// phpcs:enable WordPress.PHP.YodaConditions.NotYoda
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$rest_content = $content ;
$sections_raw = array ();
$sections_processed = array ();
2021-04-14 23:10:29 +00:00
do {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$section_end = strpos ( $rest_content , $footnote_section_shortcode );
$sections_raw [] = substr ( $rest_content , 0 , $section_end );
$rest_content = substr ( $rest_content , $section_end + $footnote_section_shortcode_length );
} while ( strpos ( $rest_content , $footnote_section_shortcode ) !== false );
$sections_raw [] = $rest_content ;
foreach ( $sections_raw as $section ) {
$sections_processed [] = self :: exec ( $section , true );
2021-04-14 23:10:29 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = implode ( $sections_processed );
return $content ;
2021-04-14 23:10:29 +00:00
}
2021-03-02 03:09:34 +00:00
}
/**
2021-04-14 23:10:29 +00:00
* Processes existing excerpt or replaces it with a new one generated on the basis of the post .
2021-03-02 03:09:34 +00:00
*
* @ since 1.5 . 0
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ param string $excerpt Excerpt content .
* @ return string $excerpt Processed or new excerpt .
2021-03-31 00:49:17 +00:00
* @ since 2.6 . 2 Debug No option .
* @ since 2.6 . 3 Debug Yes option , the setting becomes fully effective .
2021-04-14 23:10:29 +00:00
*
* - Bugfix : Excerpts : make excerpt handling backward compatible , thanks to @ mfessler bug report .
*
* @ reporter @ mfessler
* @ link https :// github . com / markcheret / footnotes / issues / 65
*
* @ 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 .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public function footnotes_in_excerpt ( $excerpt ) {
$excerpt_mode = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_IN_EXCERPT );
2021-04-14 23:10:29 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( 'yes' === $excerpt_mode ) {
return $this -> generate_excerpt_with_footnotes ( $excerpt );
2021-04-14 23:10:29 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
} elseif ( 'no' === $excerpt_mode ) {
return $this -> generate_excerpt ( $excerpt );
2021-04-14 23:10:29 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $this -> exec ( $excerpt );
2021-03-28 12:41:33 +00:00
}
}
/**
2021-03-31 00:49:17 +00:00
* Generates excerpt on the basis of the post .
2021-03-28 12:41:33 +00:00
*
2021-03-31 00:49:17 +00:00
* - Bugfix : Excerpts : debug the 'No' option by generating excerpts on the basis of the post without footnotes , thanks to @ nikelaos @ markcheret @ martinneumannat bug reports .
2021-03-30 07:50:44 +00:00
*
* @ reporter @ nikelaos
* @ link https :// wordpress . org / support / topic / jquery - comes - up - in - feed - content /
* @ link https :// wordpress . org / support / topic / doesnt - work - with - mailpoet /
*
* @ reporter @ markcheret
* @ link https :// wordpress . org / support / topic / footnotes - now - appear - in - summaries - even - though - this - is - marked - no /
*
* @ reporter @ martinneumannat
* @ link https :// wordpress . org / support / topic / problem - with - footnotes - in - excerpts - of - the - blog - page /
*
2021-03-28 12:41:33 +00:00
* @ since 2.6 . 2
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ param string $content The post .
* @ return string $content An excerpt of the post .
2021-03-30 07:50:44 +00:00
* Applies full WordPress excerpt processing .
2021-03-28 12:41:33 +00:00
* @ link https :// developer . wordpress . org / reference / functions / wp_trim_excerpt /
2021-03-30 07:50:44 +00:00
* @ link https :// developer . wordpress . org / reference / functions / wp_trim_words /
2021-03-28 12:41:33 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public function generate_excerpt ( $content ) {
2021-03-28 12:41:33 +00:00
2021-03-31 00:49:17 +00:00
// Discard existing excerpt and start on the basis of the post.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = get_the_content ( get_the_id () );
2021-03-28 12:41:33 +00:00
2021-04-01 06:48:43 +00:00
// Get footnote delimiter shortcodes and unify them.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = self :: unify_delimiters ( $content );
2021-03-28 12:41:33 +00:00
// Remove footnotes.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = preg_replace ( '#' . self :: $start_tag_regex . '.+?' . self :: $end_tag_regex . '#' , '' , $content );
2021-03-28 12:41:33 +00:00
// Apply WordPress excerpt processing.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = strip_shortcodes ( $content );
$content = excerpt_remove_blocks ( $content );
2021-03-30 07:50:44 +00:00
// Here the footnotes would be processed as part of WordPress content processing.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = apply_filters ( 'the_content' , $content );
2021-03-30 07:50:44 +00:00
// According to Advanced Excerpt, this is some kind of precaution against malformed CDATA in RSS feeds.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = str_replace ( ']]>' , ']]>' , $content );
2021-03-30 07:50:44 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$excerpt_length = ( int ) _x ( '55' , 'excerpt_length' );
$excerpt_length = ( int ) apply_filters ( 'excerpt_length' , $excerpt_length );
$excerpt_more = apply_filters ( 'excerpt_more' , ' […]' );
2021-03-30 07:50:44 +00:00
// Function wp_trim_words() calls wp_strip_all_tags() that wrecks the footnotes.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = wp_trim_words ( $content , $excerpt_length , $excerpt_more );
2021-03-30 07:50:44 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $content ;
2021-03-30 07:50:44 +00:00
}
/**
2021-03-31 00:49:17 +00:00
* Generates excerpt with footnotes on the basis of the post .
2021-03-30 07:50:44 +00:00
*
2021-03-31 00:49:17 +00:00
* - Bugfix : Excerpts : debug the 'Yes' option by generating excerpts with footnotes on the basis of the posts , thanks to @ nikelaos @ martinneumannat bug reports .
2021-03-30 07:50:44 +00:00
*
* @ reporter @ nikelaos
* @ link https :// wordpress . org / support / topic / jquery - comes - up - in - feed - content /
* @ link https :// wordpress . org / support / topic / doesnt - work - with - mailpoet /
*
* @ reporter @ martinneumannat
* @ link https :// wordpress . org / support / topic / problem - with - footnotes - in - excerpts - of - the - blog - page /
*
* @ since 2.6 . 3
2021-04-13 08:18:07 +00:00
*
2021-04-01 06:48:43 +00:00
* - Bugfix : Process : remove trailing comma after last argument in multiline function calls for PHP < 7.3 , thanks to @ scroom @ copylefter @ lagoon24 bug reports .
2021-04-13 08:18:07 +00:00
*
2021-04-01 06:48:43 +00:00
* @ reporter @ scroom
* @ link https :// wordpress . org / support / topic / update - crashed - my - website - 3 /
2021-04-13 08:18:07 +00:00
*
2021-04-01 06:48:43 +00:00
* @ reporter @ copylefter
* @ link https :// wordpress . org / support / topic / update - crashed - my - website - 3 / #post-14259151
2021-04-13 08:18:07 +00:00
*
2021-04-01 06:48:43 +00:00
* @ reporter @ lagoon24
* @ link https :// wordpress . org / support / topic / update - crashed - my - website - 3 / #post-14259396
2021-04-13 08:18:07 +00:00
*
2021-04-01 06:48:43 +00:00
* @ since 2.6 . 4
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ param string $content The post .
* @ return string $content An excerpt of the post .
2021-03-30 07:50:44 +00:00
* Does not apply full WordPress excerpt processing .
* @ see self :: generate_excerpt ()
* Uses information and some code from Advanced Excerpt .
* @ link https :// wordpress . org / plugins / advanced - excerpt /
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public function generate_excerpt_with_footnotes ( $content ) {
2021-03-30 07:50:44 +00:00
2021-03-31 00:49:17 +00:00
// Discard existing excerpt and start on the basis of the post.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = get_the_content ( get_the_id () );
2021-03-30 07:50:44 +00:00
2021-04-01 06:48:43 +00:00
// Get footnote delimiter shortcodes and unify them.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = self :: unify_delimiters ( $content );
2021-03-30 07:50:44 +00:00
// Apply WordPress excerpt processing.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = strip_shortcodes ( $content );
$content = excerpt_remove_blocks ( $content );
2021-03-30 07:50:44 +00:00
// But do not process footnotes at this point; do only this.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = str_replace ( ']]>' , ']]>' , $content );
2021-03-30 07:50:44 +00:00
// Prepare the excerpt length argument.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$excerpt_length = ( int ) _x ( '55' , 'excerpt_length' );
$excerpt_length = ( int ) apply_filters ( 'excerpt_length' , $excerpt_length );
2021-03-30 07:50:44 +00:00
// Prepare the Read-on string.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$excerpt_more = apply_filters ( 'excerpt_more' , ' […]' );
2021-03-30 07:50:44 +00:00
// Safeguard the footnotes.
2021-03-31 00:49:17 +00:00
preg_match_all (
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
'#' . self :: $start_tag_regex . '.+?' . self :: $end_tag_regex . '#' ,
$content ,
$saved_footnotes
2021-03-31 00:49:17 +00:00
);
// Prevent the footnotes from altering the excerpt: previously hard-coded '5ED84D6'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$placeholder = '@' . mt_rand ( 100000000 , 2147483647 ) . '@' ;
$content = preg_replace (
'#' . self :: $start_tag_regex . '.+?' . self :: $end_tag_regex . '#' ,
$placeholder ,
$content
2021-03-31 00:49:17 +00:00
);
2021-03-30 07:50:44 +00:00
// Replace line breaking markup with a separator.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$separator = ' ' ;
$content = preg_replace ( '#<br *>#' , $separator , $content );
$content = preg_replace ( '#<br */>#' , $separator , $content );
$content = preg_replace ( '#<(p|li|div)[^>]*>#' , $separator , $content );
$content = preg_replace ( '#' . $separator . '#' , '' , $content , 1 );
$content = preg_replace ( '#</(p|li|div) *>#' , '' , $content );
$content = preg_replace ( '#[\r\n]#' , '' , $content );
2021-03-30 07:50:44 +00:00
// To count words like Advanced Excerpt does it.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$tokens = array ();
$output = '' ;
$counter = 0 ;
2021-03-30 07:50:44 +00:00
// Tokenize into tags and words as in Advanced Excerpt.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
preg_match_all ( '#(<[^>]+>|[^<>\s]+)\s*#u' , $content , $tokens );
2021-03-30 07:50:44 +00:00
// Count words following one option of Advanced Excerpt.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
foreach ( $tokens [ 0 ] as $token ) {
2021-03-30 07:50:44 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( $counter >= $excerpt_length ) {
2021-03-30 07:50:44 +00:00
break ;
}
// If token is not a tag, increment word count.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( '<' !== $token [ 0 ] ) {
$counter ++ ;
2021-03-30 07:50:44 +00:00
}
// Append the token to the output.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$output .= $token ;
2021-03-30 07:50:44 +00:00
}
// Complete unbalanced markup, used by Advanced Excerpt.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = force_balance_tags ( $output );
2021-03-30 07:50:44 +00:00
// Readd footnotes in excerpt.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$index = 0 ;
while ( 0 !== preg_match ( '#' . $placeholder . '#' , $content ) ) {
$content = preg_replace (
'#' . $placeholder . '#' ,
$saved_footnotes [ 0 ][ $index ],
$content ,
2021-03-31 13:29:10 +00:00
1
2021-03-31 00:49:17 +00:00
);
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$index ++ ;
2021-03-30 07:50:44 +00:00
}
// Append the Read-on string as in wp_trim_words().
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content .= $excerpt_more ;
2021-03-30 07:50:44 +00:00
// Process readded footnotes without appending the reference container.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = self :: exec ( $content , false );
2021-03-30 07:50:44 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $content ;
2021-03-30 07:50:44 +00:00
2021-03-02 03:09:34 +00:00
}
/**
* Replaces footnotes in the widget title .
*
* @ since 1.5 . 0
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ param string $content Widget content .
* @ return string $content Content with replaced footnotes .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public function footnotes_in_widget_title ( $content ) {
2021-03-03 18:58:03 +00:00
// Appends the reference container if set to "post_end".
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $this -> exec ( $content , false );
2021-03-02 03:09:34 +00:00
}
/**
* Replaces footnotes in the content of the current widget .
*
* @ since 1.5 . 0
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ param string $content Widget content .
* @ return string $content Content with replaced footnotes .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public function footnotes_in_widget_text ( $content ) {
2021-03-03 18:58:03 +00:00
// phpcs:disable WordPress.PHP.YodaConditions.NotYoda
// Appends the reference container if set to "post_end".
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $this -> exec ( $content , 'post_end' === Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_POSITION ) ? true : false );
2021-03-03 18:58:03 +00:00
// phpcs:enable WordPress.PHP.YodaConditions.NotYoda
2021-03-02 03:09:34 +00:00
}
/**
* Replaces all footnotes that occur in the given content .
*
* @ since 1.5 . 0
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ param string $content Any string that may contain footnotes to be replaced .
* @ param bool $output_references Appends the Reference Container to the output if set to true , default true .
* @ param bool $hide_footnotes_text Hide footnotes found in the string .
2021-03-02 03:09:34 +00:00
* @ return string
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public function exec ( $content , $output_references = false , $hide_footnotes_text = false ) {
2021-03-02 03:09:34 +00:00
2021-03-25 03:07:17 +00:00
// Process content.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = $this -> search ( $content , $hide_footnotes_text );
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Reference container customized positioning through shortcode .
2021-03-02 03:09:34 +00:00
*
* - Adding : Reference container : support for custom position shortcode , thanks to @ hamshe issue report .
*
* @ reporter @ hamshe
* @ link https :// wordpress . org / support / topic / reference - container - in - elementor /
*
2021-03-24 21:19:07 +00:00
* @ since 2.2 . 0
2021-03-02 03:09:34 +00:00
*
2021-03-24 21:19:07 +00:00
* - Bugfix : Reference container : delete position shortcode if unused because position may be widget or footer , thanks to @ hamshe bug report .
2021-03-02 03:09:34 +00:00
*
* @ reporter @ hamshe
* @ link https :// wordpress . org / support / topic / reference - container - in - elementor / #post-13784126
2021-03-24 21:19:07 +00:00
*
* @ since 2.2 . 5
2021-03-02 03:09:34 +00:00
*/
2021-03-03 18:58:03 +00:00
// Append the reference container or insert at shortcode.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$reference_container_position_shortcode = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_POSITION_SHORTCODE );
if ( empty ( $reference_container_position_shortcode ) ) {
$reference_container_position_shortcode = '[[references]]' ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( $output_references ) {
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( strpos ( $content , $reference_container_position_shortcode ) ) {
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = str_replace ( $reference_container_position_shortcode , $this -> reference_container (), $content );
2021-03-02 03:09:34 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content .= $this -> reference_container ();
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Increment the container ID.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $reference_container_id ++ ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Delete position shortcode should any remain.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = str_replace ( $reference_container_position_shortcode , '' , $content );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Take a look if the LOVE ME slug should NOT be displayed on this page/post, remove the short code if found.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( strpos ( $content , Footnotes_Config :: NO_LOVE_SLUG ) ) {
self :: $allow_love_me = false ;
$content = str_replace ( Footnotes_Config :: NO_LOVE_SLUG , '' , $content );
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Return the content with replaced footnotes and optional reference container appended.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $content ;
2021-03-02 03:09:34 +00:00
}
/**
2021-03-30 07:50:44 +00:00
* Brings the delimiters and unifies their various HTML escapement schemas .
2021-03-24 21:19:07 +00:00
*
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ param string $content TODO .
2021-02-23 16:00:59 +00:00
*
2021-03-30 07:50:44 +00:00
* - Bugfix : Footnote delimiter short codes : fix numbering bug by cross - editor HTML escapement schema unification , thanks to @ patrick_here @ alifarahani8000 @ gova bug reports .
2021-03-24 21:19:07 +00:00
*
2021-03-25 03:07:17 +00:00
* @ reporter @ patrick_here
* @ link https :// wordpress . org / support / topic / how - to - add - footnotes - shortcode - in - elementor /
*
* @ reporter @ alifarahani8000
* @ link https :// wordpress . org / support / topic / after - version - 2 - 5 - 10 - the - ref - or - tags - are - not - longer - working /
2021-03-28 12:41:33 +00:00
*
* @ reporter @ gova
* @ link https :// wordpress . org / support / topic / footnotes - content - number - not - sequential /
*
* @ since 2.1 . 14
* 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 .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public function unify_delimiters ( $content ) {
2021-03-02 03:09:34 +00:00
2021-03-25 03:07:17 +00:00
// Get footnotes start and end tag short codes.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$starting_tag = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SHORT_CODE_START );
$ending_tag = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SHORT_CODE_END );
if ( 'userdefined' === $starting_tag || 'userdefined' === $ending_tag ) {
$starting_tag = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
$ending_tag = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
2021-03-02 03:09:34 +00:00
}
2021-03-24 21:19:07 +00:00
2021-03-25 03:07:17 +00:00
// If any footnotes short code is empty, return the content without changes.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( empty ( $starting_tag ) || empty ( $ending_tag ) ) {
return $content ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( preg_match ( '#[&"\'<>]#' , $starting_tag . $ending_tag ) ) {
2021-03-28 12:41:33 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$harmonized_start_tag = '{[(|fnote_stt|)]}' ;
$harmonized_end_tag = '{[(|fnote_end|)]}' ;
2021-03-25 03:07:17 +00:00
// Harmonize footnotes without escaping any HTML special characters in delimiter shortcodes.
// The footnote has been added in the Block Editor code editor (doesn’ t work in Classic Editor text mode).
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = str_replace ( $starting_tag , $harmonized_start_tag , $content );
$content = str_replace ( $ending_tag , $harmonized_end_tag , $content );
2021-03-25 03:07:17 +00:00
// Harmonize footnotes while escaping HTML special characters in delimiter shortcodes.
// The footnote has been added in the Classic Editor visual mode.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = str_replace ( htmlspecialchars ( $starting_tag ), $harmonized_start_tag , $content );
$content = str_replace ( htmlspecialchars ( $ending_tag ), $harmonized_end_tag , $content );
2021-03-25 03:07:17 +00:00
// Harmonize footnotes while escaping HTML special characters except greater-than sign in delimiter shortcodes.
// The footnote has been added in the Block Editor visual mode.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = str_replace ( str_replace ( '>' , '>' , htmlspecialchars ( $starting_tag ) ), $harmonized_start_tag , $content );
$content = str_replace ( str_replace ( '>' , '>' , htmlspecialchars ( $ending_tag ) ), $harmonized_end_tag , $content );
2021-03-25 03:07:17 +00:00
2021-03-28 12:41:33 +00:00
// Assign the delimiter shortcodes.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $start_tag = $harmonized_start_tag ;
self :: $end_tag = $harmonized_end_tag ;
2021-03-28 12:41:33 +00:00
2021-03-25 10:47:35 +00:00
// Assign the regex-conformant shortcodes.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $start_tag_regex = '\{\[\(\|fnote_stt\|\)\]\}' ;
self :: $end_tag_regex = '\{\[\(\|fnote_end\|\)\]\}' ;
2021-03-25 03:07:17 +00:00
2021-03-25 10:47:35 +00:00
} else {
2021-03-28 12:41:33 +00:00
// Assign the delimiter shortcodes.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $start_tag = $starting_tag ;
self :: $end_tag = $ending_tag ;
2021-03-28 12:41:33 +00:00
2021-03-25 10:47:35 +00:00
// Make shortcodes conform to regex syntax.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $start_tag_regex = preg_replace ( '#([\(\)\{\}\[\]\|\*\.\?\!])#' , '\\\\$1' , self :: $start_tag );
self :: $end_tag_regex = preg_replace ( '#([\(\)\{\}\[\]\|\*\.\?\!])#' , '\\\\$1' , self :: $end_tag );
2021-03-25 03:07:17 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $content ;
2021-03-28 12:41:33 +00:00
}
/**
* Replaces all footnotes in the given content and appends them to the static property .
*
* @ since 1.5 . 0
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
* @ param string $content Any content to be searched for footnotes .
* @ param bool $hide_footnotes_text Hide footnotes found in the string .
2021-03-28 12:41:33 +00:00
* @ return string
*
* @ 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 .
*
* @ reporter @ patrick_here
* @ link https :// wordpress . org / support / topic / how - to - add - footnotes - shortcode - in - elementor /
*
* @ reporter @ alifarahani8000
* @ link https :// wordpress . org / support / topic / after - version - 2 - 5 - 10 - the - ref - or - tags - are - not - longer - working /
*
* @ since 2.5 . 13
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
public function search ( $content , $hide_footnotes_text ) {
2021-03-28 12:41:33 +00:00
2021-04-01 06:48:43 +00:00
// Get footnote delimiter shortcodes and unify them.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = self :: unify_delimiters ( $content );
2021-03-28 12:41:33 +00:00
2021-03-25 03:07:17 +00:00
/**
* Checks for balanced footnote delimiters ; delimiter syntax validation .
2021-03-02 03:09:34 +00:00
*
* - Adding : Footnote delimiters : syntax validation for balanced footnote start and end tag short codes .
*
* @ since 2.4 . 0
*
* - Bugfix : Footnote delimiters : Syntax validation : exclude certain cases involving scripts , thanks to @ andreasra bug report .
* - Bugfix : Footnote delimiters : Syntax validation : complete message with hint about setting , thanks to @ andreasra bug report .
* - Bugfix : Footnote delimiters : Syntax validation : limit length of quoted string to 300 characters , thanks to @ andreasra bug report .
*
* @ reporter @ andreasra
* @ link https :// wordpress . org / support / topic / warning - unbalanced - footnote - start - tag - short - code - before /
*
2021-03-24 21:19:07 +00:00
* @ since 2.5 . 0
2021-03-02 03:09:34 +00:00
* If footnotes short codes are unbalanced , and syntax validation is not disabled ,
* prepend a warning to the content ; displays de facto beneath the post title .
*/
2021-03-25 03:07:17 +00:00
// If enabled.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE ) ) ) {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Apply different regex depending on whether start shortcode is double/triple opening parenthesis.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( '((' === self :: $start_tag || '(((' === self :: $start_tag ) {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// This prevents from catching a script containing e.g. a double opening parenthesis.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$validation_regex = '#' . self :: $start_tag_regex . '(((?!' . self :: $end_tag_regex . ')[^\{\}])*?)(' . self :: $start_tag_regex . '|$)#s' ;
2021-03-02 03:09:34 +00:00
} else {
2021-03-03 18:58:03 +00:00
// Catch all only if the start shortcode is not double/triple opening parenthesis, i.e. is unlikely to occur in scripts.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$validation_regex = '#' . self :: $start_tag_regex . '(((?!' . self :: $end_tag_regex . ').)*?)(' . self :: $start_tag_regex . '|$)#s' ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Check syntax and get error locations.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
preg_match ( $validation_regex , $content , $error_location );
if ( empty ( $error_location ) ) {
self :: $syntax_error_flag = false ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Prevent generating and inserting the warning multiple times.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( self :: $syntax_error_flag ) {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Get plain text string for error location.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$error_spot_string = wp_strip_all_tags ( $error_location [ 1 ] );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Limit string length to 300 characters.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( strlen ( $error_spot_string ) > 300 ) {
$error_spot_string = substr ( $error_spot_string , 0 , 299 ) . '…' ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Compose warning box.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$syntax_error_warning = '<div class="footnotes_validation_error"><p>' ;
$syntax_error_warning .= __ ( 'WARNING: unbalanced footnote start tag short code found.' , 'footnotes' );
$syntax_error_warning .= '</p><p>' ;
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Syntax validation setting in the dashboard under the General settings tab.
/* Translators: 1: General Settings 2: Footnote start and end short codes 3: Check for balanced shortcodes */
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$syntax_error_warning .= sprintf ( __ ( 'If this warning is irrelevant, please disable the syntax validation feature in the dashboard under %1$s > %2$s > %3$s.' , 'footnotes' ), __ ( 'General settings' , 'footnotes' ), __ ( 'Footnote start and end short codes' , 'footnotes' ), __ ( 'Check for balanced shortcodes' , 'footnotes' ) );
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$syntax_error_warning .= '</p><p>' ;
$syntax_error_warning .= __ ( 'Unbalanced start tag short code found before:' , 'footnotes' );
$syntax_error_warning .= '</p><p>“' ;
$syntax_error_warning .= $error_spot_string ;
$syntax_error_warning .= '”</p></div>' ;
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Prepend the warning box to the content.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = $syntax_error_warning . $content ;
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Checked, set flag to false to prevent duplicate warning.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $syntax_error_flag = false ;
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $content ;
2021-03-02 03:09:34 +00:00
}
}
2021-03-19 23:58:23 +00:00
/**
* Patch to allow footnotes in input field labels .
*
* - Bugfix : Forms : remove footnotes from input field values , thanks to @ bogosavljev bug report .
*
* @ reporter @ bogosavljev
* @ link https :// wordpress . org / support / topic / compatibility - issue - with - wpforms /
*
2021-03-24 21:19:07 +00:00
* @ since 2.5 . 11
2021-03-19 23:58:23 +00:00
* When the HTML 'input' element 'value' attribute value
* is derived from 'label' , footnotes need to be removed
* in the value of 'value' .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$value_regex = '#(<input [^>]+?value=["\'][^>]+?)' . self :: $start_tag_regex . '[^>]+?' . self :: $end_tag_regex . '#' ;
2021-03-19 23:58:23 +00:00
do {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = preg_replace ( $value_regex , '$1' , $content );
} while ( preg_match ( $value_regex , $content ) );
2021-03-19 23:58:23 +00:00
2021-03-23 04:02:07 +00:00
/**
* Optionally moves footnotes outside at the end of the label element .
*
* - Bugfix : Forms : prevent inadvertently toggling input elements with footnotes in their label , by optionally moving footnotes after the end of the label .
*
* @ since 2.5 . 12
* @ link https :// wordpress . org / support / topic / compatibility - issue - with - wpforms / #post-14212318
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$label_issue_solution = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_LABEL_ISSUE_SOLUTION );
2021-03-23 04:02:07 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( 'move' === $label_issue_solution ) {
2021-03-23 04:02:07 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$move_regex = '#(<label ((?!</label).)+?)(' . self :: $start_tag_regex . '((?!</label).)+?' . self :: $end_tag_regex . ')(((?!</label).)*?</label>)#' ;
2021-03-23 04:02:07 +00:00
do {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = preg_replace ( $move_regex , '$1$5<span class="moved_footnote">$3</span>' , $content );
} while ( preg_match ( $move_regex , $content ) );
2021-03-23 04:02:07 +00:00
}
/**
* Optionally disconnects labels with footnotes from their input element .
*
* - Bugfix : Forms : prevent inadvertently toggling input elements with footnotes in their label , by optionally disconnecting those labels .
*
* @ since 2.5 . 12
2021-03-24 21:19:07 +00:00
* This option is discouraged because of accessibility issues .
2021-03-23 04:02:07 +00:00
* This only edits those labels’ 'for' value that have footnotes ,
* but leaves all other labels ( those without footnotes ) alone .
* @ link https :// wordpress . org / support / topic / compatibility - issue - with - wpforms / #post-14212318
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( 'disconnect' === $label_issue_solution ) {
2021-03-23 04:02:07 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$disconnect_text = 'optionally-disconnected-from-input-field-to-prevent-toggling-while-clicking-footnote-referrer_' ;
2021-03-23 04:02:07 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = preg_replace (
'#(<label [^>]+?for=["\'])(((?!</label).)+' . self :: $start_tag_regex . ')#' ,
'$1' . $disconnect_text . '$2' ,
$content
2021-03-23 04:02:07 +00:00
);
}
2021-03-25 03:07:17 +00:00
// Post ID to make everything unique wrt infinite scroll and archive view.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $post_id = get_the_id ();
2021-03-28 12:41:33 +00:00
2021-03-31 00:49:17 +00:00
/**
* Empties the footnotes list every time Footnotes is run when the_content hook is called .
*
* - Bugfix : Process : fix footnote duplication by emptying the footnotes list every time the search algorithm is run on the content , thanks to @ inoruhana bug report .
*
* @ reporter @ inoruhana
* @ link https :// wordpress . org / support / topic / footnote - duplicated - in - the - widget /
*
* @ since 2.5 . 7
* Under certain circumstances , footnotes were duplicated , because the footnotes list was
* not emptied every time before the search algorithm was run . That happened eg when both
* the reference container resides in the widget area , and the YOAST SEO plugin is active
* and calls the hook the_content to generate the Open Graph description , while Footnotes
* is set to avoid missing out on the footnotes ( in the content ) by hooking in as soon as
* the_content is called , whereas at post end Footnotes seems to hook in the_content only
* the time it’ s the blog engine processing the post for display and appending the refs .
*
* @ since 2.6 . 3 Move footnotes list reset from footnotes_in_content () to search () .
* Emptying the footnotes list only when the_content hook is called is ineffective
* when footnotes are processed in generate_excerpt_with_footnotes () .
* Footnotes duplication is prevented also when resetting the list here .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $footnotes = array ();
2021-03-31 00:49:17 +00:00
2021-03-30 07:50:44 +00:00
// Resets the footnote number.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_index = 1 ;
2021-03-25 03:07:17 +00:00
// Contains the starting position for the lookup of a footnote.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$pos_start = 0 ;
2021-03-25 03:07:17 +00:00
2021-03-18 18:00:42 +00:00
/*
2021-03-16 19:41:08 +00:00
* Load footnote referrer template file .
*/
2021-03-19 23:58:23 +00:00
2021-03-31 00:49:17 +00:00
// Set to null in case all templates are unnecessary.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template = null ;
$template_tooltip = null ;
2021-03-16 19:41:08 +00:00
// On the condition that the footnote text is not hidden.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( ! $hide_footnotes_text ) {
2021-03-02 03:09:34 +00:00
2021-03-16 19:41:08 +00:00
// Whether AMP compatibility mode is enabled.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $amp_enabled ) {
2021-03-16 19:41:08 +00:00
// Whether first clicking a referrer needs to expand the reference container.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_COLLAPSE ) ) ) {
2021-03-16 19:41:08 +00:00
// Load 'templates/public/amp-footnote-expand.html'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'amp-footnote-expand' );
2021-03-16 19:41:08 +00:00
} else {
2021-03-18 18:00:42 +00:00
// Load 'templates/public/amp-footnote.html'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'amp-footnote' );
2021-03-16 19:41:08 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
} elseif ( Footnotes :: $alternative_tooltips_enabled ) {
2021-03-16 19:41:08 +00:00
2021-03-18 18:00:42 +00:00
// Load 'templates/public/footnote-alternative.html'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'footnote-alternative' );
2021-03-16 19:41:08 +00:00
2021-04-10 19:02:10 +00:00
// Else jQuery tooltips are enabled.
2021-03-02 03:09:34 +00:00
} else {
2021-03-16 19:41:08 +00:00
2021-03-18 18:00:42 +00:00
// Load 'templates/public/footnote.html'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'footnote' );
2021-03-02 03:09:34 +00:00
2021-03-18 18:00:42 +00:00
// Load tooltip inline script.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template_tooltip = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'tooltip' );
2021-03-02 03:09:34 +00:00
}
}
2021-03-03 18:58:03 +00:00
// Search footnotes short codes in the content.
2021-03-02 03:09:34 +00:00
do {
2021-03-03 18:58:03 +00:00
// Get first occurrence of the footnote start tag short code.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$i_int_len_content = strlen ( $content );
if ( $pos_start > $i_int_len_content ) {
$pos_start = $i_int_len_content ;
2021-03-03 18:58:03 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$pos_start = strpos ( $content , self :: $start_tag , $pos_start );
2021-03-03 18:58:03 +00:00
// No short code found, stop here.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( ! $pos_start ) {
2021-03-02 03:09:34 +00:00
break ;
}
2021-03-03 18:58:03 +00:00
// Get first occurrence of the footnote end tag short code.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$pos_end = strpos ( $content , self :: $end_tag , $pos_start );
2021-03-03 18:58:03 +00:00
// No short code found, stop here.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( ! $pos_end ) {
2021-03-02 03:09:34 +00:00
break ;
}
2021-03-03 18:58:03 +00:00
// Calculate the length of the footnote.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$length = $pos_end - $pos_start ;
2021-03-03 18:58:03 +00:00
// Get footnote text.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_text = substr ( $content , $pos_start + strlen ( self :: $start_tag ), $length - strlen ( self :: $start_tag ) );
2021-03-03 18:58:03 +00:00
// Get tooltip text if present.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $tooltip_shortcode = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER );
self :: $tooltip_shortcode_length = strlen ( self :: $tooltip_shortcode );
$tooltip_text_length = strpos ( $footnote_text , self :: $tooltip_shortcode );
$has_tooltip_text = ! $tooltip_text_length ? false : true ;
if ( $has_tooltip_text ) {
$tooltip_text = substr ( $footnote_text , 0 , $tooltip_text_length );
2021-03-02 03:09:34 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$tooltip_text = '' ;
2021-03-02 03:09:34 +00:00
}
/**
2021-03-03 18:58:03 +00:00
* URL line wrapping for Unicode non conformant browsers .
2021-03-02 03:09:34 +00:00
*
* @ since 2.1 . 1 ( CSS )
* @ since 2.1 . 4 ( PHP )
*
* Despite Unicode recommends to line - wrap URLs at slashes , and Firefox follows
* the Unicode standard , Chrome does not , making long URLs hang out of tooltips
* or extend reference containers , so that the end is hidden outside the window
* and may eventually be viewed after we scroll horizontally or zoom out . It is
* up to the web page to make URLs breaking anywhere by wrapping them in a span
* that is assigned appropriate CSS properties and values .
* @ see css / public . css
*
* - Bugfix : Tooltips : fix line breaking for hyperlinked URLs in Unicode - non - compliant user agents , thanks to @ andreasra bug report .
*
* @ reporter @ andreasra
* @ link https :// wordpress . org / support / topic / footnotes - appearing - in - header / page / 3 / #post-13657398
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 1
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container : fix width in mobile view by URL wrapping for Unicode - non - conformant browsers , thanks to @ karolszakiel bug report .
*
* @ reporter @ karolszakiel
* @ link https :// wordpress . org / support / topic / footnotes - on - mobile - phones /
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 3
2021-04-15 04:09:23 +00:00
*
2021-03-02 03:09:34 +00:00
* - Bugfix : Reference container , tooltips : fix line wrapping of URLs ( hyperlinked or not ) based on pattern , not link element .
*
* @ since 2.1 . 4
2021-04-15 04:09:23 +00:00
* @ link https :// wordpress . org / support / topic / footnotes - on - mobile - phones / #post-13710682
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container , tooltips : URL wrap : exclude image source too , thanks to @ bjrnet21 bug report .
*
* @ reporter @ bjrnet21
* @ link https :// wordpress . org / support / topic / 2 - 1 - 4 - breaks - on - my - site - images - dont - show /
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 5
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container , tooltips : URL wrap : fix regex , thanks to @ a223123131 bug report .
*
* @ reporter @ a223123131
* @ link https :// wordpress . org / support / topic / broken - layout - starting - version - 2 - 1 - 4 /
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 6
2021-04-15 04:09:23 +00:00
*
* Even ARIA labels may take a URL as value , so use \w = [ \ ' " ] as a catch-all
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Dashboard : URL wrap : add option to properly enable / disable URL wrap .
*
* @ since 2.1 . 6
2021-04-15 04:09:23 +00:00
*
2021-03-02 03:09:34 +00:00
* - Bugfix : Reference container , tooltips : URL wrap : make the quotation mark optional wrt query parameters , thanks to @ spiralofhope2 bug report .
*
* @ reporter @ spiralofhope2
* @ link https :// wordpress . org / support / topic / two - links - now - breaks - footnotes - with - blogtext /
*
2021-03-24 21:19:07 +00:00
* @ since 2.2 . 6
2021-04-15 04:09:23 +00:00
*
2021-03-02 03:09:34 +00:00
* - Bugfix : Reference container , tooltips : URL wrap : remove a bug introduced in the regex , thanks to @ rjl20 @ spaceling @ lukashuggenberg @ klusik @ friedrichnorth @ bernardzit bug reports .
*
* @ reporter @ rjl20
* @ link https :// wordpress . org / support / topic / two - links - now - breaks - footnotes - with - blogtext / #post-13825479
*
* @ reporter @ spaceling
* @ link https :// wordpress . org / support / topic / two - links - now - breaks - footnotes - with - blogtext / #post-13825532
*
* @ reporter @ lukashuggenberg
* @ link https :// wordpress . org / support / topic / 2 - 2 - 6 - breaks - all - footnotes /
*
* @ reporter @ klusik
* @ link https :// wordpress . org / support / topic / 2 - 2 - 6 - breaks - all - footnotes / #post-13825885
*
* @ reporter @ friedrichnorth
* @ link https :// wordpress . org / support / topic / footnotes - dont - show - after - update - to - 2 - 2 - 6 /
*
* @ reporter @ bernardzit
* @ link https :// wordpress . org / support / topic / footnotes - dont - show - after - update - to - 2 - 2 - 6 / #post-13826029
*
2021-03-24 21:19:07 +00:00
* @ since 2.2 . 7
2021-04-15 04:09:23 +00:00
*
2021-03-24 21:19:07 +00:00
* - Bugfix : Reference container , tooltips : URL wrap : correctly make the quotation mark optional wrt query parameters , thanks to @ spiralofhope2 bug report .
*
* @ reporter @ spiralofhope2
* @ link https :// wordpress . org / support / topic / two - links - now - breaks - footnotes - with - blogtext /
2021-03-02 03:09:34 +00:00
*
2021-03-24 21:19:07 +00:00
* @ since 2.2 . 8
2021-04-15 04:09:23 +00:00
* Correct is duplicating the negative lookbehind w / o quotes : '(?<!\w=)'
2021-03-02 03:09:34 +00:00
*
2021-03-24 21:19:07 +00:00
* - Bugfix : Reference container , tooltips : URL wrap : account for RFC 2396 allowed characters in parameter names .
* - Bugfix : Reference container , tooltips : URL wrap : exclude URLs also where the equals sign is preceded by an entity or character reference .
*
* @ since 2.2 . 9
2021-04-15 04:09:23 +00:00
* @ link https :// stackoverflow . com / questions / 814700 / http - url - allowed - characters - in - parameter - names
*
2021-03-24 21:19:07 +00:00
* - Bugfix : Reference container , tooltips : URL wrap : support also file transfer protocol URLs .
2021-03-02 03:09:34 +00:00
*
2021-03-24 21:19:07 +00:00
* @ since 2.2 . 10
2021-04-15 04:09:23 +00:00
*
2021-03-02 03:09:34 +00:00
* - Bugfix : Reference container , tooltips : URL wrap : exclude URL pattern as folder name in Wayback Machine URL , thanks to @ rumperuu bug report .
*
* @ reporter @ rumperuu
* @ link https :// wordpress . org / support / topic / line - wrap - href - regex - bug /
*
2021-03-24 21:19:07 +00:00
* @ since 2.5 . 3
2021-04-15 04:09:23 +00:00
* By adding a 3 rd negative lookbehind : '(?<!/)' .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container , tooltips : URL wrap : account for leading space in value , thanks to @ karolszakiel example provision .
*
* @ reporter @ karolszakiel
* @ link https :// wordpress . org / support / topic / footnotes - on - mobile - phones /
*
2021-03-24 21:19:07 +00:00
* @ since 2.5 . 4
2021-03-02 03:09:34 +00:00
* The value of an href argument may have leading ( and trailing ) space .
* @ link https :// webmasters . stackexchange . com / questions / 93540 / are - spaces - in - href - valid
* Needs to replicate the relevant negative lookbehind at least with one and with two spaces .
* Note : The WordPress blog engine edits these values , cropping these leading / trailing spaces .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTE_URL_WRAP_ENABLED ) ) ) {
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_text = preg_replace (
2021-03-02 03:09:34 +00:00
'#(?<![-\w\.!~\*\'\(\);]=[\'"])(?<![-\w\.!~\*\'\(\);]=[\'"] )(?<![-\w\.!~\*\'\(\);]=[\'"] )(?<![-\w\.!~\*\'\(\);]=)(?<!/)((ht|f)tps?://[^\\s<]+)#' ,
'<span class="footnote_url_wrap">$1</span>' ,
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_text
2021-03-02 03:09:34 +00:00
);
}
2021-03-03 18:58:03 +00:00
// Text to be displayed instead of the footnote.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_replace_text = '' ;
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Whether hard links are enabled.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( self :: $hard_links_enabled ) {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Get the configurable parts.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $referrer_link_slug = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERRER_FRAGMENT_ID_SLUG );
self :: $footnote_link_slug = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTE_FRAGMENT_ID_SLUG );
self :: $link_ids_separator = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: HARD_LINK_IDS_SEPARATOR );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Streamline ID concatenation.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $post_container_id_compound = self :: $link_ids_separator ;
self :: $post_container_id_compound .= self :: $post_id ;
self :: $post_container_id_compound .= self :: $link_ids_separator ;
self :: $post_container_id_compound .= self :: $reference_container_id ;
self :: $post_container_id_compound .= self :: $link_ids_separator ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Display the footnote referrers and the tooltips.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( ! $hide_footnotes_text ) {
$index = Footnotes_Convert :: index ( $footnote_index , Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_COUNTER_STYLE ) );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Display only a truncated footnote text if option enabled.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$enable_excerpt = Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED ) );
$max_length = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH ) );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Define excerpt text as footnote text by default.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$excerpt_text = $footnote_text ;
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Tooltip truncation .
2021-03-02 03:09:34 +00:00
*
* - Adding : Tooltips : Read - on button : Label : configurable instead of localizable , thanks to @ rovanov example provision .
*
* @ reporter @ rovanov
* @ link https :// wordpress . org / support / topic / offset - x - axis - and - offset - y - axis - does - not - working /
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 0
2021-03-02 03:09:34 +00:00
* If the tooltip truncation option is enabled , it’ s done based on character count ,
* and a trailing incomplete word is cropped .
* 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.
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $tooltips_enabled && $enable_excerpt ) {
$dummy_text = wp_strip_all_tags ( $footnote_text );
if ( is_int ( $max_length ) && strlen ( $dummy_text ) > $max_length ) {
$excerpt_text = substr ( $dummy_text , 0 , $max_length );
$excerpt_text = substr ( $excerpt_text , 0 , strrpos ( $excerpt_text , ' ' ) );
$excerpt_text .= ' … <' ;
$excerpt_text .= self :: $hard_links_enabled ? 'a' : 'span' ;
$excerpt_text .= ' class="footnote_tooltip_continue" ' ;
2021-03-19 23:58:23 +00:00
2021-03-28 12:41:33 +00:00
// If AMP compatibility mode is enabled.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $amp_enabled ) {
2021-03-28 12:41:33 +00:00
// If the reference container is also collapsed by default.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_COLLAPSE ) ) ) {
$excerpt_text .= ' on="tap:footnote_references_container_' ;
$excerpt_text .= self :: $post_id . '_' . self :: $reference_container_id ;
$excerpt_text .= '.toggleClass(class=collapsed, force=false),footnotes_container_button_plus_' ;
$excerpt_text .= self :: $post_id . '_' . self :: $reference_container_id ;
$excerpt_text .= '.toggleClass(class=collapsed, force=true),footnotes_container_button_minus_' ;
$excerpt_text .= self :: $post_id . '_' . self :: $reference_container_id ;
$excerpt_text .= '.toggleClass(class=collapsed, force=false)"' ;
2021-03-28 12:41:33 +00:00
}
} else {
// Don’ t add onclick event in AMP compatibility mode.
2021-04-15 04:09:23 +00:00
// Reverted wrong linting.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$excerpt_text .= ' onclick="footnote_moveToReference_' . self :: $post_id ;
$excerpt_text .= '_' . self :: $reference_container_id ;
$excerpt_text .= '(\'footnote_plugin_reference_' . self :: $post_id ;
$excerpt_text .= '_' . self :: $reference_container_id ;
$excerpt_text .= " _ $index '); \" " ;
2021-03-28 12:41:33 +00:00
}
2021-03-03 18:58:03 +00:00
// If enabled, add the hard link fragment ID.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( self :: $hard_links_enabled ) {
2021-03-03 18:58:03 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$excerpt_text .= ' href="#' ;
$excerpt_text .= self :: $footnote_link_slug ;
$excerpt_text .= self :: $post_container_id_compound ;
$excerpt_text .= $index ;
$excerpt_text .= '"' ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$excerpt_text .= '>' ;
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Configurable read - on button label .
2021-03-02 03:09:34 +00:00
*
* - Adding : Tooltips : Read - on button : Label : configurable instead of localizable , thanks to @ rovanov example provision .
*
* @ reporter @ rovanov
* @ link https :// wordpress . org / support / topic / offset - x - axis - and - offset - y - axis - does - not - working /
2021-03-24 21:19:07 +00:00
*
* @ since 2.1 . 0
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$excerpt_text .= Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_TOOLTIP_READON_LABEL );
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$excerpt_text .= self :: $hard_links_enabled ? '</a>' : '</span>' ;
2021-03-02 03:09:34 +00:00
}
}
/**
2021-03-03 18:58:03 +00:00
* Referrers element superscript or baseline .
2021-03-02 03:09:34 +00:00
*
2021-03-24 21:19:07 +00:00
* - Bugfix : Referrers : new setting for vertical align : superscript ( default ) or baseline ( optional ), thanks to @ cwbayer bug report .
2021-03-02 03:09:34 +00:00
*
* @ reporter @ cwbayer
* @ link https :// wordpress . org / support / topic / footnote - number - in - text - superscript - disrupts - leading /
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 1
* Define the HTML element to use for the referrers .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS ) ) ) {
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$sup_span = 'sup' ;
2021-03-02 03:09:34 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$sup_span = 'span' ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Whether hard links are enabled.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( self :: $hard_links_enabled ) {
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $link_span = 'a' ;
self :: $link_close_tag = '</a>' ;
// Self::$link_open_tag will be defined as needed.
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Compose hyperlink address (leading space is in template).
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_link_argument = 'href="#' ;
$footnote_link_argument .= self :: $footnote_link_slug ;
$footnote_link_argument .= self :: $post_container_id_compound ;
$footnote_link_argument .= $index ;
$footnote_link_argument .= '" class="footnote_hard_link"' ;
2021-03-02 03:09:34 +00:00
/**
* Compose fragment ID anchor with offset , for use in reference container .
* Empty span , child of empty span , to avoid tall dotted rectangles in browser .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$referrer_anchor_element = '<span class="footnote_referrer_base"><span id="' ;
$referrer_anchor_element .= self :: $referrer_link_slug ;
$referrer_anchor_element .= self :: $post_container_id_compound ;
$referrer_anchor_element .= $index ;
$referrer_anchor_element .= '" class="footnote_referrer_anchor"></span></span>' ;
2021-03-02 03:09:34 +00:00
} else {
/**
* Initialize hard link variables when hard links are disabled .
*
* - Bugfix : Process : initialize hard link address variables to empty string to fix 'undefined variable' bug , thanks to @ a223123131 bug report .
*
* @ reporter @ a223123131
* @ link https :// wordpress . org / support / topic / wp_debug - php - notice /
*
2021-03-24 21:19:07 +00:00
* @ since 2.4 . 0
2021-03-02 03:09:34 +00:00
* If no hyperlink nor offset anchor is needed , initialize as empty .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_link_argument = '' ;
$referrer_anchor_element = '' ;
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// The link element is set independently as it may be needed for styling.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: LINK_ELEMENT_ENABLED ) ) ) {
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $link_span = 'a' ;
self :: $link_open_tag = '<a>' ;
self :: $link_close_tag = '</a>' ;
2021-03-02 03:09:34 +00:00
}
}
2021-03-03 18:58:03 +00:00
// Determine tooltip content.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $tooltips_enabled ) {
$tooltip_content = $has_tooltip_text ? $tooltip_text : $excerpt_text ;
2021-03-02 03:09:34 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$tooltip_content = '' ;
2021-03-02 03:09:34 +00:00
}
/**
* Determine shrink width if alternative tooltips are enabled .
*
* @ since 2.5 . 6
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$tooltip_style = '' ;
if ( Footnotes :: $alternative_tooltips_enabled && Footnotes :: $tooltips_enabled ) {
$tooltip_length = strlen ( wp_strip_all_tags ( $tooltip_content ) );
if ( $tooltip_length < 70 ) {
$tooltip_style = ' style="width: ' ;
$tooltip_style .= ( $tooltip_length * . 7 );
$tooltip_style .= 'em;"' ;
2021-03-02 03:09:34 +00:00
}
}
2021-03-03 18:58:03 +00:00
// Fill in 'templates/public/footnote.html'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template -> replace (
2021-03-02 03:09:34 +00:00
array (
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
'link-span' => self :: $link_span ,
'post_id' => self :: $post_id ,
'container_id' => self :: $reference_container_id ,
'note_id' => $index ,
'hard-link' => $footnote_link_argument ,
'sup-span' => $sup_span ,
'before' => Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_STYLING_BEFORE ),
'index' => $index ,
'after' => Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_STYLING_AFTER ),
'anchor-element' => $referrer_anchor_element ,
'style' => $tooltip_style ,
'text' => $tooltip_content ,
2021-03-02 03:09:34 +00:00
)
);
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_replace_text = $template -> get_content ();
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Reset the template.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template -> reload ();
2021-03-02 03:09:34 +00:00
2021-03-19 23:58:23 +00:00
// If tooltips are enabled but neither AMP nor alternative are.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $tooltips_enabled && ! Footnotes :: $amp_enabled && ! Footnotes :: $alternative_tooltips_enabled ) {
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$offset_y = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y ) );
$offset_x = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X ) );
$fade_in_delay = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FADE_IN_DELAY ) );
$fade_in_duration = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FADE_IN_DURATION ) );
$fade_out_delay = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FADE_OUT_DELAY ) );
$fade_out_duration = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: MOUSE_OVER_BOX_FADE_OUT_DURATION ) );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Fill in 'templates/public/tooltip.html'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template_tooltip -> replace (
2021-03-02 03:09:34 +00:00
array (
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
'post_id' => self :: $post_id ,
'container_id' => self :: $reference_container_id ,
'note_id' => $index ,
'position' => Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_MOUSE_OVER_BOX_POSITION ),
'offset-y' => ! empty ( $offset_y ) ? $offset_y : 0 ,
'offset-x' => ! empty ( $offset_x ) ? $offset_x : 0 ,
'fade-in-delay' => ! empty ( $fade_in_delay ) ? $fade_in_delay : 0 ,
'fade-in-duration' => ! empty ( $fade_in_duration ) ? $fade_in_duration : 0 ,
'fade-out-delay' => ! empty ( $fade_out_delay ) ? $fade_out_delay : 0 ,
'fade-out-duration' => ! empty ( $fade_out_duration ) ? $fade_out_duration : 0 ,
2021-03-02 03:09:34 +00:00
)
);
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_replace_text .= $template_tooltip -> get_content ();
$template_tooltip -> reload ();
2021-03-02 03:09:34 +00:00
}
}
2021-03-03 18:58:03 +00:00
// Replace the footnote with the template.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$content = substr_replace ( $content , $footnote_replace_text , $pos_start , $length + strlen ( self :: $end_tag ) );
2021-03-03 18:58:03 +00:00
// Add footnote only if not empty.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( ! empty ( $footnote_text ) ) {
2021-03-03 18:58:03 +00:00
// Set footnote to the output box at the end.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $footnotes [] = $footnote_text ;
2021-03-03 18:58:03 +00:00
// Increase footnote index.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_index ++ ;
2021-03-02 03:09:34 +00:00
}
/**
2021-04-13 08:18:07 +00:00
* Fixes a partial footnotes process outage happening when tooltips are truncated or disabled .
* Fixed a footnotes numbering bug happening under de facto rare circumstances .
2021-03-02 03:09:34 +00:00
*
* - 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.
*
2021-03-24 21:19:07 +00:00
* @ reporter @ rumperuu
* @ link https :// wordpress . org / support / topic / footnotes - numbered - incorrectly /
2021-03-02 03:09:34 +00:00
*
* @ contributor @ lolzim
* @ link https :// wordpress . org / support / topic / footnotes - numbered - incorrectly / #post-14062032
*
2021-03-24 21:19:07 +00:00
* @ since 2.5 . 5
2021-03-02 03:09:34 +00:00
* 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 .
* A bug disturbing the order of the footnotes depending on the text before the first
* footnote , the length of the first footnote and the length of the templates for the
2021-04-13 08:18:07 +00:00
* footnote and the tooltip .
* 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 .
* The reason why the numbering disorder reverted to a partial process outage
* since 2.5 . 14 is that with this version , the plugin stopped processing the
* content multiple times , and started unifying the shortcodes instead , to fix
* the numbering disorder affecting delimiter shortcodes with pointy brackets
* and mixed escapement schemas .
2021-03-02 03:09:34 +00:00
*/
2021-03-03 18:58:03 +00:00
// Add offset to the new starting position.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$pos_start += strlen ( $footnote_replace_text );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
} while ( true );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Return content.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $content ;
2021-03-02 03:09:34 +00:00
}
/**
* Generates the reference container .
*
* @ since 1.5 . 0
* @ return string
*
* @ 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 .
*/
2021-03-03 18:58:03 +00:00
public function reference_container () {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// No footnotes have been replaced on this page.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( empty ( self :: $footnotes ) ) {
2021-03-03 18:58:03 +00:00
return '' ;
2021-03-02 03:09:34 +00:00
}
/**
2021-03-03 18:58:03 +00:00
* Footnote index backlink symbol .
2021-03-02 03:09:34 +00:00
*
* - 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
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 1
2021-03-02 03:09:34 +00:00
*/
2021-03-24 21:19:07 +00:00
// If the backlink symbol is enabled.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE ) ) ) {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Get html arrow.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$arrow = Footnotes_Convert :: get_arrow ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: HYPERLINK_ARROW ) );
2021-03-03 18:58:03 +00:00
// Set html arrow to the first one if invalid index defined.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( is_array ( $arrow ) ) {
$arrow = Footnotes_Convert :: get_arrow ( 0 );
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Get user defined arrow.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$arrow_user_defined = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: HYPERLINK_ARROW_USER_DEFINED );
if ( ! empty ( $arrow_user_defined ) ) {
$arrow = $arrow_user_defined ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Wrap the arrow in a @media print { display:hidden } span.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_arrow = '<span class="footnote_index_arrow">' ;
$footnote_arrow .= $arrow . '</span>' ;
2021-03-02 03:09:34 +00:00
} else {
2021-03-03 18:58:03 +00:00
// If the backlink symbol isn’ t enabled, set it to empty.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$arrow = '' ;
$footnote_arrow = '' ;
2021-03-02 03:09:34 +00:00
}
/**
2021-03-03 18:58:03 +00:00
* Backlink separator .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container : make separating and terminating punctuation optional and configurable , thanks to @ docteurfitness issue report and code contribution .
*
2021-03-24 21:19:07 +00:00
* @ reporter @ docteurfitness
* @ link https :// wordpress . org / support / topic / update - 2 - 1 - 3 /
2021-03-02 03:09:34 +00:00
*
* @ contributor @ docteurfitness
* @ link https :// wordpress . org / support / topic / update - 2 - 1 - 3 / #post-13704194
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 4
* Initially an appended comma was hard - coded in this algorithm for enumerations .
* The comma in enumerations is not universally preferred .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_SEPARATOR_ENABLED ) ) ) {
2021-03-03 18:58:03 +00:00
// Check if it is input-configured.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$separator = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_SEPARATOR_CUSTOM );
2021-03-03 18:58:03 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( empty ( $separator ) ) {
2021-03-03 18:58:03 +00:00
// If it is not, check which option is on.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$separator_option = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_SEPARATOR_OPTION );
switch ( $separator_option ) {
2021-03-03 18:58:03 +00:00
case 'comma' :
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$separator = ',' ;
2021-03-03 18:58:03 +00:00
break ;
case 'semicolon' :
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$separator = ';' ;
2021-03-03 18:58:03 +00:00
break ;
case 'en_dash' :
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$separator = ' –' ;
2021-03-03 18:58:03 +00:00
break ;
2021-03-02 03:09:34 +00:00
}
}
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$separator = '' ;
2021-03-02 03:09:34 +00:00
}
/**
2021-03-03 18:58:03 +00:00
* Backlink terminator .
2021-03-02 03:09:34 +00:00
*
* Initially a dot was appended in the table row template .
2021-03-03 18:58:03 +00:00
*
2021-03-02 03:09:34 +00:00
* @ since 2.0 . 6 a dot after footnote numbers is discarded as not localizable ;
* making it optional was envisaged .
2021-03-03 18:58:03 +00:00
* @ since 2.1 . 4 the terminator is optional , has options , and is configurable .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_TERMINATOR_ENABLED ) ) ) {
2021-03-03 18:58:03 +00:00
// Check if it is input-configured.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$terminator = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_TERMINATOR_CUSTOM );
2021-03-03 18:58:03 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( empty ( $terminator ) ) {
2021-03-03 18:58:03 +00:00
// If it is not, check which option is on.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$terminator_option = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_TERMINATOR_OPTION );
switch ( $terminator_option ) {
2021-03-03 18:58:03 +00:00
case 'period' :
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$terminator = '.' ;
2021-03-03 18:58:03 +00:00
break ;
case 'parenthesis' :
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$terminator = ')' ;
2021-03-03 18:58:03 +00:00
break ;
case 'colon' :
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$terminator = ':' ;
2021-03-03 18:58:03 +00:00
break ;
2021-03-02 03:09:34 +00:00
}
}
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$terminator = '' ;
2021-03-02 03:09:34 +00:00
}
/**
2021-03-03 18:58:03 +00:00
* Line breaks .
2021-03-02 03:09:34 +00:00
*
* - 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 .
* Otherwise , an ordinary space character offering a line break opportunity is inserted .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$line_break = Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: BACKLINKS_LINE_BREAKS_ENABLED ) ) ? '<br />' : ' ' ;
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Line breaks for source readability .
*
2021-03-02 03:09:34 +00:00
* For maintenance and support , table rows in the reference container should be
* separated by an empty line . So we add these line breaks for source readability .
2021-03-03 18:58:03 +00:00
* Before the first table row ( breaks between rows are ~ 200 lines below ) .
2021-03-02 03:09:34 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$body = " \r \n \r \n " ;
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Reference container table row template load .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container : option to restore pre - 2.0 . 0 layout with the backlink symbol in an extra column .
*
* @ since 2.1 . 1
2021-04-15 04:09:23 +00:00
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$combine_identical_footnotes = Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: COMBINE_IDENTICAL_FOOTNOTES ) );
2021-03-19 23:58:23 +00:00
2021-03-18 18:00:42 +00:00
// AMP compatibility requires a full set of AMP compatible table row templates.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $amp_enabled ) {
2021-03-19 23:58:23 +00:00
2021-03-18 18:00:42 +00:00
// When combining identical footnotes is turned on, another template is needed.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( $combine_identical_footnotes ) {
2021-03-19 23:58:23 +00:00
2021-03-18 18:00:42 +00:00
// The combining template allows for backlink clusters and supports cell clicking for single notes.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'amp-reference-container-body-combi' );
2021-03-02 03:09:34 +00:00
2021-03-18 18:00:42 +00:00
} else {
2021-03-02 03:09:34 +00:00
2021-03-18 18:00:42 +00:00
// When 3-column layout is turned on (only available if combining is turned off).
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE ) ) ) {
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'amp-reference-container-body-3column' );
2021-03-18 18:00:42 +00:00
} else {
// When switch symbol and index is turned on, and combining and 3-columns are off.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) ) ) {
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'amp-reference-container-body-switch' );
2021-03-18 18:00:42 +00:00
} else {
2021-03-02 03:09:34 +00:00
2021-03-18 18:00:42 +00:00
// Default is the standard template.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'amp-reference-container-body' );
2021-03-18 18:00:42 +00:00
}
}
}
} else {
2021-03-19 23:58:23 +00:00
2021-03-18 18:00:42 +00:00
// When combining identical footnotes is turned on, another template is needed.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( $combine_identical_footnotes ) {
2021-03-19 23:58:23 +00:00
2021-03-18 18:00:42 +00:00
// The combining template allows for backlink clusters and supports cell clicking for single notes.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'reference-container-body-combi' );
2021-03-02 03:09:34 +00:00
} else {
2021-03-18 18:00:42 +00:00
// When 3-column layout is turned on (only available if combining is turned off).
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE ) ) ) {
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'reference-container-body-3column' );
2021-03-02 03:09:34 +00:00
} else {
2021-03-18 18:00:42 +00:00
// When switch symbol and index is turned on, and combining and 3-columns are off.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) ) ) {
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'reference-container-body-switch' );
2021-03-18 18:00:42 +00:00
} else {
2021-03-02 03:09:34 +00:00
2021-03-18 18:00:42 +00:00
// Default is the standard template.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'reference-container-body' );
2021-03-18 18:00:42 +00:00
}
2021-03-02 03:09:34 +00:00
}
}
}
/**
2021-03-03 18:58:03 +00:00
* Switch backlink symbol and footnote number .
2021-03-02 03:09:34 +00:00
*
* - 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
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$symbol_switch = Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Loop through all footnotes found in the page.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$num_footnotes = count ( self :: $footnotes );
for ( $index = 0 ; $index < $num_footnotes ; $index ++ ) {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Get footnote text.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_text = self :: $footnotes [ $index ];
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// If footnote is empty, go to the next one;.
// With combine identicals turned on, identicals will be deleted and are skipped.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( empty ( $footnote_text ) ) {
2021-03-02 03:09:34 +00:00
continue ;
}
2021-03-03 18:58:03 +00:00
// Generate content of footnote index cell.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$first_footnote_index = ( $index + 1 );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Get the footnote index string and.
// Keep supporting legacy index placeholder.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_id = Footnotes_Convert :: index ( ( $index + 1 ), Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_COUNTER_STYLE ) );
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Case of only one backlink per table row .
2021-03-02 03:09:34 +00:00
*
2021-03-03 18:58:03 +00:00
* If enabled , and for the case the footnote is single , compose hard link .
2021-03-02 03:09:34 +00:00
*/
2021-03-03 18:58:03 +00:00
// Define anyway.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$hard_link_address = '' ;
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( self :: $hard_links_enabled ) {
2021-03-02 03:09:34 +00:00
/**
* 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 /
*
2021-03-24 21:19:07 +00:00
* @ since 2.5 . 4
2021-03-02 03:09:34 +00:00
* 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
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_BACKLINK_TOOLTIP_ENABLE ) ) ) {
$use_backbutton_hint = ' title="' ;
$use_backbutton_hint .= Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_BACKLINK_TOOLTIP_TEXT );
$use_backbutton_hint .= '"' ;
2021-03-02 03:09:34 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$use_backbutton_hint = '' ;
2021-03-02 03:09:34 +00:00
}
/**
* Compose fragment ID anchor with offset , for use in reference container .
* Empty span , child of empty span , to avoid tall dotted rectangles in browser .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_anchor_element = '<span class="footnote_item_base"><span id="' ;
$footnote_anchor_element .= self :: $footnote_link_slug ;
$footnote_anchor_element .= self :: $post_container_id_compound ;
$footnote_anchor_element .= $footnote_id ;
$footnote_anchor_element .= '" class="footnote_item_anchor"></span></span>' ;
2021-03-03 18:58:03 +00:00
// Compose optional hard link address.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$hard_link_address = ' href="#' ;
$hard_link_address .= self :: $referrer_link_slug ;
$hard_link_address .= self :: $post_container_id_compound ;
$hard_link_address .= $footnote_id . '"' ;
$hard_link_address .= $use_backbutton_hint ;
2021-03-03 18:58:03 +00:00
// Compose optional opening link tag with optional hard link, mandatory for instance.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $link_open_tag = '<a' . $hard_link_address ;
self :: $link_open_tag = ' class="footnote_hard_back_link">' ;
2021-03-02 03:09:34 +00:00
} else {
2021-03-03 18:58:03 +00:00
// Define as empty, too.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_anchor_element = '' ;
2021-03-02 03:09:34 +00:00
}
/**
2021-03-03 18:58:03 +00:00
* Support for combining identicals : compose enumerated backlinks .
2021-03-02 03:09:34 +00:00
*
* - 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 /
*
2021-03-24 21:19:07 +00:00
* @ since 2.1 . 1
2021-03-02 03:09:34 +00:00
* 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 .
*/
2021-03-03 18:58:03 +00:00
// Set a flag to check for the combined status of a footnote item.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$flag_combined = false ;
2021-03-03 18:58:03 +00:00
// Set otherwise unused variables as empty to avoid screwing up the placeholder array.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$backlink_event = '' ;
$footnote_backlinks = '' ;
$footnote_reference = '' ;
2021-03-03 18:58:03 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( $combine_identical_footnotes ) {
2021-03-03 18:58:03 +00:00
// ID, optional hard link address, and class.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_reference = '<' . self :: $link_span ;
$footnote_reference .= ' id="footnote_plugin_reference_' ;
$footnote_reference .= self :: $post_id ;
$footnote_reference .= '_' . self :: $reference_container_id ;
$footnote_reference .= " _ $footnote_id\ " " ;
if ( self :: $hard_links_enabled ) {
$footnote_reference .= ' href="#' ;
$footnote_reference .= self :: $referrer_link_slug ;
$footnote_reference .= self :: $post_container_id_compound ;
$footnote_reference .= $footnote_id . '"' ;
$footnote_reference .= $use_backbutton_hint ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_reference .= ' class="footnote_backlink"' ;
2021-03-03 18:58:03 +00:00
2021-03-19 23:58:23 +00:00
/*
* The click event goes in the table cell if footnote remains single .
*/
2021-04-15 04:09:23 +00:00
// Reverted wrong linting.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$backlink_event = ' onclick="footnote_moveToAnchor_' ;
2021-03-19 23:58:23 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$backlink_event .= self :: $post_id ;
$backlink_event .= '_' . self :: $reference_container_id ;
$backlink_event .= " ('footnote_plugin_tooltip_ " ;
$backlink_event .= self :: $post_id ;
$backlink_event .= '_' . self :: $reference_container_id ;
$backlink_event .= " _ $footnote_id '); \" " ;
2021-03-03 18:58:03 +00:00
// The dedicated template enumerating backlinks uses another variable.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_backlinks = $footnote_reference ;
2021-03-03 18:58:03 +00:00
// Append the click event right to the backlink item for enumerations;.
// Else it goes in the table cell.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_backlinks .= $backlink_event . '>' ;
$footnote_reference .= '>' ;
2021-03-03 18:58:03 +00:00
// Append the optional offset anchor for hard links.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( self :: $hard_links_enabled ) {
$footnote_reference .= $footnote_anchor_element ;
$footnote_backlinks .= $footnote_anchor_element ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Continue both single note and notes cluster, depending on switch option status.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( $symbol_switch ) {
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_reference .= " $footnote_id $footnote_arrow " ;
$footnote_backlinks .= " $footnote_id $footnote_arrow " ;
2021-03-02 03:09:34 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_reference .= " $footnote_arrow $footnote_id " ;
$footnote_backlinks .= " $footnote_arrow $footnote_id " ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// If that is the only footnote with this text, we’ re almost done..
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Check if it isn't the last footnote in the array.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( $first_footnote_index < count ( self :: $footnotes ) ) {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Get all footnotes that haven't passed yet.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$num_footnotes = count ( self :: $footnotes );
for ( $check_index = $first_footnote_index ; $check_index < $num_footnotes ; $check_index ++ ) {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Check if a further footnote is the same as the actual one.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( self :: $footnotes [ $check_index ] === $footnote_text ) {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// If so, set the further footnote as empty so it won't be displayed later.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $footnotes [ $check_index ] = '' ;
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Set the flag to true for the combined status.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$flag_combined = true ;
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Update the footnote ID.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_id = Footnotes_Convert :: index ( ( $check_index + 1 ), Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_COUNTER_STYLE ) );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Resume composing the backlinks enumeration.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_backlinks .= " $separator </ " ;
$footnote_backlinks .= self :: $link_span . '>' ;
$footnote_backlinks .= $line_break ;
$footnote_backlinks .= '<' . self :: $link_span ;
$footnote_backlinks .= ' id="footnote_plugin_reference_' ;
$footnote_backlinks .= self :: $post_id ;
$footnote_backlinks .= '_' . self :: $reference_container_id ;
$footnote_backlinks .= " _ $footnote_id\ " " ;
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Insert the optional hard link address.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( self :: $hard_links_enabled ) {
$footnote_backlinks .= ' href="#' ;
$footnote_backlinks .= self :: $referrer_link_slug ;
$footnote_backlinks .= self :: $post_container_id_compound ;
$footnote_backlinks .= $footnote_id . '"' ;
$footnote_backlinks .= $use_backbutton_hint ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_backlinks .= ' class="footnote_backlink"' ;
2021-03-19 23:58:23 +00:00
2021-04-15 04:09:23 +00:00
// Reverted wrong linting.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_backlinks .= ' onclick="footnote_moveToAnchor_' ;
2021-03-19 23:58:23 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_backlinks .= self :: $post_id ;
$footnote_backlinks .= '_' . self :: $reference_container_id ;
$footnote_backlinks .= " ('footnote_plugin_tooltip_ " ;
$footnote_backlinks .= self :: $post_id ;
$footnote_backlinks .= '_' . self :: $reference_container_id ;
$footnote_backlinks .= " _ $footnote_id '); \" > " ;
2021-03-03 18:58:03 +00:00
// Append the offset anchor for optional hard links.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( self :: $hard_links_enabled ) {
$footnote_backlinks .= '<span class="footnote_item_base"><span id="' ;
$footnote_backlinks .= self :: $footnote_link_slug ;
$footnote_backlinks .= self :: $post_container_id_compound ;
$footnote_backlinks .= $footnote_id ;
$footnote_backlinks .= '" class="footnote_item_anchor"></span></span>' ;
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_backlinks .= $symbol_switch ? '' : $footnote_arrow ;
$footnote_backlinks .= $footnote_id ;
$footnote_backlinks .= $symbol_switch ? $footnote_arrow : '' ;
2021-03-02 03:09:34 +00:00
}
}
}
2021-03-03 18:58:03 +00:00
// Append terminator and end tag.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$footnote_reference .= $terminator . '</' . self :: $link_span . '>' ;
$footnote_backlinks .= $terminator . '</' . self :: $link_span . '>' ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Line wrapping of URLs already fixed, see above.
// Get reference container item text if tooltip text goes separate.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$tooltip_text_length = strpos ( $footnote_text , self :: $tooltip_shortcode );
$has_tooltip_text = ! $tooltip_text_length ? false : true ;
if ( $has_tooltip_text ) {
$not_tooltip_text = substr ( $footnote_text , ( $tooltip_text_length + self :: $tooltip_shortcode_length ) );
self :: $mirror_tooltip_text = Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE ) );
if ( self :: $mirror_tooltip_text ) {
$tooltip_text = substr ( $footnote_text , 0 , $tooltip_text_length );
$reference_text_introducer = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR );
$reference_text = $tooltip_text . $reference_text_introducer . $not_tooltip_text ;
2021-03-02 03:09:34 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$reference_text = $not_tooltip_text ;
2021-03-02 03:09:34 +00:00
}
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$reference_text = $footnote_text ;
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Replace all placeholders in table row template.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template -> replace (
2021-03-02 03:09:34 +00:00
array (
2021-03-03 18:58:03 +00:00
// Placeholder used in all templates.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
'text' => $reference_text ,
2021-03-03 18:58:03 +00:00
// Used in standard layout W/O COMBINED FOOTNOTES.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
'post_id' => self :: $post_id ,
'container_id' => self :: $reference_container_id ,
'note_id' => Footnotes_Convert :: index ( $first_footnote_index , Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_COUNTER_STYLE ) ),
'link-start' => self :: $link_open_tag ,
'link-end' => self :: $link_close_tag ,
'link-span' => self :: $link_span ,
'terminator' => $terminator ,
'anchor-element' => $footnote_anchor_element ,
'hard-link' => $hard_link_address ,
2021-03-03 18:58:03 +00:00
// Used in standard layout WITH COMBINED IDENTICALS TURNED ON.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
'pointer' => $flag_combined ? '' : ' pointer' ,
'event' => $flag_combined ? '' : $backlink_event ,
'backlinks' => $flag_combined ? $footnote_backlinks : $footnote_reference ,
2021-03-03 18:58:03 +00:00
// Legacy placeholders for use in legacy layout templates.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
'arrow' => $footnote_arrow ,
'index' => $footnote_id ,
2021-03-02 03:09:34 +00:00
)
);
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$body .= $template -> get_content ();
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Extra line breaks for page source readability.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$body .= " \r \n \r \n " ;
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template -> reload ();
2021-03-02 03:09:34 +00:00
}
2021-03-03 18:58:03 +00:00
// Call again for robustness when priority levels don’ t match any longer.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $scroll_offset = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SCROLL_OFFSET ) );
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Streamline.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$collapse_default = Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_COLLAPSE ) );
2021-03-02 03:09:34 +00:00
/**
2021-03-03 18:58:03 +00:00
* Reference container label .
2021-03-02 03:09:34 +00:00
*
* - Bugfix : Reference container : Label : set empty label to U + 202 F NNBSP for more robustness , thanks to @ lukashuggenberg feedback .
*
* @ reporter @ lukashuggenberg
*
2021-03-24 21:19:07 +00:00
* @ since 2.4 . 0
2021-03-02 03:09:34 +00:00
* 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 + 202 F NARROW NO - BREAK SPACE .
*/
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$reference_container_label = Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_NAME );
2021-03-02 03:09:34 +00:00
2021-03-16 19:41:08 +00:00
// Select the reference container template.
// Whether AMP compatibility mode is enabled.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes :: $amp_enabled ) {
2021-03-16 19:41:08 +00:00
// Whether the reference container is collapsed by default.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_COLLAPSE ) ) ) {
2021-03-16 19:41:08 +00:00
// Load 'templates/public/amp-reference-container-collapsed.html'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template_container = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'amp-reference-container-collapsed' );
2021-03-16 19:41:08 +00:00
} else {
// Load 'templates/public/amp-reference-container.html'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template_container = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'amp-reference-container' );
2021-03-16 19:41:08 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
} elseif ( 'js' === Footnotes :: $script_mode ) {
2021-03-20 20:48:54 +00:00
// Load 'templates/public/js-reference-container.html'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template_container = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'js-reference-container' );
2021-03-20 20:48:54 +00:00
} else {
2021-03-02 03:09:34 +00:00
2021-03-03 18:58:03 +00:00
// Load 'templates/public/reference-container.html'.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template_container = new Footnotes_Template ( Footnotes_Template :: PUBLIC , 'reference-container' );
2021-03-20 20:48:54 +00:00
}
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$scroll_offset = '' ;
$scroll_down_delay = '' ;
$scroll_down_duration = '' ;
$scroll_up_delay = '' ;
$scroll_up_duration = '' ;
2021-03-20 20:48:54 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( 'jquery' === Footnotes :: $script_mode ) {
2021-03-20 20:48:54 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$scroll_offset = ( self :: $scroll_offset / 100 );
$scroll_up_duration = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SCROLL_DURATION ) );
2021-03-20 20:48:54 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
if ( Footnotes_Convert :: to_bool ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY ) ) ) {
2021-03-20 20:48:54 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$scroll_down_duration = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SCROLL_DOWN_DURATION ) );
2021-03-20 20:48:54 +00:00
} else {
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$scroll_down_duration = $scroll_up_duration ;
2021-03-20 20:48:54 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$scroll_down_delay = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SCROLL_DOWN_DELAY ) );
$scroll_up_delay = intval ( Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: FOOTNOTES_SCROLL_UP_DELAY ) );
2021-03-02 03:09:34 +00:00
}
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
$template_container -> replace (
2021-03-02 03:09:34 +00:00
array (
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
'post_id' => self :: $post_id ,
'container_id' => self :: $reference_container_id ,
'element' => Footnotes_Settings :: instance () -> get ( Footnotes_Settings :: REFERENCE_CONTAINER_LABEL_ELEMENT ),
'name' => empty ( $reference_container_label ) ? ' ' : $reference_container_label ,
'button-style' => ! $collapse_default ? 'display: none;' : '' ,
'style' => $collapse_default ? 'display: none;' : '' ,
'caption' => ( empty ( $reference_container_label ) || ' ' === $reference_container_label ) ? 'References' : $reference_container_label ,
'content' => $body ,
'scroll-offset' => $scroll_offset ,
'scroll-down-delay' => $scroll_down_delay ,
'scroll-down-duration' => $scroll_down_duration ,
'scroll-up-delay' => $scroll_up_delay ,
'scroll-up-duration' => $scroll_up_duration ,
2021-03-02 03:09:34 +00:00
)
);
2021-03-03 18:58:03 +00:00
// Free all found footnotes if reference container will be displayed.
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
self :: $footnotes = array ();
2021-03-02 03:09:34 +00:00
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
return $template_container -> get_content ();
2021-03-02 03:09:34 +00:00
}
}