Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../template...
File: features.php
if (class_exists('YoastSEO_AMP_Frontend') ) { ?>
[6500] Fix | Delete
a {text-decoration:none;}
[6501] Fix | Delete
html {background:none;}
[6502] Fix | Delete
<?php }
[6503] Fix | Delete
if ( isset($redux_builder_amp['ampforwp-underline-content-links']) && $redux_builder_amp['ampforwp-underline-content-links'] ) { ?>
[6504] Fix | Delete
.the_content a {text-decoration:underline;}
[6505] Fix | Delete
<?php }
[6506] Fix | Delete
}
[6507] Fix | Delete
}
[6508] Fix | Delete
[6509] Fix | Delete
// Filter for Frontpage id
[6510] Fix | Delete
add_filter('ampforwp_modify_frontpage_id', 'ampforwp_modified_frontpage_id');
[6511] Fix | Delete
if( ! function_exists('ampforwp_modified_frontpage_id') ) {
[6512] Fix | Delete
function ampforwp_modified_frontpage_id($page_id){
[6513] Fix | Delete
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
[6514] Fix | Delete
// WPML Compatibility #1111
[6515] Fix | Delete
if( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){
[6516] Fix | Delete
$page_id = get_option('page_on_front');
[6517] Fix | Delete
}
[6518] Fix | Delete
// Polylang Compatibility #1779
[6519] Fix | Delete
elseif( ampforwp_polylang_front_page() ){
[6520] Fix | Delete
$frontpage_id = get_option('page_on_front');
[6521] Fix | Delete
if($frontpage_id){
[6522] Fix | Delete
$page_id = pll_get_post($frontpage_id);
[6523] Fix | Delete
}
[6524] Fix | Delete
}
[6525] Fix | Delete
return $page_id;
[6526] Fix | Delete
}
[6527] Fix | Delete
}
[6528] Fix | Delete
[6529] Fix | Delete
// AMP to WP Theme Ads
[6530] Fix | Delete
add_filter('ampforwp_modify_ads', 'ampforwp_nonamp_ads',10, 5);
[6531] Fix | Delete
if ( ! function_exists('ampforwp_nonamp_ads') ) {
[6532] Fix | Delete
function ampforwp_nonamp_ads($output, $width, $height, $client_id, $data_slot) {
[6533] Fix | Delete
if ( ampforwp_is_non_amp('non_amp_check_convert') ) {
[6534] Fix | Delete
[6535] Fix | Delete
$output = ' <div class="add-wrapper" style="text-align:center;">
[6536] Fix | Delete
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">
[6537] Fix | Delete
</script>
[6538] Fix | Delete
<ins class="adsbygoogle" style="display:inline-block;width:'.esc_attr($width).';height:'.esc_attr($height).'" data-ad-client="'.esc_attr($client_id).'" data-ad-slot="'.esc_attr($data_slot).'">
[6539] Fix | Delete
</ins>
[6540] Fix | Delete
<script>
[6541] Fix | Delete
(adsbygoogle = window.adsbygoogle || []).push({});
[6542] Fix | Delete
</script>
[6543] Fix | Delete
</div>';
[6544] Fix | Delete
}
[6545] Fix | Delete
return $output;
[6546] Fix | Delete
}
[6547] Fix | Delete
}
[6548] Fix | Delete
//AMP to WP Theme Analytics
[6549] Fix | Delete
add_action('wp_footer','ampforwp_nonamp_analytics');
[6550] Fix | Delete
if ( ! function_exists('ampforwp_nonamp_analytics') ) {
[6551] Fix | Delete
function ampforwp_nonamp_analytics() {
[6552] Fix | Delete
global $redux_builder_amp;
[6553] Fix | Delete
$ga_account = $redux_builder_amp['ga-feild'];
[6554] Fix | Delete
if ( ampforwp_is_non_amp("non_amp_check_convert") ) {
[6555] Fix | Delete
echo "
[6556] Fix | Delete
<script>
[6557] Fix | Delete
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
[6558] Fix | Delete
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
[6559] Fix | Delete
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
[6560] Fix | Delete
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
[6561] Fix | Delete
[6562] Fix | Delete
ga('create', '$ga_account', 'auto');
[6563] Fix | Delete
ga('send', 'pageview');
[6564] Fix | Delete
</script>";
[6565] Fix | Delete
}
[6566] Fix | Delete
}
[6567] Fix | Delete
}
[6568] Fix | Delete
// Coauthors Compatibility #1895
[6569] Fix | Delete
add_filter('coauthors_posts_link', 'ampforwp_coauthors_links');
[6570] Fix | Delete
function ampforwp_coauthors_links($args){
[6571] Fix | Delete
global $redux_builder_amp;
[6572] Fix | Delete
if ( function_exists('ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint() && true == $redux_builder_amp['ampforwp-archive-support']) {
[6573] Fix | Delete
$args['href'] = ampforwp_url_controller($args['href']);
[6574] Fix | Delete
}
[6575] Fix | Delete
return $args;
[6576] Fix | Delete
}
[6577] Fix | Delete
[6578] Fix | Delete
//remove anchor from the image when lightbox option is enabled #2695
[6579] Fix | Delete
add_action('pre_amp_render_post','ampforwp_remove_ahref_lightbox');
[6580] Fix | Delete
function ampforwp_remove_ahref_lightbox(){
[6581] Fix | Delete
if(true == ampforwp_get_setting('ampforwp-amp-img-lightbox') ){
[6582] Fix | Delete
add_filter( 'the_content', 'ampforwp_remove_ahref_lightbox_in_amp' );
[6583] Fix | Delete
add_filter('tablepress_table_render_data','amforwp_remove_tp_image_href');
[6584] Fix | Delete
}
[6585] Fix | Delete
}
[6586] Fix | Delete
function ampforwp_remove_ahref_lightbox_in_amp( $content ) {
[6587] Fix | Delete
preg_match_all('/(<a(.*?)href=\"(.*?)\"(.*?)>(.*?)<img(.*?)src=\"(.*?)\"(.*?)(.*?)[^>]*>)/', $content, $matches);
[6588] Fix | Delete
if( count($matches[3])){
[6589] Fix | Delete
for( $i=0;$i<count($matches[3]);$i++){
[6590] Fix | Delete
$href_url = $matches[3][$i];
[6591] Fix | Delete
if (!empty($href_url)) {
[6592] Fix | Delete
$href_url = explode('/', $href_url);
[6593] Fix | Delete
$href_url = end($href_url);
[6594] Fix | Delete
$href_url = pathinfo($href_url, PATHINFO_FILENAME);
[6595] Fix | Delete
}
[6596] Fix | Delete
if($matches[3][$i] == $matches[7][$i] || (!empty($href_url) && strpos($matches[7][$i], $href_url) !== false)){
[6597] Fix | Delete
$href = $matches[3][$i];
[6598] Fix | Delete
$src = $matches[7][$i];
[6599] Fix | Delete
$href_src = str_replace( '/', '\/', esc_url($href));
[6600] Fix | Delete
$image_src = str_replace( '/', '\/', esc_url($src));
[6601] Fix | Delete
$content = preg_replace('/<a(.*?)href=\"'.$href_src.'\"(.*?)>(<img(.*?)src=\"'.$image_src.'\"(.*?)[^>]*>)<\/a>/i', '$3', $content);
[6602] Fix | Delete
[6603] Fix | Delete
}
[6604] Fix | Delete
}
[6605] Fix | Delete
}
[6606] Fix | Delete
return $content;
[6607] Fix | Delete
}
[6608] Fix | Delete
function amforwp_remove_tp_image_href( $orig_table){
[6609] Fix | Delete
$tablepressData = array();
[6610] Fix | Delete
$j = 0;
[6611] Fix | Delete
foreach ($orig_table['data'] as $cols) {
[6612] Fix | Delete
for($i=0;$i< count($cols);$i++){
[6613] Fix | Delete
$tablepressData[$j][$i] = preg_replace("/<a[^>]+\>(<img[^>]+\>)<\/a>/i",'$1', $cols[$i]);
[6614] Fix | Delete
}
[6615] Fix | Delete
$j++;
[6616] Fix | Delete
}
[6617] Fix | Delete
$orig_table['data'] = $tablepressData;
[6618] Fix | Delete
return $orig_table;
[6619] Fix | Delete
}
[6620] Fix | Delete
// amp-image-lightbox #1892
[6621] Fix | Delete
if ( ! function_exists('ampforwp_amp_img_lightbox') ) {
[6622] Fix | Delete
function ampforwp_amp_img_lightbox(){
[6623] Fix | Delete
echo '<amp-image-lightbox id="amp-img-lightbox" layout="nodisplay"></amp-image-lightbox>';
[6624] Fix | Delete
}
[6625] Fix | Delete
}
[6626] Fix | Delete
// New Image attributes for amp-image-lightbox #1892
[6627] Fix | Delete
add_filter('amp_img_attributes', 'ampforwp_img_new_attrs');
[6628] Fix | Delete
function ampforwp_img_new_attrs($attributes) {
[6629] Fix | Delete
global $redux_builder_amp;
[6630] Fix | Delete
if ( ampforwp_get_setting('ampforwp-amp-img-lightbox') ) {
[6631] Fix | Delete
$attributes['on'] = 'tap:amp-img-lightbox';
[6632] Fix | Delete
$attributes['role'] = 'button';
[6633] Fix | Delete
$attributes['tabindex'] = '0';
[6634] Fix | Delete
}
[6635] Fix | Delete
return $attributes;
[6636] Fix | Delete
}
[6637] Fix | Delete
// Facebook Comments script for AMP2WP
[6638] Fix | Delete
add_action('ampforwp_body_beginning', 'ampforwp_amp2wp_fb');
[6639] Fix | Delete
if ( ! function_exists('ampforwp_amp2wp_fb') ) {
[6640] Fix | Delete
function ampforwp_amp2wp_fb(){
[6641] Fix | Delete
global $redux_builder_amp;
[6642] Fix | Delete
if( ampforwp_is_non_amp() && isset($redux_builder_amp['ampforwp-amp-convert-to-wp']) && $redux_builder_amp['ampforwp-amp-convert-to-wp'] && ($redux_builder_amp['ampforwp-facebook-comments-support'] || $redux_builder_amp['ampforwp-facebook-like-button']) ) {
[6643] Fix | Delete
echo '<div id="fb-root"></div>
[6644] Fix | Delete
<script>(function(d, s, id) {
[6645] Fix | Delete
var js, fjs = d.getElementsByTagName(s)[0];
[6646] Fix | Delete
if (d.getElementById(id)) return;
[6647] Fix | Delete
js = d.createElement(s); js.id = id;
[6648] Fix | Delete
js.src = "https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.12";
[6649] Fix | Delete
fjs.parentNode.insertBefore(js, fjs);
[6650] Fix | Delete
}(document, "script", "facebook-jssdk"));</script>';
[6651] Fix | Delete
}
[6652] Fix | Delete
}
[6653] Fix | Delete
}
[6654] Fix | Delete
[6655] Fix | Delete
// Removing AMPHTML Added by Facebook's Instant Article's Plugin #2043
[6656] Fix | Delete
add_action( 'wp', 'ampforwp_remove_instant_articles_amp_markup' );
[6657] Fix | Delete
function ampforwp_remove_instant_articles_amp_markup(){
[6658] Fix | Delete
[6659] Fix | Delete
if(class_exists('Instant_Articles_AMP_Markup')){
[6660] Fix | Delete
remove_action( 'wp_head', array('Instant_Articles_AMP_Markup', 'inject_link_rel') );
[6661] Fix | Delete
}
[6662] Fix | Delete
// #1696
[6663] Fix | Delete
if(function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint()){
[6664] Fix | Delete
if(class_exists('SQ_Classes_ObjController')){
[6665] Fix | Delete
$SQ_Classes_ObjController = new SQ_Classes_ObjController();
[6666] Fix | Delete
$sq_analytics_class_obj = $SQ_Classes_ObjController::getClass('SQ_Models_Services_Analytics');
[6667] Fix | Delete
}
[6668] Fix | Delete
}
[6669] Fix | Delete
}
[6670] Fix | Delete
// #2042
[6671] Fix | Delete
function ampforwp_404_canonical(){
[6672] Fix | Delete
global $wp;
[6673] Fix | Delete
return home_url( $wp->request );
[6674] Fix | Delete
}
[6675] Fix | Delete
// #2001 removing unused JS from the Paginated Posts
[6676] Fix | Delete
add_filter('ampforwp_post_content_filter', 'ampforwp_paginated_post_content');
[6677] Fix | Delete
[6678] Fix | Delete
function ampforwp_paginated_post_content($content){
[6679] Fix | Delete
global $numpages;
[6680] Fix | Delete
if(is_singular()){
[6681] Fix | Delete
if ( get_query_var( 'paged' ) ) {
[6682] Fix | Delete
$paged = get_query_var('paged');
[6683] Fix | Delete
} elseif ( get_query_var( 'page' ) ) {
[6684] Fix | Delete
$paged = get_query_var('page');
[6685] Fix | Delete
} else {
[6686] Fix | Delete
$paged = 1;
[6687] Fix | Delete
}
[6688] Fix | Delete
if( $numpages >= 2 && true == ampforwp_get_setting('amp-pagination') ){
[6689] Fix | Delete
return get_the_content();
[6690] Fix | Delete
}
[6691] Fix | Delete
}
[6692] Fix | Delete
[6693] Fix | Delete
return $content;
[6694] Fix | Delete
}
[6695] Fix | Delete
[6696] Fix | Delete
// GDPR Compliancy #2040
[6697] Fix | Delete
// Moved to notice-bar-functions.php
[6698] Fix | Delete
[6699] Fix | Delete
// Thrive Leads Compatibility #2067
[6700] Fix | Delete
add_filter('thrive_leads_skip_request', 'ampforwp_skip_thrive_leads');
[6701] Fix | Delete
if ( ! function_exists('ampforwp_skip_thrive_leads') ) {
[6702] Fix | Delete
function ampforwp_skip_thrive_leads($skip) {
[6703] Fix | Delete
// Skip thrive leads on AMP
[6704] Fix | Delete
if ( function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint() ) {
[6705] Fix | Delete
return true;
[6706] Fix | Delete
}
[6707] Fix | Delete
[6708] Fix | Delete
return $skip;
[6709] Fix | Delete
}
[6710] Fix | Delete
}
[6711] Fix | Delete
[6712] Fix | Delete
// Re-save permalink once the post value changed in Redading Settings #2190
[6713] Fix | Delete
[6714] Fix | Delete
add_action( 'update_option', 'ampforwp_resave_permalink', 10, 3 );
[6715] Fix | Delete
function ampforwp_resave_permalink( $option, $old_value, $value ){
[6716] Fix | Delete
if('posts_per_page' === $option){
[6717] Fix | Delete
if($old_value != $value){
[6718] Fix | Delete
delete_transient( 'ampforwp_current_version_check' );
[6719] Fix | Delete
}
[6720] Fix | Delete
}
[6721] Fix | Delete
}
[6722] Fix | Delete
[6723] Fix | Delete
// Canonical From Yoast #2118 and All in One SEO #1720 and Rank Math #2701
[6724] Fix | Delete
function ampforwp_generate_canonical(){
[6725] Fix | Delete
global $redux_builder_amp;
[6726] Fix | Delete
$canonical = '';
[6727] Fix | Delete
$canonical = $WPSEO_Frontend = $All_in_One_SEO_Pack = $opts = '';
[6728] Fix | Delete
if ( 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && true == ampforwp_get_setting('ampforwp-seo-yoast-canonical') && class_exists('WPSEO_Frontend') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
[6729] Fix | Delete
$WPSEO_Frontend = WPSEO_Frontend::get_instance();
[6730] Fix | Delete
$canonical = $WPSEO_Frontend->canonical(false);
[6731] Fix | Delete
}
[6732] Fix | Delete
elseif ( 'aioseo' == ampforwp_get_setting('ampforwp-seo-selection') && true == ampforwp_get_setting('ampforwp-seo-aioseo-canonical') && class_exists('All_in_One_SEO_Pack') ) {
[6733] Fix | Delete
$All_in_One_SEO_Pack = new All_in_One_SEO_Pack();
[6734] Fix | Delete
$opts = $All_in_One_SEO_Pack->get_current_options( array(), 'aiosp' );
[6735] Fix | Delete
$canonical = $opts['aiosp_custom_link'];
[6736] Fix | Delete
}
[6737] Fix | Delete
elseif ( defined( 'RANK_MATH_FILE' ) && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') && ampforwp_get_setting( 'ampforwp-seo-rank_math-canonical' ) ) {
[6738] Fix | Delete
$canonical = \RankMath\Paper\Paper::get()->get_canonical();
[6739] Fix | Delete
}
[6740] Fix | Delete
return $canonical;
[6741] Fix | Delete
}
[6742] Fix | Delete
add_filter('amp_post_template_data', 'ampforwp_modified_canonical', 85);
[6743] Fix | Delete
function ampforwp_modified_canonical( $data ) {
[6744] Fix | Delete
$canonical = '';
[6745] Fix | Delete
$canonical = ampforwp_generate_canonical();
[6746] Fix | Delete
if ( !empty($canonical) ) {
[6747] Fix | Delete
$data['canonical_url'] = $canonical;
[6748] Fix | Delete
}
[6749] Fix | Delete
return $data;
[6750] Fix | Delete
}
[6751] Fix | Delete
if(class_exists('WPSEO_Frontend') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && true == ampforwp_get_setting('ampforwp-seo-yoast-canonical') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration') ){
[6752] Fix | Delete
add_filter('ampforwp_modify_rel_url','ampforwp_yoast_canonical');
[6753] Fix | Delete
}
[6754] Fix | Delete
function ampforwp_yoast_canonical($canonical){
[6755] Fix | Delete
if(ampforwp_is_front_page()){
[6756] Fix | Delete
$canonical = ampforwp_generate_canonical();
[6757] Fix | Delete
}
[6758] Fix | Delete
return $canonical;
[6759] Fix | Delete
}
[6760] Fix | Delete
// #2220 Remove Space Shortcode by Pro Theme from THEMCO
[6761] Fix | Delete
add_action('pre_amp_render_post','ampforwp_remove_space_shortcodes');
[6762] Fix | Delete
function ampforwp_remove_space_shortcodes(){
[6763] Fix | Delete
add_filter('the_content','ampforwp_remove_pro_theme_space_shortcodes');
[6764] Fix | Delete
}
[6765] Fix | Delete
[6766] Fix | Delete
function ampforwp_remove_pro_theme_space_shortcodes($content){
[6767] Fix | Delete
if(has_shortcode( $content, 'gap' )){
[6768] Fix | Delete
remove_shortcode( 'gap' );
[6769] Fix | Delete
// to remove the useless shortcode from the AMP Content
[6770] Fix | Delete
add_shortcode( 'gap', 'ampforwp_return_no_gap' );
[6771] Fix | Delete
}
[6772] Fix | Delete
return $content;
[6773] Fix | Delete
}
[6774] Fix | Delete
[6775] Fix | Delete
function ampforwp_return_no_gap(){
[6776] Fix | Delete
return;
[6777] Fix | Delete
}
[6778] Fix | Delete
[6779] Fix | Delete
/*
[6780] Fix | Delete
#2229 Function to check the option for comments to display on post, page or both.
[6781] Fix | Delete
*/
[6782] Fix | Delete
function ampforwp_get_comments_status(){
[6783] Fix | Delete
global $redux_builder_amp;
[6784] Fix | Delete
$display_comments_on = "";
[6785] Fix | Delete
if ( false == ampforwp_get_setting('ampforwp-display-on-pages') && true == ampforwp_get_setting('ampforwp-display-on-posts') ) {
[6786] Fix | Delete
$display_comments_on = is_single();
[6787] Fix | Delete
}
[6788] Fix | Delete
if ( true == ampforwp_get_setting('ampforwp-display-on-pages') && false == ampforwp_get_setting('ampforwp-display-on-posts') ) {
[6789] Fix | Delete
$display_comments_on = is_page();
[6790] Fix | Delete
}
[6791] Fix | Delete
if ( true == ampforwp_get_setting('ampforwp-display-on-pages') && true == ampforwp_get_setting('ampforwp-display-on-posts')) {
[6792] Fix | Delete
$display_comments_on = is_singular();
[6793] Fix | Delete
if ( ampforwp_is_front_page() ) {
[6794] Fix | Delete
$display_comments_on = ampforwp_is_front_page();
[6795] Fix | Delete
}
[6796] Fix | Delete
}
[6797] Fix | Delete
$display_comments_on = apply_filters('ampforwp_comments_visibility', $display_comments_on);
[6798] Fix | Delete
return $display_comments_on;
[6799] Fix | Delete
}
[6800] Fix | Delete
[6801] Fix | Delete
// Vuukle Comments Support #2075
[6802] Fix | Delete
[6803] Fix | Delete
add_action('ampforwp_post_after_design_elements','ampforwp_vuukle_comments_support');
[6804] Fix | Delete
function ampforwp_vuukle_comments_support() {
[6805] Fix | Delete
global $redux_builder_amp;
[6806] Fix | Delete
if ( true == ampforwp_get_setting('ampforwp-vuukle-comments-support') && comments_open() && ampforwp_get_setting('amp-design-selector') != 4) {
[6807] Fix | Delete
echo ampforwp_vuukle_comments_markup();
[6808] Fix | Delete
}
[6809] Fix | Delete
}
[6810] Fix | Delete
function ampforwp_vuukle_comments_markup() {
[6811] Fix | Delete
global $redux_builder_amp,$post;
[6812] Fix | Delete
$apiKey = $locale = '';
[6813] Fix | Delete
$tag_name ='';
[6814] Fix | Delete
$img = get_the_post_thumbnail_url();
[6815] Fix | Delete
$tags = get_the_tags($post->ID);
[6816] Fix | Delete
if( isset($redux_builder_amp['ampforwp-vuukle-comments-apiKey']) && $redux_builder_amp['ampforwp-vuukle-comments-apiKey'] !== ""){
[6817] Fix | Delete
$apiKey = $redux_builder_amp['ampforwp-vuukle-comments-apiKey'];
[6818] Fix | Delete
}
[6819] Fix | Delete
$display_comments_on = false;
[6820] Fix | Delete
$display_comments_on = ampforwp_get_comments_status();
[6821] Fix | Delete
$siteUrl = trim(site_url(), '/');
[6822] Fix | Delete
if (!preg_match('#^http(s)?://#', $siteUrl)) {
[6823] Fix | Delete
$siteUrl = 'http://' . $siteUrl;
[6824] Fix | Delete
}
[6825] Fix | Delete
if($img == false){
[6826] Fix | Delete
$img = plugins_url('accelerated-mobile-pages/images/150x150.png');
[6827] Fix | Delete
}
[6828] Fix | Delete
if($tags){
[6829] Fix | Delete
foreach($tags as $individual_tag) {
[6830] Fix | Delete
$tag_name = $individual_tag->name;
[6831] Fix | Delete
}
[6832] Fix | Delete
}
[6833] Fix | Delete
$urlParts = parse_url($siteUrl);
[6834] Fix | Delete
$siteUrl = preg_replace('/^www\./', '', $urlParts['host']);// remove www
[6835] Fix | Delete
$srcUrl = 'https://cdn.vuukle.com/amp.html?';
[6836] Fix | Delete
$srcUrl = add_query_arg('url' ,get_permalink(), $srcUrl);
[6837] Fix | Delete
$srcUrl = add_query_arg('host' ,$siteUrl, $srcUrl);
[6838] Fix | Delete
$srcUrl = add_query_arg('id' , $post->ID, $srcUrl);
[6839] Fix | Delete
if(!empty($apiKey)){
[6840] Fix | Delete
$srcUrl = add_query_arg('apiKey' , $apiKey, $srcUrl);
[6841] Fix | Delete
}
[6842] Fix | Delete
$srcUrl = add_query_arg('title' , urlencode($post->post_title), $srcUrl);
[6843] Fix | Delete
$srcUrl = add_query_arg('img' , esc_url($img), $srcUrl);
[6844] Fix | Delete
$srcUrl = add_query_arg('tags' , urlencode($tag_name), $srcUrl);
[6845] Fix | Delete
if(ampforwp_get_setting('ampforwp-vuukle-comments-emoji')==false){
[6846] Fix | Delete
$srcUrl = add_query_arg('emotes' , 'false', $srcUrl);
[6847] Fix | Delete
}
[6848] Fix | Delete
$consent = '';
[6849] Fix | Delete
if(ampforwp_get_data_consent()){
[6850] Fix | Delete
$consent = 'data-block-on-consent ';
[6851] Fix | Delete
}
[6852] Fix | Delete
$vuukle_html ='';
[6853] Fix | Delete
if ( $display_comments_on ) {
[6854] Fix | Delete
$vuukle_html .= '<amp-iframe width="600" height="350" '.esc_attr($consent).'layout="responsive" sandbox="allow-scripts allow-same-origin allow-modals allow-popups allow-forms" resizable frameborder="0" src="'.esc_url($srcUrl).'">
[6855] Fix | Delete
[6856] Fix | Delete
<div overflow tabindex="0" role="button" aria-label="Show comments" class="afwp-vuukle-support">Show comments</div></amp-iframe>';
[6857] Fix | Delete
}
[6858] Fix | Delete
return $vuukle_html;
[6859] Fix | Delete
}
[6860] Fix | Delete
add_filter( 'amp_post_template_data', 'ampforwp_add_vuukle_scripts' );
[6861] Fix | Delete
function ampforwp_add_vuukle_scripts( $data ) {
[6862] Fix | Delete
global $redux_builder_amp;
[6863] Fix | Delete
$display_comments_on = "";
[6864] Fix | Delete
$display_comments_on = ampforwp_get_comments_status();
[6865] Fix | Delete
if ( ampforwp_get_setting('ampforwp-vuukle-comments-support') && $display_comments_on) {
[6866] Fix | Delete
if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
[6867] Fix | Delete
$data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
[6868] Fix | Delete
}
[6869] Fix | Delete
if (ampforwp_get_setting('ampforwp-vuukle-Ads-before-comments') && empty( $data['amp_component_scripts']['amp-ad'] ) ) {
[6870] Fix | Delete
$data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
[6871] Fix | Delete
}
[6872] Fix | Delete
}
[6873] Fix | Delete
return $data;
[6874] Fix | Delete
}
[6875] Fix | Delete
//spotim #2076
[6876] Fix | Delete
add_action('ampforwp_post_after_design_elements','ampforwp_spotim_comments_support');
[6877] Fix | Delete
function ampforwp_spotim_comments_support() {
[6878] Fix | Delete
global $redux_builder_amp;
[6879] Fix | Delete
if ( 4 != $redux_builder_amp['amp-design-selector']
[6880] Fix | Delete
&& isset($redux_builder_amp['ampforwp-spotim-comments-support'])
[6881] Fix | Delete
&& $redux_builder_amp['ampforwp-spotim-comments-support']==1
[6882] Fix | Delete
) {
[6883] Fix | Delete
echo ampforwp_spotim_comments_markup();
[6884] Fix | Delete
}
[6885] Fix | Delete
}
[6886] Fix | Delete
function ampforwp_spotim_comments_markup() {
[6887] Fix | Delete
global $post;
[6888] Fix | Delete
$display_comments_on = false;
[6889] Fix | Delete
$display_comments_on = ampforwp_get_comments_status();
[6890] Fix | Delete
if (! $display_comments_on ) {
[6891] Fix | Delete
return '';
[6892] Fix | Delete
}
[6893] Fix | Delete
$spotId ='';
[6894] Fix | Delete
if( true == ampforwp_get_setting('ampforwp-spotim-comments-apiKey') && ampforwp_get_setting('ampforwp-spotim-comments-apiKey') !== ""){
[6895] Fix | Delete
$spotId = ampforwp_get_setting('ampforwp-spotim-comments-apiKey');
[6896] Fix | Delete
}
[6897] Fix | Delete
$srcUrl = 'https://amp.spot.im/production.html?spot_im_highlight_immediate=true';
[6898] Fix | Delete
$srcUrl = add_query_arg('spotId' ,$spotId, $srcUrl);
[6899] Fix | Delete
$srcUrl = add_query_arg('postId' , $post->ID, $srcUrl);
[6900] Fix | Delete
$spotim_html = '<amp-iframe width="375" height="815" resizable sandbox="allow-scripts allow-same-origin allow-popups allow-top-navigation" layout="responsive"
[6901] Fix | Delete
frameborder="0" src="'.esc_url($srcUrl).'">
[6902] Fix | Delete
<amp-img placeholder height="815" layout="fill" src="//amp.spot.im/loader.png"></amp-img>
[6903] Fix | Delete
<div overflow class="spot-im-amp-overflow" tabindex="0" role="button" aria-label="Read more">Load more...</div>
[6904] Fix | Delete
</amp-iframe>';
[6905] Fix | Delete
return $spotim_html;
[6906] Fix | Delete
}
[6907] Fix | Delete
//spotim script
[6908] Fix | Delete
add_filter( 'amp_post_template_data', 'ampforwp_add_spotim_scripts' );
[6909] Fix | Delete
function ampforwp_add_spotim_scripts( $data ) {
[6910] Fix | Delete
global $redux_builder_amp;
[6911] Fix | Delete
$display_comments_on = "";
[6912] Fix | Delete
$display_comments_on = ampforwp_get_comments_status();
[6913] Fix | Delete
if ( 4 != $redux_builder_amp['amp-design-selector']
[6914] Fix | Delete
&& isset($redux_builder_amp['ampforwp-spotim-comments-support'])
[6915] Fix | Delete
&& $redux_builder_amp['ampforwp-spotim-comments-support']
[6916] Fix | Delete
&& $display_comments_on && comments_open()
[6917] Fix | Delete
) {
[6918] Fix | Delete
if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
[6919] Fix | Delete
$data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
[6920] Fix | Delete
}
[6921] Fix | Delete
}
[6922] Fix | Delete
return $data;
[6923] Fix | Delete
}
[6924] Fix | Delete
//spotim css
[6925] Fix | Delete
add_action('amp_post_template_css','ampforwp_spotim_vuukle_styling',60);
[6926] Fix | Delete
function ampforwp_spotim_vuukle_styling(){
[6927] Fix | Delete
global $redux_builder_amp;
[6928] Fix | Delete
$display_comments_on = "";
[6929] Fix | Delete
$display_comments_on = ampforwp_get_comments_status();
[6930] Fix | Delete
if ( isset($redux_builder_amp['ampforwp-spotim-comments-support'])
[6931] Fix | Delete
&& $redux_builder_amp['ampforwp-spotim-comments-support']
[6932] Fix | Delete
&& $display_comments_on && comments_open() ) {
[6933] Fix | Delete
?>.spot-im-amp-overflow {
[6934] Fix | Delete
background: white;
[6935] Fix | Delete
font-size: 15px;
[6936] Fix | Delete
padding: 15px 0;
[6937] Fix | Delete
text-align: center;
[6938] Fix | Delete
font-family: Helvetica, Arial, sans-serif;
[6939] Fix | Delete
color: #307fe2;
[6940] Fix | Delete
}<?php
[6941] Fix | Delete
}
[6942] Fix | Delete
if ( isset($redux_builder_amp['ampforwp-vuukle-comments-support'])
[6943] Fix | Delete
&& $redux_builder_amp['ampforwp-vuukle-comments-support']
[6944] Fix | Delete
&& $display_comments_on && comments_open() ) { ?>
[6945] Fix | Delete
.afwp-vuukle-support{
[6946] Fix | Delete
display: block;text-align: center;background: #1f87e5;color: #fff;border-radius: 4px;
[6947] Fix | Delete
} <?php
[6948] Fix | Delete
}
[6949] Fix | Delete
}
[6950] Fix | Delete
[6951] Fix | Delete
[6952] Fix | Delete
function ampforwp_check_excerpt(){
[6953] Fix | Delete
global $redux_builder_amp;
[6954] Fix | Delete
[6955] Fix | Delete
$value = '';
[6956] Fix | Delete
$value = ( isset( $redux_builder_amp['excerpt-option'] ) && $redux_builder_amp['excerpt-option'] ) ;
[6957] Fix | Delete
if ( null === $value ) {
[6958] Fix | Delete
$value = '1';
[6959] Fix | Delete
}
[6960] Fix | Delete
[6961] Fix | Delete
return $value;
[6962] Fix | Delete
}
[6963] Fix | Delete
[6964] Fix | Delete
// Back to top
[6965] Fix | Delete
add_action( 'ampforwp_body_beginning' ,'ampforwp_back_to_top_markup');
[6966] Fix | Delete
function ampforwp_back_to_top_markup(){
[6967] Fix | Delete
if(true == ampforwp_get_setting('ampforwp-footer-top')){
[6968] Fix | Delete
echo '<div id="backtotop"></div>';
[6969] Fix | Delete
}
[6970] Fix | Delete
}
[6971] Fix | Delete
[6972] Fix | Delete
// rel="next" & rel="prev" pagination meta tags #2343
[6973] Fix | Delete
add_action( 'amp_post_template_head', 'ampforwp_rel_next_prev' );
[6974] Fix | Delete
[6975] Fix | Delete
function ampforwp_rel_next_prev(){
[6976] Fix | Delete
global $paged;
[6977] Fix | Delete
if(ampforwp_is_front_page()){
[6978] Fix | Delete
return ;
[6979] Fix | Delete
}
[6980] Fix | Delete
if ( get_previous_posts_link() ) { ?>
[6981] Fix | Delete
<link rel="prev" href="<?php echo esc_url(get_pagenum_link( $paged - 1 )); ?>" /><?php
[6982] Fix | Delete
}
[6983] Fix | Delete
if ( get_next_posts_link() ) { ?>
[6984] Fix | Delete
<link rel="next" href="<?php echo esc_url(get_pagenum_link( $paged + 1 )); ?>" /><?php
[6985] Fix | Delete
}
[6986] Fix | Delete
}
[6987] Fix | Delete
[6988] Fix | Delete
// Content Sneak Peek #2246
[6989] Fix | Delete
add_action('pre_amp_render_post', 'ampforwp_content_sneak_peek');
[6990] Fix | Delete
if ( ! function_exists('ampforwp_content_sneak_peek') ) {
[6991] Fix | Delete
function ampforwp_content_sneak_peek() {
[6992] Fix | Delete
global $redux_builder_amp;
[6993] Fix | Delete
if ( ampforwp_get_setting('content-sneak-peek') && is_single() && 'post' == get_post_type() ) {
[6994] Fix | Delete
add_filter('ampforwp_modify_the_content', 'ampforwp_sneak_peek_content_modifier');
[6995] Fix | Delete
add_action('amp_post_template_css','ampforwp_sneak_peek_css');
[6996] Fix | Delete
add_filter('ampforwp_post_template_data','ampforwp_sneak_peek_scripts');
[6997] Fix | Delete
}
[6998] Fix | Delete
[6999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function