development 2.4.0d0 needed for support

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2449533 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2021-01-03 20:03:51 +00:00
parent 0879535bb4
commit 82cb6d5268
11 changed files with 69 additions and 47 deletions

View file

@ -6,16 +6,18 @@
* @author Stefan Herndler
* @since 1.5.0 14.09.14 10:58
*
* Last modified: 2021-01-02T2352+0100
*
* Edited:
* @since 2.0.3 prettify reference container template
* @since 2.0.3 further minify template content
* @since 2.0.4 regex to delete multiple spaces
*
* @since 2.0.6 prettify other templates (footnote, tooltip script, ref container row)
* @since 2.2.6 delete a space before a closing pointy bracket
* @since 2.2.6 support for custom templates in fixed location, while failing to add filter thanks to @misfist 2020-12-19T0606+0100
* @see <https://wordpress.org/support/topic/template-override-filter/>
* @since 2.3.1 templates may be in active theme, thanks to @misfist
* @since 2.4.0 templates may be in active theme, thanks to @misfist
* @see <https://wordpress.org/support/topic/template-override-filter/#post-13846598>
*
* Last modified: 2021-01-01T2246+0100
*/
@ -80,9 +82,9 @@ class MCI_Footnotes_Template {
* @since 2.2.6 support for custom templates 2020-12-19T0606+0100
* @see <https://wordpress.org/support/topic/template-override-filter/>
*
* @since 2.2.6 regex to delete a space before a closing pointy bracket
* @since 2.2.6 delete a space before a closing pointy bracket
*
* @since 2.3.1 look for custom template in the active theme first, thanks to @misfist
* @since 2.4.0 look for custom template in the active theme first, thanks to @misfist
* @see <https://wordpress.org/support/topic/template-override-filter/#post-13846598>
*/
public function __construct($p_str_FileType, $p_str_FileName, $p_str_Extension = "html") {
@ -95,6 +97,7 @@ class MCI_Footnotes_Template {
$l_str_TemplateFile = dirname(__FILE__) . "/../../../themes/";
// get active theme dir name (parent theme unlikely to contain custom templates):
// see <https://wordpress.stackexchange.com/questions/220942/how-to-get-the-active-themes-slug>
// returns the stylesheets folder name, not the actual style sheet:
$l_str_TemplateFile .= get_stylesheet();
$l_str_TemplateFile .= "/templates/footnotes/" . $p_str_FileName . "." . $p_str_Extension;
@ -116,7 +119,7 @@ class MCI_Footnotes_Template {
}
}
// minify template to some extent:
// minify template content to some extent:
// get Template file content
$this->a_str_OriginalContent = str_replace("\n", "", file_get_contents($l_str_TemplateFile));
$this->a_str_OriginalContent = str_replace("\r", "", $this->a_str_OriginalContent);