refactor: run Rector CODE_QUALITY rulesets

Fix #168
This commit is contained in:
Ben Goldsworthy 2021-05-02 10:45:52 +01:00
parent 4299a71df5
commit 1728e0fcd5
9 changed files with 523 additions and 502 deletions

View file

@ -286,11 +286,11 @@ class Parser {
*/
public function register_hooks() {
// Get values from settings.
$l_int_the_title_priority = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL ) );
$l_int_the_content_priority = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL ) );
$l_int_the_excerpt_priority = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL ) );
$l_int_widget_title_priority = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL ) );
$l_int_widget_text_priority = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL ) );
$l_int_the_title_priority = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL );
$l_int_the_content_priority = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL );
$l_int_the_excerpt_priority = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL );
$l_int_widget_title_priority = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL );
$l_int_widget_text_priority = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL );
// PHP_INT_MAX can be set by -1.
$l_int_the_title_priority = ( -1 === $l_int_the_title_priority ) ? PHP_INT_MAX : $l_int_the_title_priority;
@ -300,18 +300,42 @@ class Parser {
$l_int_widget_text_priority = ( -1 === $l_int_widget_text_priority ) ? PHP_INT_MAX : $l_int_widget_text_priority;
// Append custom css to the header.
add_filter( 'wp_head', array( $this, 'footnotes_output_head' ), PHP_INT_MAX );
add_filter(
'wp_head',
function () {
return $this->footnotes_output_head();
},
PHP_INT_MAX
);
// Append the love and share me slug to the footer.
add_filter( 'wp_footer', array( $this, 'footnotes_output_footer' ), PHP_INT_MAX );
add_filter(
'wp_footer',
function () {
return $this->footnotes_output_footer();
},
PHP_INT_MAX
);
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_TITLE ) ) ) {
add_filter( 'the_title', array( $this, 'footnotes_in_title' ), $l_int_the_title_priority );
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_EXPERT_LOOKUP_THE_TITLE ) ) ) {
add_filter(
'the_title',
function ( string $p_str_content ) : string {
return $this->footnotes_in_title( $p_str_content );
},
$l_int_the_title_priority
);
}
// Configurable priority level for reference container relative positioning; default 98.
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_CONTENT ) ) ) {
add_filter( 'the_content', array( $this, 'footnotes_in_content' ), $l_int_the_content_priority );
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_EXPERT_LOOKUP_THE_CONTENT ) ) ) {
add_filter(
'the_content',
function ( string $p_str_content ) : string {
return $this->footnotes_in_content( $p_str_content );
},
$l_int_the_content_priority
);
/**
* Hook for category pages.
@ -325,7 +349,13 @@ class Parser {
*
* @since 2.5.0
*/
add_filter( 'term_description', array( $this, 'footnotes_in_content' ), $l_int_the_content_priority );
add_filter(
'term_description',
function ( string $p_str_content ) : string {
return $this->footnotes_in_content( $p_str_content );
},
$l_int_the_content_priority
);
/**
* Hook for popup maker popups.
@ -337,10 +367,16 @@ class Parser {
*
* @since 2.5.1
*/
add_filter( 'pum_popup_content', array( $this, 'footnotes_in_content' ), $l_int_the_content_priority );
add_filter(
'pum_popup_content',
function ( string $p_str_content ) : string {
return $this->footnotes_in_content( $p_str_content );
},
$l_int_the_content_priority
);
}
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_EXPERT_LOOKUP_THE_EXCERPT ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_EXPERT_LOOKUP_THE_EXCERPT ) ) ) {
/**
* Adds a filter to the excerpt hook.
*
@ -349,21 +385,39 @@ class Parser {
* @since 2.6.2 The hook @see 'get_the_excerpt' is readded when attempting to debug excerpt handling.
* @since 2.6.6 The hook @see 'get_the_excerpt' is removed again because it seems to cause issues in some themes.
*/
add_filter( 'the_excerpt', array( $this, 'footnotes_in_excerpt' ), $l_int_the_excerpt_priority );
add_filter(
'the_excerpt',
function ( string $p_str_excerpt ) : string {
return $this->footnotes_in_excerpt( $p_str_excerpt );
},
$l_int_the_excerpt_priority
);
}
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_EXPERT_LOOKUP_WIDGET_TITLE ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_EXPERT_LOOKUP_WIDGET_TITLE ) ) ) {
/**
* TODO
*/
add_filter( 'widget_title', array( $this, 'footnotes_in_widget_title' ), $l_int_widget_title_priority );
add_filter(
'widget_title',
function ( string $p_str_content ) : string {
return $this->footnotes_in_widget_title( $p_str_content );
},
$l_int_widget_title_priority
);
}
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_EXPERT_LOOKUP_WIDGET_TEXT ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_EXPERT_LOOKUP_WIDGET_TEXT ) ) ) {
/**
* TODO
*/
add_filter( 'widget_text', array( $this, 'footnotes_in_widget_text' ), $l_int_widget_text_priority );
add_filter(
'widget_text',
function ( string $p_str_content ) : string {
return $this->footnotes_in_widget_text( $p_str_content );
},
$l_int_widget_text_priority
);
}
// Reset stored footnotes when displaying the header.
@ -387,7 +441,7 @@ class Parser {
*
* Native smooth scrolling only works in recent browsers.
*/
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_CSS_SMOOTH_SCROLLING ) ) ) {
echo "html {scroll-behavior: smooth;}\r\n";
}
@ -397,7 +451,7 @@ class Parser {
* Cannot be included in external stylesheet, as it is only optional.
* The scope is variable too: referrers only, or all superscript elements.
*/
$l_str_normalize_superscript = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT );
$l_str_normalize_superscript = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTE_REFERRERS_NORMAL_SUPERSCRIPT );
if ( 'no' !== $l_str_normalize_superscript ) {
if ( 'all' === $l_str_normalize_superscript ) {
echo 'sup {';
@ -408,14 +462,14 @@ class Parser {
}
// Reference container display on home page.
if ( ! Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE ) ) ) {
if ( ! Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE ) ) ) {
echo ".home .footnotes_reference_container { display: none; }\r\n";
}
// Reference container top and bottom margins.
$l_int_reference_container_top_margin = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_REFERENCE_CONTAINER_TOP_MARGIN ) );
$l_int_reference_container_bottom_margin = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_REFERENCE_CONTAINER_BOTTOM_MARGIN ) );
$l_int_reference_container_top_margin = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_REFERENCE_CONTAINER_TOP_MARGIN );
$l_int_reference_container_bottom_margin = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_REFERENCE_CONTAINER_BOTTOM_MARGIN );
echo '.footnotes_reference_container {margin-top: ';
echo empty( $l_int_reference_container_top_margin ) ? '0' : $l_int_reference_container_top_margin;
echo 'px !important; margin-bottom: ';
@ -423,9 +477,9 @@ class Parser {
echo "px !important;}\r\n";
// Reference container label bottom border.
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER ) ) ) {
echo '.footnote_container_prepare > ';
echo Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT );
echo Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT );
echo " {border-bottom: 1px solid #aaaaaa !important;}\r\n";
}
@ -438,7 +492,7 @@ class Parser {
* issues as browsers wont reload these style sheets after settings are
* changed while the version string is not.
*/
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_ROW_BORDERS_ENABLE ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_ROW_BORDERS_ENABLE ) ) ) {
echo '.footnotes_table, .footnotes_plugin_reference_row {';
echo 'border: 1px solid #060606;';
echo " !important;}\r\n";
@ -448,22 +502,20 @@ class Parser {
}
// Ref container first column width and max-width.
$l_bool_column_width_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED ) );
$l_bool_column_max_width_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED ) );
$l_bool_column_width_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_COLUMN_WIDTH_ENABLED ) );
$l_bool_column_max_width_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED ) );
if ( $l_bool_column_width_enabled || $l_bool_column_max_width_enabled ) {
echo '.footnote-reference-container { table-layout: fixed; }';
echo '.footnote_plugin_index, .footnote_plugin_index_combi {';
if ( $l_bool_column_width_enabled ) {
$l_int_column_width_scalar = Includes\Settings::instance()->get( Includes\Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR );
$l_str_column_width_unit = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT );
$l_int_column_width_scalar = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR );
$l_str_column_width_unit = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT );
if ( ! empty( $l_int_column_width_scalar ) ) {
if ( '%' === $l_str_column_width_unit ) {
if ( $l_int_column_width_scalar > 100 ) {
$l_int_column_width_scalar = 100;
}
if ( '%' === $l_str_column_width_unit && $l_int_column_width_scalar > 100 ) {
$l_int_column_width_scalar = 100;
}
} else {
$l_int_column_width_scalar = 0;
@ -473,14 +525,12 @@ class Parser {
}
if ( $l_bool_column_max_width_enabled ) {
$l_int_column_max_width_scalar = Includes\Settings::instance()->get( Includes\Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR );
$l_str_column_max_width_unit = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT );
$l_int_column_max_width_scalar = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR );
$l_str_column_max_width_unit = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT );
if ( ! empty( $l_int_column_max_width_scalar ) ) {
if ( '%' === $l_str_column_max_width_unit ) {
if ( $l_int_column_max_width_scalar > 100 ) {
$l_int_column_max_width_scalar = 100;
}
if ( '%' === $l_str_column_max_width_unit && $l_int_column_max_width_scalar > 100 ) {
$l_int_column_max_width_scalar = 100;
}
} else {
$l_int_column_max_width_scalar = 0;
@ -493,14 +543,14 @@ class Parser {
}
// Hard links scroll offset.
self::$a_bool_hard_links_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_HARD_LINKS_ENABLE ) );
self::$a_bool_hard_links_enabled = Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_HARD_LINKS_ENABLE ) );
// Correct hard links enabled status depending on AMP-compatible or alternative reference container enabled status.
if ( General::$a_bool_amp_enabled || 'jquery' !== General::$a_str_script_mode ) {
self::$a_bool_hard_links_enabled = true;
}
self::$a_int_scroll_offset = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_OFFSET ) );
self::$a_int_scroll_offset = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_SCROLL_OFFSET );
if ( self::$a_bool_hard_links_enabled ) {
echo '.footnote_referrer_anchor, .footnote_item_anchor {bottom: ';
echo self::$a_int_scroll_offset;
@ -513,46 +563,46 @@ class Parser {
// Tooltip appearance: Tooltip font size.
echo ' font-size: ';
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED ) ) ) {
echo Includes\Settings::instance()->get( Includes\Settings::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR );
echo Includes\Settings::instance()->get( Includes\Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT );
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_ENABLED ) ) ) {
echo Includes\Settings::instance()->get( \footnotes\includes\Settings::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR );
echo Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT );
} else {
echo 'inherit';
}
echo ' !important;';
// Tooltip Text color.
$l_str_color = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR );
$l_str_color = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR );
if ( ! empty( $l_str_color ) ) {
printf( ' color: %s !important;', $l_str_color );
}
// Tooltip Background color.
$l_str_background = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND );
$l_str_background = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND );
if ( ! empty( $l_str_background ) ) {
printf( ' background-color: %s !important;', $l_str_background );
}
// Tooltip Border width.
$l_int_border_width = Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH );
if ( ! empty( $l_int_border_width ) && intval( $l_int_border_width ) > 0 ) {
$l_int_border_width = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH );
if ( ! empty( $l_int_border_width ) && (int) $l_int_border_width > 0 ) {
printf( ' border-width: %dpx !important; border-style: solid !important;', $l_int_border_width );
}
// Tooltip Border color.
$l_str_border_color = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR );
$l_str_border_color = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR );
if ( ! empty( $l_str_border_color ) ) {
printf( ' border-color: %s !important;', $l_str_border_color );
}
// Tooltip Corner radius.
$l_int_border_radius = Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS );
if ( ! empty( $l_int_border_radius ) && intval( $l_int_border_radius ) > 0 ) {
$l_int_border_radius = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS );
if ( ! empty( $l_int_border_radius ) && (int) $l_int_border_radius > 0 ) {
printf( ' border-radius: %dpx !important;', $l_int_border_radius );
}
// Tooltip Shadow color.
$l_str_box_shadow_color = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR );
$l_str_box_shadow_color = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR );
if ( ! empty( $l_str_box_shadow_color ) ) {
printf( ' -webkit-box-shadow: 2px 2px 11px %s;', $l_str_box_shadow_color );
printf( ' -moz-box-shadow: 2px 2px 11px %s;', $l_str_box_shadow_color );
@ -566,8 +616,8 @@ class Parser {
*
* Position and timing of jQuery tooltips are script-defined.
*/
$l_int_max_width = Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH );
if ( ! empty( $l_int_max_width ) && intval( $l_int_max_width ) > 0 ) {
$l_int_max_width = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH );
if ( ! empty( $l_int_max_width ) && (int) $l_int_max_width > 0 ) {
printf( ' max-width: %dpx !important;', $l_int_max_width );
}
echo "}\r\n";
@ -577,7 +627,7 @@ class Parser {
echo "}\r\n";
// Dimensions.
$l_int_alternative_tooltip_width = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH ) );
$l_int_alternative_tooltip_width = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH );
echo '.footnote_tooltip.position {';
echo ' width: max-content; ';
@ -585,33 +635,33 @@ class Parser {
echo ' max-width: ' . $l_int_alternative_tooltip_width . 'px;';
// Position.
$l_str_alternative_position = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION );
$l_int_offset_x = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X ) );
$l_str_alternative_position = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION );
$l_int_offset_x = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X );
if ( 'top left' === $l_str_alternative_position || 'bottom left' === $l_str_alternative_position ) {
echo ' right: ' . ( ! empty( $l_int_offset_x ) ? $l_int_offset_x : 0 ) . 'px;';
echo ' right: ' . ( empty( $l_int_offset_x ) ? 0 : $l_int_offset_x ) . 'px;';
} else {
echo ' left: ' . ( ! empty( $l_int_offset_x ) ? $l_int_offset_x : 0 ) . 'px;';
echo ' left: ' . ( empty( $l_int_offset_x ) ? 0 : $l_int_offset_x ) . 'px;';
}
$l_int_offset_y = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y ) );
$l_int_offset_y = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y );
if ( 'top left' === $l_str_alternative_position || 'top right' === $l_str_alternative_position ) {
echo ' bottom: ' . ( ! empty( $l_int_offset_y ) ? $l_int_offset_y : 0 ) . 'px;';
echo ' bottom: ' . ( empty( $l_int_offset_y ) ? 0 : $l_int_offset_y ) . 'px;';
} else {
echo ' top: ' . ( ! empty( $l_int_offset_y ) ? $l_int_offset_y : 0 ) . 'px;';
echo ' top: ' . ( empty( $l_int_offset_y ) ? 0 : $l_int_offset_y ) . 'px;';
}
echo "}\r\n";
// Timing.
$l_int_fade_in_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY ) );
$l_int_fade_in_delay = ! empty( $l_int_fade_in_delay ) ? $l_int_fade_in_delay : '0';
$l_int_fade_in_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION ) );
$l_int_fade_in_duration = ! empty( $l_int_fade_in_duration ) ? $l_int_fade_in_duration : '0';
$l_int_fade_out_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY ) );
$l_int_fade_out_delay = ! empty( $l_int_fade_out_delay ) ? $l_int_fade_out_delay : '0';
$l_int_fade_out_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION ) );
$l_int_fade_out_duration = ! empty( $l_int_fade_out_duration ) ? $l_int_fade_out_duration : '0';
$l_int_fade_in_delay = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY );
$l_int_fade_in_delay = empty( $l_int_fade_in_delay ) ? '0' : $l_int_fade_in_delay;
$l_int_fade_in_duration = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION );
$l_int_fade_in_duration = empty( $l_int_fade_in_duration ) ? '0' : $l_int_fade_in_duration;
$l_int_fade_out_delay = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY );
$l_int_fade_out_delay = empty( $l_int_fade_out_delay ) ? '0' : $l_int_fade_out_delay;
$l_int_fade_out_duration = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION );
$l_int_fade_out_duration = empty( $l_int_fade_out_duration ) ? '0' : $l_int_fade_out_duration;
/*
* AMP-compatible tooltips.
@ -656,11 +706,11 @@ class Parser {
* Set custom CSS to override settings, not conversely.
* Legacy Custom CSS is used until its set to disappear after dashboard tab migration.
*/
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE ) ) ) {
echo Includes\Settings::instance()->get( Includes\Settings::C_STR_CUSTOM_CSS );
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_CUSTOM_CSS_LEGACY_ENABLE ) ) ) {
echo Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_CUSTOM_CSS );
echo "\r\n";
}
echo Includes\Settings::instance()->get( Includes\Settings::C_STR_CUSTOM_CSS_NEW );
echo Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_CUSTOM_CSS_NEW );
// Insert end tag without switching out of PHP.
echo "\r\n</style>\r\n";
@ -697,17 +747,17 @@ class Parser {
* @since 1.5.0
*/
public function footnotes_output_footer() {
if ( 'footer' === Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ) {
if ( 'footer' === Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ) {
echo $this->reference_container();
}
// Get setting for love and share this plugin.
$l_str_love_me_index = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_LOVE );
$l_str_love_me_index = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_LOVE );
// Check if the admin allows to add a link to the footer.
if ( empty( $l_str_love_me_index ) || 'no' === strtolower( $l_str_love_me_index ) || ! self::$a_bool_allow_love_me ) {
return;
}
// Set a hyperlink to the word "footnotes" in the Love slug.
$l_str_linked_name = sprintf( '<a href="https://wordpress.org/plugins/footnotes/" target="_blank" style="text-decoration:none;">%s</a>', Includes\Config::C_STR_PLUGIN_PUBLIC_NAME );
$l_str_linked_name = sprintf( '<a href="https://wordpress.org/plugins/footnotes/" target="_blank" style="text-decoration:none;">%s</a>', \footnotes\includes\Config::C_STR_PLUGIN_PUBLIC_NAME );
// Get random love me text.
if ( 'random' === strtolower( $l_str_love_me_index ) ) {
$l_str_love_me_index = 'text-' . wp_rand( 1, 7 );
@ -716,7 +766,7 @@ class Parser {
// Options named wrt backcompat, simplest is default.
case 'text-1':
/* Translators: 2: Link to plugin page 1: Love heart symbol */
$l_str_love_me_text = sprintf( __( 'I %2$s %1$s', 'footnotes' ), $l_str_linked_name, Includes\Config::C_STR_LOVE_SYMBOL );
$l_str_love_me_text = sprintf( __( 'I %2$s %1$s', 'footnotes' ), $l_str_linked_name, \footnotes\includes\Config::C_STR_LOVE_SYMBOL );
break;
case 'text-2':
/* Translators: %s: Link to plugin page */
@ -724,11 +774,11 @@ class Parser {
break;
case 'text-4':
/* Translators: 1: Link to plugin page 2: Love heart symbol */
$l_str_love_me_text = sprintf( '%1$s %2$s', $l_str_linked_name, Includes\Config::C_STR_LOVE_SYMBOL );
$l_str_love_me_text = sprintf( '%1$s %2$s', $l_str_linked_name, \footnotes\includes\Config::C_STR_LOVE_SYMBOL );
break;
case 'text-5':
/* Translators: 1: Love heart symbol 2: Link to plugin page */
$l_str_love_me_text = sprintf( '%1$s %2$s', Includes\Config::C_STR_LOVE_SYMBOL, $l_str_linked_name );
$l_str_love_me_text = sprintf( '%1$s %2$s', \footnotes\includes\Config::C_STR_LOVE_SYMBOL, $l_str_linked_name );
break;
case 'text-6':
/* Translators: %s: Link to plugin page */
@ -741,7 +791,7 @@ class Parser {
case 'text-3':
default:
/* Translators: %s: Link to plugin page */
$l_str_love_me_text = sprintf( '%s', $l_str_linked_name );
$l_str_love_me_text = $l_str_linked_name;
break;
}
echo sprintf( '<div style="text-align:center; color:#acacac;">%s</div>', $l_str_love_me_text );
@ -770,8 +820,8 @@ class Parser {
*/
public function footnotes_in_content( $p_str_content ) {
$l_str_ref_container_position = Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION );
$l_str_footnote_section_shortcode = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTE_SECTION_SHORTCODE );
$l_str_ref_container_position = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION );
$l_str_footnote_section_shortcode = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTE_SECTION_SHORTCODE );
$l_int_footnote_section_shortcode_length = strlen( $l_str_footnote_section_shortcode );
if ( strpos( $p_str_content, $l_str_footnote_section_shortcode ) === false ) {
@ -815,7 +865,7 @@ class Parser {
* @return string $p_str_excerpt Processed or new excerpt.
*/
public function footnotes_in_excerpt( $p_str_excerpt ) {
$l_str_excerpt_mode = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_IN_EXCERPT );
$l_str_excerpt_mode = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_IN_EXCERPT );
if ( 'yes' === $l_str_excerpt_mode ) {
return $this->generate_excerpt_with_footnotes( $p_str_excerpt );
@ -1003,7 +1053,7 @@ class Parser {
public function footnotes_in_widget_text( $p_str_content ) {
// phpcs:disable WordPress.PHP.YodaConditions.NotYoda
// Appends the reference container if set to "post_end".
return $this->exec( $p_str_content, 'post_end' === Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ? true : false );
return $this->exec( $p_str_content, 'post_end' === Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION ) );
// phpcs:enable WordPress.PHP.YodaConditions.NotYoda
}
@ -1027,7 +1077,7 @@ class Parser {
*/
// Append the reference container or insert at shortcode.
$l_str_reference_container_position_shortcode = Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE );
$l_str_reference_container_position_shortcode = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE );
if ( empty( $l_str_reference_container_position_shortcode ) ) {
$l_str_reference_container_position_shortcode = '[[references]]';
}
@ -1052,9 +1102,9 @@ class Parser {
$p_str_content = str_replace( $l_str_reference_container_position_shortcode, '', $p_str_content );
// Take a look if the LOVE ME slug should NOT be displayed on this page/post, remove the short code if found.
if ( strpos( $p_str_content, Includes\Config::C_STR_NO_LOVE_SLUG ) ) {
if ( strpos( $p_str_content, \footnotes\includes\Config::C_STR_NO_LOVE_SLUG ) ) {
self::$a_bool_allow_love_me = false;
$p_str_content = str_replace( Includes\Config::C_STR_NO_LOVE_SLUG, '', $p_str_content );
$p_str_content = str_replace( \footnotes\includes\Config::C_STR_NO_LOVE_SLUG, '', $p_str_content );
}
// Return the content with replaced footnotes and optional reference container appended.
return $p_str_content;
@ -1075,11 +1125,11 @@ class Parser {
public function unify_delimiters( $p_str_content ) {
// Get footnotes start and end tag short codes.
$l_str_starting_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
$l_str_ending_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
$l_str_starting_tag = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
$l_str_ending_tag = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
if ( 'userdefined' === $l_str_starting_tag || 'userdefined' === $l_str_ending_tag ) {
$l_str_starting_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
$l_str_ending_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
$l_str_starting_tag = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
$l_str_ending_tag = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
}
// If any footnotes short code is empty, return the content without changes.
@ -1152,7 +1202,7 @@ class Parser {
*/
// If enabled.
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTE_SHORTCODE_SYNTAX_VALIDATION_ENABLE ) ) ) {
// Apply different regex depending on whether start shortcode is double/triple opening parenthesis.
if ( '((' === self::$a_str_start_tag || '(((' === self::$a_str_start_tag ) {
@ -1221,7 +1271,7 @@ class Parser {
} while ( preg_match( $l_str_value_regex, $p_str_content ) );
// Optionally moves footnotes outside at the end of the label element.
$l_str_label_issue_solution = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION );
$l_str_label_issue_solution = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_LABEL_ISSUE_SOLUTION );
if ( 'move' === $l_str_label_issue_solution ) {
@ -1292,29 +1342,29 @@ class Parser {
if ( General::$a_bool_amp_enabled ) {
// Whether first clicking a referrer needs to expand the reference container.
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
// Load 'public/partials/amp-footnote-expand.html'.
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-footnote-expand' );
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'amp-footnote-expand' );
} else {
// Load 'public/partials/amp-footnote.html'.
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-footnote' );
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'amp-footnote' );
}
} elseif ( General::$a_bool_alternative_tooltips_enabled ) {
// Load 'public/partials/footnote-alternative.html'.
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'footnote-alternative' );
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'footnote-alternative' );
// Else jQuery tooltips are enabled.
} else {
// Load 'public/partials/footnote.html'.
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'footnote' );
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'footnote' );
// Load tooltip inline script.
$l_obj_template_tooltip = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'tooltip' );
$l_obj_template_tooltip = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'tooltip' );
}
}
@ -1343,15 +1393,11 @@ class Parser {
$l_str_footnote_text = substr( $p_str_content, $l_int_pos_start + strlen( self::$a_str_start_tag ), $l_int_length - strlen( self::$a_str_start_tag ) );
// Get tooltip text if present.
self::$a_str_tooltip_shortcode = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER );
self::$a_str_tooltip_shortcode = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_DELIMITER );
self::$a_int_tooltip_shortcode_length = strlen( self::$a_str_tooltip_shortcode );
$l_int_tooltip_text_length = strpos( $l_str_footnote_text, self::$a_str_tooltip_shortcode );
$l_bool_has_tooltip_text = ! $l_int_tooltip_text_length ? false : true;
if ( $l_bool_has_tooltip_text ) {
$l_str_tooltip_text = substr( $l_str_footnote_text, 0, $l_int_tooltip_text_length );
} else {
$l_str_tooltip_text = '';
}
$l_bool_has_tooltip_text = (bool) $l_int_tooltip_text_length;
$l_str_tooltip_text = $l_bool_has_tooltip_text ? substr( $l_str_footnote_text, 0, $l_int_tooltip_text_length ) : '';
/*
* URL line wrapping for Unicode non conformant browsers.
@ -1371,7 +1417,7 @@ class Parser {
*
* TODO: Split into own method.
*/
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTE_URL_WRAP_ENABLED ) ) ) {
$l_str_footnote_text = preg_replace(
'#(?<![-\w\.!~\*\'\(\);]=[\'"])(?<![-\w\.!~\*\'\(\);]=[\'"] )(?<![-\w\.!~\*\'\(\);]=[\'"] )(?<![-\w\.!~\*\'\(\);]=)(?<!/)((ht|f)tps?://[^\\s<]+)#',
@ -1387,9 +1433,9 @@ class Parser {
if ( self::$a_bool_hard_links_enabled ) {
// Get the configurable parts.
self::$a_str_referrer_link_slug = Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERRER_FRAGMENT_ID_SLUG );
self::$a_str_footnote_link_slug = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG );
self::$a_str_link_ids_separator = Includes\Settings::instance()->get( Includes\Settings::C_STR_HARD_LINK_IDS_SEPARATOR );
self::$a_str_referrer_link_slug = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERRER_FRAGMENT_ID_SLUG );
self::$a_str_footnote_link_slug = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTE_FRAGMENT_ID_SLUG );
self::$a_str_link_ids_separator = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_HARD_LINK_IDS_SEPARATOR );
// Streamline ID concatenation.
self::$a_str_post_container_id_compound = self::$a_str_link_ids_separator;
@ -1402,11 +1448,11 @@ class Parser {
// Display the footnote referrers and the tooltips.
if ( ! $p_bool_hide_footnotes_text ) {
$l_int_index = Includes\Convert::index( $l_int_footnote_index, Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
$l_int_index = Includes\Convert::index( $l_int_footnote_index, Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
// Display only a truncated footnote text if option enabled.
$l_bool_enable_excerpt = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED ) );
$l_int_max_length = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH ) );
$l_bool_enable_excerpt = Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED ) );
$l_int_max_length = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH );
// Define excerpt text as footnote text by default.
$l_str_excerpt_text = $l_str_footnote_text;
@ -1432,7 +1478,7 @@ class Parser {
if ( General::$a_bool_amp_enabled ) {
// If the reference container is also collapsed by default.
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
$l_str_excerpt_text .= ' on="tap:footnote_references_container_';
$l_str_excerpt_text .= self::$a_int_post_id . '_' . self::$a_int_reference_container_id;
@ -1466,7 +1512,7 @@ class Parser {
$l_str_excerpt_text .= '>';
// Configurable read-on button label.
$l_str_excerpt_text .= Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL );
$l_str_excerpt_text .= Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL );
$l_str_excerpt_text .= self::$a_bool_hard_links_enabled ? '</a>' : '</span>';
}
@ -1477,7 +1523,7 @@ class Parser {
*
* Define the HTML element to use for the referrers.
*/
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS ) ) ) {
$l_str_sup_span = 'sup';
@ -1520,7 +1566,7 @@ class Parser {
$l_str_referrer_anchor_element = '';
// The link element is set independently as it may be needed for styling.
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_LINK_ELEMENT_ENABLED ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_LINK_ELEMENT_ENABLED ) ) ) {
self::$a_str_link_span = 'a';
self::$a_str_link_open_tag = '<a>';
@ -1564,9 +1610,9 @@ class Parser {
'note_id' => $l_int_index,
'hard-link' => $l_str_footnote_link_argument,
'sup-span' => $l_str_sup_span,
'before' => Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_STYLING_BEFORE ),
'before' => Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_STYLING_BEFORE ),
'index' => $l_int_index,
'after' => Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_STYLING_AFTER ),
'after' => Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_STYLING_AFTER ),
'anchor-element' => $l_str_referrer_anchor_element,
'style' => $l_str_tooltip_style,
'text' => $l_str_tooltip_content,
@ -1580,12 +1626,12 @@ class Parser {
// If tooltips are enabled but neither AMP nor alternative are.
if ( General::$a_bool_tooltips_enabled && ! General::$a_bool_amp_enabled && ! General::$a_bool_alternative_tooltips_enabled ) {
$l_int_offset_y = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y ) );
$l_int_offset_x = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X ) );
$l_int_fade_in_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY ) );
$l_int_fade_in_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION ) );
$l_int_fade_out_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY ) );
$l_int_fade_out_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION ) );
$l_int_offset_y = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y );
$l_int_offset_x = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X );
$l_int_fade_in_delay = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY );
$l_int_fade_in_duration = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION );
$l_int_fade_out_delay = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY );
$l_int_fade_out_duration = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION );
// Fill in 'public/partials/tooltip.html'.
$l_obj_template_tooltip->replace(
@ -1593,13 +1639,13 @@ class Parser {
'post_id' => self::$a_int_post_id,
'container_id' => self::$a_int_reference_container_id,
'note_id' => $l_int_index,
'position' => Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION ),
'offset-y' => ! empty( $l_int_offset_y ) ? $l_int_offset_y : 0,
'offset-x' => ! empty( $l_int_offset_x ) ? $l_int_offset_x : 0,
'fade-in-delay' => ! empty( $l_int_fade_in_delay ) ? $l_int_fade_in_delay : 0,
'fade-in-duration' => ! empty( $l_int_fade_in_duration ) ? $l_int_fade_in_duration : 0,
'fade-out-delay' => ! empty( $l_int_fade_out_delay ) ? $l_int_fade_out_delay : 0,
'fade-out-duration' => ! empty( $l_int_fade_out_duration ) ? $l_int_fade_out_duration : 0,
'position' => Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION ),
'offset-y' => empty( $l_int_offset_y ) ? 0 : $l_int_offset_y,
'offset-x' => empty( $l_int_offset_x ) ? 0 : $l_int_offset_x,
'fade-in-delay' => empty( $l_int_fade_in_delay ) ? 0 : $l_int_fade_in_delay,
'fade-in-duration' => empty( $l_int_fade_in_duration ) ? 0 : $l_int_fade_in_duration,
'fade-out-delay' => empty( $l_int_fade_out_delay ) ? 0 : $l_int_fade_out_delay,
'fade-out-duration' => empty( $l_int_fade_out_duration ) ? 0 : $l_int_fade_out_duration,
)
);
$l_str_footnote_replace_text .= $l_obj_template_tooltip->get_content();
@ -1667,16 +1713,16 @@ class Parser {
*/
// If the backlink symbol is enabled.
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE ) ) ) {
// Get html arrow.
$l_str_arrow = Includes\Convert::get_arrow( Includes\Settings::instance()->get( Includes\Settings::C_STR_HYPERLINK_ARROW ) );
$l_str_arrow = Includes\Convert::get_arrow( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_HYPERLINK_ARROW ) );
// Set html arrow to the first one if invalid index defined.
if ( is_array( $l_str_arrow ) ) {
$l_str_arrow = Includes\Convert::get_arrow( 0 );
}
// Get user defined arrow.
$l_str_arrow_user_defined = Includes\Settings::instance()->get( Includes\Settings::C_STR_HYPERLINK_ARROW_USER_DEFINED );
$l_str_arrow_user_defined = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_HYPERLINK_ARROW_USER_DEFINED );
if ( ! empty( $l_str_arrow_user_defined ) ) {
$l_str_arrow = $l_str_arrow_user_defined;
}
@ -1699,15 +1745,15 @@ class Parser {
* Initially an appended comma was hard-coded in this algorithm for enumerations.
* The comma in enumerations is not universally preferred.
*/
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_SEPARATOR_ENABLED ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_SEPARATOR_ENABLED ) ) ) {
// Check if it is input-configured.
$l_str_separator = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_SEPARATOR_CUSTOM );
$l_str_separator = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_SEPARATOR_CUSTOM );
if ( empty( $l_str_separator ) ) {
// If it is not, check which option is on.
$l_str_separator_option = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_SEPARATOR_OPTION );
$l_str_separator_option = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_SEPARATOR_OPTION );
switch ( $l_str_separator_option ) {
case 'comma':
$l_str_separator = ',';
@ -1730,15 +1776,15 @@ class Parser {
*
* Initially a dot was appended in the table row template.
*/
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_TERMINATOR_ENABLED ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_TERMINATOR_ENABLED ) ) ) {
// Check if it is input-configured.
$l_str_terminator = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_TERMINATOR_CUSTOM );
$l_str_terminator = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_TERMINATOR_CUSTOM );
if ( empty( $l_str_terminator ) ) {
// If it is not, check which option is on.
$l_str_terminator_option = Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_TERMINATOR_OPTION );
$l_str_terminator_option = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_TERMINATOR_OPTION );
switch ( $l_str_terminator_option ) {
case 'period':
$l_str_terminator = '.';
@ -1764,7 +1810,7 @@ class Parser {
* Variable number length and proportional character width require explicit line breaks.
* Otherwise, an ordinary space character offering a line break opportunity is inserted.
*/
$l_str_line_break = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED ) ) ? '<br />' : ' ';
$l_str_line_break = Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_BACKLINKS_LINE_BREAKS_ENABLED ) ) ? '<br />' : ' ';
/*
* Line breaks for source readability.
@ -1778,71 +1824,42 @@ class Parser {
/*
* Reference container table row template load.
*/
$l_bool_combine_identical_footnotes = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_COMBINE_IDENTICAL_FOOTNOTES ) );
$l_bool_combine_identical_footnotes = Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_COMBINE_IDENTICAL_FOOTNOTES ) );
// AMP compatibility requires a full set of AMP compatible table row templates.
if ( General::$a_bool_amp_enabled ) {
// When combining identical footnotes is turned on, another template is needed.
if ( $l_bool_combine_identical_footnotes ) {
// The combining template allows for backlink clusters and supports cell clicking for single notes.
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container-body-combi' );
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'amp-reference-container-body-combi' );
} elseif ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE ) ) ) {
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'amp-reference-container-body-3column' );
} elseif ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) ) ) {
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'amp-reference-container-body-switch' );
} else {
// When 3-column layout is turned on (only available if combining is turned off).
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE ) ) ) {
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container-body-3column' );
} else {
// When switch symbol and index is turned on, and combining and 3-columns are off.
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) ) ) {
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container-body-switch' );
} else {
// Default is the standard template.
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container-body' );
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'amp-reference-container-body' );
}
}
}
} elseif ( $l_bool_combine_identical_footnotes ) {
// The combining template allows for backlink clusters and supports cell clicking for single notes.
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'reference-container-body-combi' );
} elseif ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE ) ) ) {
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'reference-container-body-3column' );
} elseif ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) ) ) {
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'reference-container-body-switch' );
} else {
// When combining identical footnotes is turned on, another template is needed.
if ( $l_bool_combine_identical_footnotes ) {
// The combining template allows for backlink clusters and supports cell clicking for single notes.
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'reference-container-body-combi' );
} else {
// When 3-column layout is turned on (only available if combining is turned off).
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE ) ) ) {
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'reference-container-body-3column' );
} else {
// When switch symbol and index is turned on, and combining and 3-columns are off.
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) ) ) {
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'reference-container-body-switch' );
} else {
// Default is the standard template.
$l_obj_template = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'reference-container-body' );
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'reference-container-body' );
}
}
}
}
/*
* Switch backlink symbol and footnote number.
*/
$l_bool_symbol_switch = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) );
$l_bool_symbol_switch = Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH ) );
// Loop through all footnotes found in the page.
$num_footnotes = count( self::$a_arr_footnotes );
@ -1862,7 +1879,7 @@ class Parser {
// Get the footnote index string and.
// Keep supporting legacy index placeholder.
$l_str_footnote_id = Includes\Convert::index( ( $l_int_index + 1 ), Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
$l_str_footnote_id = Includes\Convert::index( ( $l_int_index + 1 ), Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
/**
* Case of only one backlink per table row.
@ -1882,9 +1899,9 @@ class Parser {
*
* @since 2.5.4
*/
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_ENABLE ) ) ) {
$l_str_use_backbutton_hint = ' title="';
$l_str_use_backbutton_hint .= Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT );
$l_str_use_backbutton_hint .= Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_BACKLINK_TOOLTIP_TEXT );
$l_str_use_backbutton_hint .= '"';
} else {
$l_str_use_backbutton_hint = '';
@ -1901,11 +1918,11 @@ class Parser {
$l_str_footnote_anchor_element .= '" class="footnote_item_anchor"></span></span>';
// Compose optional hard link address.
$l_str_hard_link_address = ' href="#';
$l_str_hard_link_address .= self::$a_str_referrer_link_slug;
$l_str_hard_link_address .= self::$a_str_post_container_id_compound;
$l_str_hard_link_address .= $l_str_footnote_id . '"';
$l_str_hard_link_address .= $l_str_use_backbutton_hint;
$l_str_hard_link_address = ' href="#';
$l_str_hard_link_address .= self::$a_str_referrer_link_slug;
$l_str_hard_link_address .= self::$a_str_post_container_id_compound;
$l_str_hard_link_address .= $l_str_footnote_id . '"';
$l_str_hard_link_address .= $l_str_use_backbutton_hint;
self::$a_str_link_open_tag = ' class="footnote_hard_back_link">';
} else {
@ -2007,7 +2024,7 @@ class Parser {
$l_bool_flag_combined = true;
// Update the footnote ID.
$l_str_footnote_id = Includes\Convert::index( ( $l_int_check_index + 1 ), Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
$l_str_footnote_id = Includes\Convert::index( ( $l_int_check_index + 1 ), Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) );
// Resume composing the backlinks enumeration.
$l_str_footnote_backlinks .= "$l_str_separator</";
@ -2067,13 +2084,13 @@ class Parser {
// Get reference container item text if tooltip text goes separate.
$l_int_tooltip_text_length = strpos( $l_str_footnote_text, self::$a_str_tooltip_shortcode );
$l_bool_has_tooltip_text = ! $l_int_tooltip_text_length ? false : true;
$l_bool_has_tooltip_text = (bool) $l_int_tooltip_text_length;
if ( $l_bool_has_tooltip_text ) {
$l_str_not_tooltip_text = substr( $l_str_footnote_text, ( $l_int_tooltip_text_length + self::$a_int_tooltip_shortcode_length ) );
self::$a_bool_mirror_tooltip_text = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE ) );
self::$a_bool_mirror_tooltip_text = Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_ENABLE ) );
if ( self::$a_bool_mirror_tooltip_text ) {
$l_str_tooltip_text = substr( $l_str_footnote_text, 0, $l_int_tooltip_text_length );
$l_str_reference_text_introducer = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR );
$l_str_reference_text_introducer = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_TOOLTIP_EXCERPT_MIRROR_SEPARATOR );
$l_str_reference_text = $l_str_tooltip_text . $l_str_reference_text_introducer . $l_str_not_tooltip_text;
} else {
$l_str_reference_text = $l_str_not_tooltip_text;
@ -2092,7 +2109,7 @@ class Parser {
// Used in standard layout W/O COMBINED FOOTNOTES.
'post_id' => self::$a_int_post_id,
'container_id' => self::$a_int_reference_container_id,
'note_id' => Includes\Convert::index( $l_int_first_footnote_index, Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) ),
'note_id' => Includes\Convert::index( $l_int_first_footnote_index, Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_COUNTER_STYLE ) ),
'link-start' => self::$a_str_link_open_tag,
'link-end' => self::$a_str_link_close_tag,
'link-span' => self::$a_str_link_span,
@ -2121,10 +2138,10 @@ class Parser {
}
// Call again for robustness when priority levels dont match any longer.
self::$a_int_scroll_offset = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_OFFSET ) );
self::$a_int_scroll_offset = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_SCROLL_OFFSET );
// Streamline.
$l_bool_collapse_default = Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) );
$l_bool_collapse_default = Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) );
/*
* Reference container label.
@ -2133,32 +2150,32 @@ class Parser {
* In case of empty label that would apply to the left half button character.
* Hence the point in setting an empty label to U+202F NARROW NO-BREAK SPACE.
*/
$l_str_reference_container_label = Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_NAME );
$l_str_reference_container_label = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_NAME );
// Select the reference container template.
// Whether AMP compatibility mode is enabled.
if ( General::$a_bool_amp_enabled ) {
// Whether the reference container is collapsed by default.
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_COLLAPSE ) ) ) {
// Load 'public/partials/amp-reference-container-collapsed.html'.
$l_obj_template_container = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container-collapsed' );
$l_obj_template_container = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'amp-reference-container-collapsed' );
} else {
// Load 'public/partials/amp-reference-container.html'.
$l_obj_template_container = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'amp-reference-container' );
$l_obj_template_container = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'amp-reference-container' );
}
} elseif ( 'js' === General::$a_str_script_mode ) {
// Load 'public/partials/js-reference-container.html'.
$l_obj_template_container = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'js-reference-container' );
$l_obj_template_container = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'js-reference-container' );
} else {
// Load 'public/partials/reference-container.html'.
$l_obj_template_container = new Includes\Template( Includes\Template::C_STR_PUBLIC, 'reference-container' );
$l_obj_template_container = new Includes\Template( \footnotes\includes\Template::C_STR_PUBLIC, 'reference-container' );
}
$l_int_scroll_offset = '';
@ -2170,11 +2187,11 @@ class Parser {
if ( 'jquery' === General::$a_str_script_mode ) {
$l_int_scroll_offset = ( self::$a_int_scroll_offset / 100 );
$l_int_scroll_up_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DURATION ) );
$l_int_scroll_up_duration = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_SCROLL_DURATION );
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY ) ) ) {
if ( Includes\Convert::to_bool( Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_SCROLL_DURATION_ASYMMETRICITY ) ) ) {
$l_int_scroll_down_duration = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION ) );
$l_int_scroll_down_duration = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DURATION );
} else {
@ -2182,8 +2199,8 @@ class Parser {
}
$l_int_scroll_down_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY ) );
$l_int_scroll_up_delay = intval( Includes\Settings::instance()->get( Includes\Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY ) );
$l_int_scroll_down_delay = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_SCROLL_DOWN_DELAY );
$l_int_scroll_up_delay = (int) Includes\Settings::instance()->get( \footnotes\includes\Settings::C_INT_FOOTNOTES_SCROLL_UP_DELAY );
}
@ -2191,9 +2208,9 @@ class Parser {
array(
'post_id' => self::$a_int_post_id,
'container_id' => self::$a_int_reference_container_id,
'element' => Includes\Settings::instance()->get( Includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT ),
'element' => Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT ),
'name' => empty( $l_str_reference_container_label ) ? '&#x202F;' : $l_str_reference_container_label,
'button-style' => ! $l_bool_collapse_default ? 'display: none;' : '',
'button-style' => $l_bool_collapse_default ? '' : 'display: none;',
'style' => $l_bool_collapse_default ? 'display: none;' : '',
'caption' => ( empty( $l_str_reference_container_label ) || '' === $l_str_reference_container_label ) ? 'References' : $l_str_reference_container_label,
'content' => $l_str_body,