development 2.1.4d3 bugfix, for sharing on Forum
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2426439 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
dacd29c7ca
commit
5a97dbb05a
11 changed files with 74 additions and 45 deletions
|
@ -207,7 +207,7 @@ abstract class MCI_Footnotes_LayoutEngine {
|
|||
'mci-footnotes-admin-styles',
|
||||
plugins_url('../../css/settings.css', __FILE__),
|
||||
'',
|
||||
'2.1.4d1'
|
||||
'2.1.4d2'
|
||||
);
|
||||
// UPDATE version # when making changes to settings.css, FOR CACHE BUSTING
|
||||
|
||||
|
|
|
@ -11,8 +11,9 @@
|
|||
* 2.1.0 2020-11-08T2148+0100
|
||||
* 2.1.1 2020-11-16T2152+0100
|
||||
* 2.1.3 2020-11-24T0955+0100
|
||||
* 2.1.4 2020-11-26T1052+0100
|
||||
*
|
||||
* Last modified: 2020-11-24T0955+0100
|
||||
* Last modified: 2020-11-26T1052+0100
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -89,9 +90,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
// Change string "%s styling" to "Footnotes styling" to fix layout in WPv5.5:
|
||||
$this->addMetaBox("settings", "styling", __("Footnotes styling", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Styling"),
|
||||
$this->addMetaBox("settings", "reference-container", __("References Container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "ReferenceContainer"),
|
||||
$this->addMetaBox("settings", "other", __("Other", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Other"),
|
||||
// Leave intact since this is not localized:
|
||||
$this->addMetaBox("settings", "love", MCI_Footnotes_Config::C_STR_PLUGIN_HEADING_NAME . ' ' . MCI_Footnotes_Config::C_STR_LOVE_SYMBOL_HEADING, "Love"),
|
||||
$this->addMetaBox("settings", "other", __("Other", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Other"),
|
||||
|
||||
// This is restored to meet user demand for arrow symbol semantics:
|
||||
$this->addMetaBox("customize", "hyperlink-arrow", __("Hyperlink symbol in the Reference container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "HyperlinkArrow"),
|
||||
|
@ -276,6 +277,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
// replace all placeholders
|
||||
$l_obj_Template->replace(
|
||||
array(
|
||||
"label-link" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED, __("Use the link element for referrers and backlinks", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"link" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED, $l_arr_Enabled),
|
||||
"label-excerpt" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_IN_EXCERPT, __("Allow footnotes on Summarized Posts", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"excerpt" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_IN_EXCERPT, $l_arr_Enabled),
|
||||
"label-expert-mode" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_EXPERT_MODE, __("Enable the Expert mode", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
|
@ -493,13 +496,11 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
$l_obj_Template->replace(
|
||||
array(
|
||||
|
||||
"description-1" => __("The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-2" => __("Default 9223372036854775807 is lowest priority, 0 is highest.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-3" => __("To restore default priority, set to -1, interpreted as 9223372036854775807, the constant PHP_INT_MAX.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-4" => __("For the reference container to sit above related posts, the priority level of the_content hook may need to be at most 1200.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-5" => __("For Footnotes to work when a glossary plugin is active, a higher priority of 1000 may be needed.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-6" => __("For the_content, another good pick with proven efficiency is priority level 10.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-7" => __("Usually only the_content should be enabled; widget_text may cause issues in accordions, the_title causes issues in browser tabs.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-1" => __("The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-2" => __("Default 9223372036854775807 is lowest priority, 0 is highest", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-3" => __("To restore default priority, set to -1, interpreted as 9223372036854775807, the constant PHP_INT_MAX", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-4" => __("For the_content, this figure needs to be lower than 1200 to make sure that a feature inserted by another plugin running at 1200 displays below the reference container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"description-5" => __("For Elementor accordions, the widget_text hook must be disabled", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"head-hook" => __("WordPress hook function name", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"head-checkbox" => __("Activate", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
|
|
@ -160,7 +160,7 @@ class MCI_Footnotes {
|
|||
'mci-footnotes-css-public',
|
||||
plugins_url('../css/public.css', __FILE__),
|
||||
'',
|
||||
'2.1.4d1'
|
||||
'2.1.4d2'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -373,7 +373,7 @@ class MCI_Footnotes_Settings {
|
|||
const C_STR_FOOTNOTES_TOOLTIP_READON_LABEL = "footnote_inputfield_readon_label";
|
||||
|
||||
/**
|
||||
* Settings Container Keys of options fixing default layout
|
||||
* Settings Container Keys for options fixing default layout
|
||||
*
|
||||
* @since 2.1.1
|
||||
* @var string
|
||||
|
@ -381,18 +381,37 @@ class MCI_Footnotes_Settings {
|
|||
* 2020-11-16T0859+0100
|
||||
*/
|
||||
const C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS = "footnotes_inputfield_referrer_superscript_tags";
|
||||
|
||||
const C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE = "footnotes_inputfield_reference_container_backlink_symbol_enable";
|
||||
const C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE = "footnotes_inputfield_reference_container_start_page_enable";
|
||||
const C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE = "footnotes_inputfield_reference_container_3column_layout_enable";
|
||||
const C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH = "footnotes_inputfield_reference_container_backlink_symbol_switch";
|
||||
|
||||
/**
|
||||
* Settings Container Keys for hook priority levels
|
||||
*
|
||||
* @since 2.1.1 (the_content)
|
||||
* @since 2.1.2
|
||||
* @var string
|
||||
*
|
||||
* 2020-11-16T0859+0100
|
||||
* 2020-11-20T0620+0100
|
||||
*/
|
||||
const C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_title_priority_level";
|
||||
const C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_content_priority_level";
|
||||
const C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_excerpt_priority_level";
|
||||
const C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_widget_title_priority_level";
|
||||
const C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_widget_text_priority_level";
|
||||
|
||||
/**
|
||||
* Settings Container Keys for the link element option
|
||||
*
|
||||
* @since 2.1.4
|
||||
* @var string
|
||||
*
|
||||
* 2020-11-26T1002+0100
|
||||
*/
|
||||
const C_BOOL_LINK_ELEMENT_ENABLED = "footnote_inputfield_link_element_enabled";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -434,6 +453,8 @@ class MCI_Footnotes_Settings {
|
|||
self::C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE => 'no',
|
||||
self::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH => 'no',
|
||||
|
||||
self::C_BOOL_LINK_ELEMENT_ENABLED => 'yes',
|
||||
|
||||
self::C_STR_FOOTNOTES_SHORT_CODE_START => '((',
|
||||
self::C_STR_FOOTNOTES_SHORT_CODE_END => '))',
|
||||
self::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED => '',
|
||||
|
|
|
@ -18,8 +18,9 @@
|
|||
* 2.1.1: option fixing ref container relative position 2020-11-17T0254+0100
|
||||
* 2.1.2: options for the other hooks 2020-11-19T1849+0100
|
||||
* 2.1.4: fix line wrapping of URLs based on pattern, not link element 2020-11-25T0837+0100
|
||||
* 2.1.4: fix issues with link elements by making them optional 2020-11-26T1051+0100
|
||||
*
|
||||
* Last modified: 2020-11-26T0036+0100
|
||||
* Last modified: 2020-11-26T1051+0100
|
||||
*/
|
||||
|
||||
// If called directly, abort:
|
||||
|
@ -484,16 +485,17 @@ class MCI_Footnotes_Task {
|
|||
$l_str_SupSpan = 'span';
|
||||
}
|
||||
|
||||
// determine whether the link element is used, see below
|
||||
|
||||
|
||||
// determine whether the link element is used, see below in ReferenceContainer()
|
||||
$l_str_LinkSpan = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED)) ? 'a' : 'span';
|
||||
|
||||
|
||||
// fill in 'templates/public/footnote.html':
|
||||
$l_obj_Template->replace(
|
||||
array(
|
||||
"post_id" => $l_int_PostId,
|
||||
"id" => $l_int_Index,
|
||||
"link-start" => '<a>',
|
||||
"link-end" => '</a>',
|
||||
"link-start" => $l_str_LinkSpan == 'a' ? '<a>' : '',
|
||||
"link-end" => $l_str_LinkSpan == 'a' ? '</a>' : '',
|
||||
"sup-span" => $l_str_SupSpan,
|
||||
"before" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE),
|
||||
"index" => $l_int_Index,
|
||||
|
@ -563,7 +565,7 @@ class MCI_Footnotes_Task {
|
|||
|
||||
/**
|
||||
* INFINITE SCROLL / AUTOLOAD, ARCHIVE VIEW
|
||||
*
|
||||
*
|
||||
* Multiple posts are appended to each other, functions and IDs must be disambiguated.
|
||||
* Contributed by @docteurfitness <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
|
||||
* @since 2.0.5
|
||||
|
@ -576,7 +578,7 @@ class MCI_Footnotes_Task {
|
|||
|
||||
/**
|
||||
* OPTIONAL LINK ELEMENT FOR FOOTNOTE REFERRERS AND BACKLINKS
|
||||
*
|
||||
*
|
||||
* STYLING:
|
||||
* Link color is preferred for referrers and backlinks.
|
||||
* Setting a global link color is a common feature in WordPress themes.
|
||||
|
@ -585,23 +587,22 @@ class MCI_Footnotes_Task {
|
|||
* Hence the link element must be present for styling purposes.
|
||||
* But styling these elements with the link color is not universally preferred.
|
||||
* If not, the very presence of the link elements may need to be avoided.
|
||||
*
|
||||
*
|
||||
* FUNCTIONALITY:
|
||||
* 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.
|
||||
*
|
||||
*
|
||||
* The link elements have been added and are present @since 2.0.0.
|
||||
* Then the link addresses were removed @since 2.0.4.
|
||||
* Then the presence of <a> elements was made optional
|
||||
* @since 2.1.4
|
||||
* 2020-11-25T1306+0100
|
||||
*/
|
||||
$l_str_LinkSpan = true ? 'a' : 'span';
|
||||
// in progress ##############################################
|
||||
|
||||
|
||||
$l_str_LinkSpan = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED)) ? 'a' : 'span';
|
||||
|
||||
|
||||
// FOOTNOTE INDEX BACKLINK SYMBOL
|
||||
|
||||
// check if arrow is enabled:
|
||||
|
@ -767,7 +768,7 @@ class MCI_Footnotes_Task {
|
|||
|
||||
// line wrapping of URLs already fixed, see:
|
||||
// $l_str_FootnoteText = preg_replace( '#(?<!href=.)(https?://[^\\s<]+)#', '<span class="footnote_url_wrap">$1</span>', $l_str_FootnoteText );
|
||||
|
||||
|
||||
// replace all placeholders in 'templates/public/reference-container-body.html'
|
||||
// or in 'templates/public/reference-container-body-combi.html'
|
||||
// or in 'templates/public/reference-container-body-3column.html'
|
||||
|
|
Reference in a new issue