development 2.3.1d2 (correct) for forum

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2448967 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2021-01-01 21:59:05 +00:00
parent 3096e8f3b4
commit 0879535bb4
3 changed files with 19 additions and 14 deletions

View file

@ -15,7 +15,7 @@
* @since 2.3.1 templates may be in active theme, thanks to @misfist
* @see <https://wordpress.org/support/topic/template-override-filter/#post-13846598>
*
* Last modified: 2021-01-01T2214+0100
* Last modified: 2021-01-01T2246+0100
*/
@ -82,8 +82,8 @@ class MCI_Footnotes_Template {
*
* @since 2.2.6 regex to delete a space before a closing pointy bracket
*
* @since 2.3.1 look for custom template in the active theme
* @see <https://wordpress.stackexchange.com/questions/220942/how-to-get-the-active-themes-slug>
* @since 2.3.1 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") {
// no template file type and/or file name set
@ -91,17 +91,17 @@ class MCI_Footnotes_Template {
return;
}
// First look for a custom template in a 'footnotes-custom' sibling folder:
$l_str_TemplateFile = dirname(__FILE__) . "/../../footnotes-custom/templates/" . $p_str_FileType . "/" . $p_str_FileName . "." . $p_str_Extension;
// First try to load the template from the active theme in 'templates/footnotes/':
$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>
$l_str_TemplateFile .= get_stylesheet();
$l_str_TemplateFile .= "/templates/footnotes/" . $p_str_FileName . "." . $p_str_Extension;
// else load template from the active theme:
// else look for a custom template in a 'footnotes-custom' sibling folder:
if (!file_exists($l_str_TemplateFile)) {
$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>
$l_str_TemplateFile .= get_stylesheet();
$l_str_TemplateFile .= "/templates/footnotes/" . $p_str_FileName . "." . $p_str_Extension;
$l_str_TemplateFile = dirname(__FILE__) . "/../../footnotes-custom/templates/" . $p_str_FileType . "/" . $p_str_FileName . "." . $p_str_Extension;
// else load internal template:
if (!file_exists($l_str_TemplateFile)) {

View file

@ -4,12 +4,12 @@
Plugin URI: https://wordpress.org/plugins/footnotes/
Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
Author: Mark Cheret
Version: 2.3.1d1
Version: 2.3.1d2
Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes
Domain Path: /languages
*/
define( 'FOOTNOTES_VERSION', '2.3.1d1' );
define( 'FOOTNOTES_VERSION', '2.3.1d2' );
/*
Copyright 2020 Mark Cheret (email: mark@cheret.de)

View file

@ -1,6 +1,6 @@
note-for-developers.txt
2020-12-19T0609+0100
Last modified: 2021-01-01T2212+0100
Last modified: 2021-01-01T2249+0100
Footnotes plugin for WordPress, v2.2.6 and later
@ -12,6 +12,11 @@ Since v2.2.6, Footnotes supports custom templates.
Custom templates may be loaded from a sibling folder 'footnotes-custom'
or since v2.3.1 from a folder 'templates/footnotes/' in the active theme.
Priority order:
1. active theme
2. sibling folder
3. internal
See footnotes/class/template.php:67..116