Skip to content

Commit

Permalink
#2447 footnotes plugin compatibility added
Browse files Browse the repository at this point in the history
  • Loading branch information
Zabi09 committed Jan 31, 2019
1 parent fc532ce commit c3d5057
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions includes/features/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ function ampforwp_the_content_filter_full( $content_buffer ) {
$content_buffer = preg_replace('/!important/', '' , $content_buffer);
if(true == ampforwp_get_setting('ampforwp-smooth-scrolling-for-links')){
$content_buffer = preg_replace('/<a(.*?)href="#(.*?)"(.*?)>/', '<a $1 href="#" on="tap:$2.scrollTo(duration=1000)" $3>', $content_buffer);}
// Compatibility with the footnotes plugin. #2447
if(class_exists('MCI_Footnotes')){
$content_buffer = preg_replace( '/<sup(.*?)id="(.*?)"(.*?)class="footnote_plugin_tooltip_text"(.*?)>(.*?)<\/sup>/m', '
<sup$1id="$2"$3class="footnote_plugin_tooltip_text"$4><a href="#$2">$5</a></sup>', $content_buffer);
}
$content_buffer = apply_filters('ampforwp_the_content_last_filter', $content_buffer);

}
Expand Down
15 changes: 14 additions & 1 deletion templates/features.php
Original file line number Diff line number Diff line change
Expand Up @@ -7434,4 +7434,17 @@ function ampforwp_jetpacksubscription_submit(){
die;
}
}
//Jetpack subscription Widget End
//Jetpack subscription Widget End

// Compatibility with the footnotes plugin. #2447
add_action('amp_post_template_css','ampforwp_footnote_support');
if ( ! function_exists('ampforwp_footnote_support') ) {
function ampforwp_footnote_support(){
if(class_exists('MCI_Footnotes')){?>
.footnote_tooltip {
display: none;
}
<?php
}
}
}

0 comments on commit c3d5057

Please sign in to comment.