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
} elseif ($post !='') {
[2000] Fix | Delete
if (get_post_field('post_content', $post->ID) !='') {
[2001] Fix | Delete
$seopress_get_the_excerpt = wp_trim_words(esc_attr(stripslashes_deep(wp_filter_nohtml_kses(strip_shortcodes(get_post_field('post_content', $post->ID))))), $seopress_excerpt_length);
[2002] Fix | Delete
} else {
[2003] Fix | Delete
$seopress_get_the_excerpt = null;
[2004] Fix | Delete
}
[2005] Fix | Delete
} else {
[2006] Fix | Delete
$seopress_get_the_excerpt = null;
[2007] Fix | Delete
}
[2008] Fix | Delete
$seopress_paged = '';
[2009] Fix | Delete
if (get_query_var('paged') >='1') {
[2010] Fix | Delete
$seopress_paged = get_query_var('paged');
[2011] Fix | Delete
}
[2012] Fix | Delete
$seopress_titles_sep_option = get_option("seopress_titles_option_name");
[2013] Fix | Delete
if (isset($seopress_titles_sep_option['seopress_titles_sep']) ) {
[2014] Fix | Delete
$sep = $seopress_titles_sep_option['seopress_titles_sep'];
[2015] Fix | Delete
} else {
[2016] Fix | Delete
$sep = '-';
[2017] Fix | Delete
}
[2018] Fix | Delete
$the_author_meta ='';
[2019] Fix | Delete
if(is_single() || is_author()){
[2020] Fix | Delete
$the_author_meta = get_the_author_meta('display_name', $post->post_author);
[2021] Fix | Delete
}
[2022] Fix | Delete
[2023] Fix | Delete
$post_category ='';
[2024] Fix | Delete
if (is_single() && has_category()) {
[2025] Fix | Delete
$post_category_array = get_the_terms(get_the_id(), 'category');
[2026] Fix | Delete
$post_category = $post_category_array[0]->name;
[2027] Fix | Delete
}
[2028] Fix | Delete
[2029] Fix | Delete
$post_tag ='';
[2030] Fix | Delete
if (is_single() && has_tag()) {
[2031] Fix | Delete
$post_tag_array = get_the_terms(get_the_id(), 'post_tag');
[2032] Fix | Delete
$post_tag = $post_tag_array[0]->name;
[2033] Fix | Delete
}
[2034] Fix | Delete
[2035] Fix | Delete
$get_search_query ='';
[2036] Fix | Delete
if (get_search_query() !='') {
[2037] Fix | Delete
$get_search_query = '"'.get_search_query().'"';
[2038] Fix | Delete
}
[2039] Fix | Delete
[2040] Fix | Delete
$get_search_query = apply_filters('seopress_get_search_query', $get_search_query);
[2041] Fix | Delete
[2042] Fix | Delete
if ($seopress_excerpt !='') {
[2043] Fix | Delete
$seopress_get_the_excerpt = wp_trim_words(esc_attr(stripslashes_deep(wp_filter_nohtml_kses(strip_shortcodes($seopress_excerpt)))), $seopress_excerpt_length);
[2044] Fix | Delete
} elseif ($post !='') {
[2045] Fix | Delete
if (get_post_field('post_content', $post->ID) !='') {
[2046] Fix | Delete
$seopress_get_the_excerpt = wp_trim_words(esc_attr(stripslashes_deep(wp_filter_nohtml_kses(strip_shortcodes(get_post_field('post_content', $post->ID))))), $seopress_excerpt_length);
[2047] Fix | Delete
} else {
[2048] Fix | Delete
$seopress_get_the_excerpt = null;
[2049] Fix | Delete
}
[2050] Fix | Delete
} else {
[2051] Fix | Delete
$seopress_get_the_excerpt = null;
[2052] Fix | Delete
}
[2053] Fix | Delete
[2054] Fix | Delete
$woo_single_cat_html ='';
[2055] Fix | Delete
$woo_single_tag_html ='';
[2056] Fix | Delete
$woo_single_price ='';
[2057] Fix | Delete
$woo_single_price_exc_tax ='';
[2058] Fix | Delete
if ( class_exists('WooCommerce') ) {
[2059] Fix | Delete
if (is_product()) {
[2060] Fix | Delete
//Woo Cat product
[2061] Fix | Delete
$woo_single_cats = get_the_terms( $post->ID, 'product_cat' );
[2062] Fix | Delete
[2063] Fix | Delete
if ( $woo_single_cats && ! is_wp_error( $woo_single_cats ) ) {
[2064] Fix | Delete
[2065] Fix | Delete
$woo_single_cat = array();
[2066] Fix | Delete
[2067] Fix | Delete
foreach ( $woo_single_cats as $term ) {
[2068] Fix | Delete
$woo_single_cat[] = $term->name;
[2069] Fix | Delete
}
[2070] Fix | Delete
[2071] Fix | Delete
$woo_single_cat_html = stripslashes_deep(wp_filter_nohtml_kses(join( ", ", $woo_single_cat )));
[2072] Fix | Delete
}
[2073] Fix | Delete
[2074] Fix | Delete
//Woo Tag product
[2075] Fix | Delete
$woo_single_tags = get_the_terms( $post->ID, 'product_tag' );
[2076] Fix | Delete
[2077] Fix | Delete
if ( $woo_single_tags && ! is_wp_error( $woo_single_tags ) ) {
[2078] Fix | Delete
[2079] Fix | Delete
$woo_single_tag = array();
[2080] Fix | Delete
[2081] Fix | Delete
foreach ( $woo_single_tags as $term ) {
[2082] Fix | Delete
$woo_single_tag[] = $term->name;
[2083] Fix | Delete
}
[2084] Fix | Delete
[2085] Fix | Delete
$woo_single_tag_html = stripslashes_deep(wp_filter_nohtml_kses(join( ", ", $woo_single_tag )));
[2086] Fix | Delete
}
[2087] Fix | Delete
[2088] Fix | Delete
//Woo Price
[2089] Fix | Delete
$product = wc_get_product($post->ID);
[2090] Fix | Delete
$woo_single_price = wc_get_price_including_tax( $product );
[2091] Fix | Delete
[2092] Fix | Delete
//Woo Price tax excluded
[2093] Fix | Delete
$product = wc_get_product($post->ID);
[2094] Fix | Delete
$woo_single_price_exc_tax = wc_get_price_excluding_tax( $product );
[2095] Fix | Delete
}
[2096] Fix | Delete
}
[2097] Fix | Delete
$seopress_titles_template_replace_array = array(
[2098] Fix | Delete
$sep,
[2099] Fix | Delete
get_bloginfo('name'),
[2100] Fix | Delete
get_bloginfo('name'),
[2101] Fix | Delete
get_bloginfo('description'),
[2102] Fix | Delete
the_title_attribute('echo=0'),
[2103] Fix | Delete
$seopress_get_the_excerpt,
[2104] Fix | Delete
get_the_date(),
[2105] Fix | Delete
get_the_modified_date(),
[2106] Fix | Delete
$the_author_meta,
[2107] Fix | Delete
$post_category,
[2108] Fix | Delete
$post_tag,
[2109] Fix | Delete
single_cat_title('', false),
[2110] Fix | Delete
wp_trim_words(stripslashes_deep(wp_filter_nohtml_kses(category_description())),$seopress_excerpt_length),
[2111] Fix | Delete
single_tag_title('', false),
[2112] Fix | Delete
wp_trim_words(stripslashes_deep(wp_filter_nohtml_kses(tag_description())),$seopress_excerpt_length),
[2113] Fix | Delete
single_term_title('', false),
[2114] Fix | Delete
wp_trim_words(stripslashes_deep(wp_filter_nohtml_kses(term_description())),$seopress_excerpt_length),
[2115] Fix | Delete
$get_search_query,
[2116] Fix | Delete
$seopress_paged,
[2117] Fix | Delete
post_type_archive_title('', false),
[2118] Fix | Delete
get_the_archive_title(),
[2119] Fix | Delete
get_the_archive_title(),
[2120] Fix | Delete
esc_attr(get_query_var('day')),
[2121] Fix | Delete
esc_attr(get_query_var('monthnum')),
[2122] Fix | Delete
esc_attr(get_query_var('year')),
[2123] Fix | Delete
$woo_single_cat_html,
[2124] Fix | Delete
$woo_single_tag_html,
[2125] Fix | Delete
$seopress_get_the_excerpt,
[2126] Fix | Delete
$woo_single_price,
[2127] Fix | Delete
$woo_single_price_exc_tax,
[2128] Fix | Delete
date_i18n('j'),
[2129] Fix | Delete
date_i18n('F'),
[2130] Fix | Delete
date('Y'),
[2131] Fix | Delete
date_i18n( get_option( 'date_format' )),
[2132] Fix | Delete
current_time(get_option( 'time_format' )),
[2133] Fix | Delete
);
[2134] Fix | Delete
$seopress_titles_title_template = str_replace($seopress_titles_template_variables_array, $seopress_titles_template_replace_array, $title);
[2135] Fix | Delete
return $seopress_titles_title_template;
[2136] Fix | Delete
}
[2137] Fix | Delete
// Squirrly SEO Compatibility #3421
[2138] Fix | Delete
add_filter('sq_current_post', 'ampforwp_sq_current_post');
[2139] Fix | Delete
function ampforwp_sq_current_post($post){
[2140] Fix | Delete
if ( 'squirrly' == ampforwp_get_setting('ampforwp-seo-selection') && ampforwp_is_amp_endpoint() && ( ampforwp_is_front_page() || ampforwp_is_blog() ) ){
[2141] Fix | Delete
$post = get_post(ampforwp_get_the_ID());
[2142] Fix | Delete
}
[2143] Fix | Delete
return $post;
[2144] Fix | Delete
}
[2145] Fix | Delete
function ampforwp_modify_archive_title( $title ) {
[2146] Fix | Delete
if ( is_category() ) {
[2147] Fix | Delete
$title = single_cat_title( '', false );
[2148] Fix | Delete
} elseif ( is_tag() ) {
[2149] Fix | Delete
$title = single_tag_title( '', false );
[2150] Fix | Delete
} elseif ( is_author() ) {
[2151] Fix | Delete
if(!get_the_author() && function_exists('get_the_coauthor_meta'))
[2152] Fix | Delete
{
[2153] Fix | Delete
$title = '<span class="vcard">' . ampforwp_get_coauthor_meta('display_name') . '</span>';
[2154] Fix | Delete
}
[2155] Fix | Delete
else{
[2156] Fix | Delete
$title = '<span class="vcard">' . get_the_author() . '</span>';
[2157] Fix | Delete
}
[2158] Fix | Delete
[2159] Fix | Delete
} elseif ( is_post_type_archive() ) {
[2160] Fix | Delete
$title = post_type_archive_title( '', false );
[2161] Fix | Delete
} elseif ( is_tax() ) {
[2162] Fix | Delete
$title = single_term_title( '', false );
[2163] Fix | Delete
}
[2164] Fix | Delete
return $title;
[2165] Fix | Delete
}
[2166] Fix | Delete
add_action( 'pre_amp_render_post', 'ampforwp_modify_archive_title_in_amp');
[2167] Fix | Delete
function ampforwp_modify_archive_title_in_amp() {
[2168] Fix | Delete
add_filter( 'get_the_archive_title', 'ampforwp_modify_archive_title' );
[2169] Fix | Delete
}
[2170] Fix | Delete
// 27. Clean the Defer issue
[2171] Fix | Delete
// Moved to functions.php
[2172] Fix | Delete
[2173] Fix | Delete
// 28. Properly removes AMP if turned off from Post panel
[2174] Fix | Delete
add_filter( 'amp_skip_post', 'ampforwp_skip_amp_post', 10, 3 );
[2175] Fix | Delete
function ampforwp_skip_amp_post( $skip, $post_id, $post ) {
[2176] Fix | Delete
$ampforwp_amp_post_on_off_meta = get_post_meta( $post->ID , 'ampforwp-amp-on-off' , true );
[2177] Fix | Delete
if( $ampforwp_amp_post_on_off_meta === 'hide-amp' ) {
[2178] Fix | Delete
$skip = true;
[2179] Fix | Delete
}
[2180] Fix | Delete
return $skip;
[2181] Fix | Delete
}
[2182] Fix | Delete
[2183] Fix | Delete
//30. TagDiv menu issue removed
[2184] Fix | Delete
add_action('init','ampforwp_remove_tagdiv_mobile_menu');
[2185] Fix | Delete
function ampforwp_remove_tagdiv_mobile_menu() {
[2186] Fix | Delete
if( class_exists( 'Mobile_Detect' )) {
[2187] Fix | Delete
remove_action('option_stylesheet', array('td_mobile_theme', 'mobile'));
[2188] Fix | Delete
}
[2189] Fix | Delete
}
[2190] Fix | Delete
[2191] Fix | Delete
//31. removing scripts added by cleantalk and
[2192] Fix | Delete
// #525 WordPress Twitter Bootstrap CSS
[2193] Fix | Delete
add_action('amp_init','ampforwp_remove_js_script_cleantalk');
[2194] Fix | Delete
function ampforwp_remove_js_script_cleantalk() {
[2195] Fix | Delete
$current_url = '';
[2196] Fix | Delete
$amp_check = '';
[2197] Fix | Delete
[2198] Fix | Delete
$current_url = $_SERVER['REQUEST_URI'];
[2199] Fix | Delete
$current_url = explode('/', $current_url);
[2200] Fix | Delete
$current_url = array_filter($current_url);
[2201] Fix | Delete
$amp_check = in_array('amp', $current_url);
[2202] Fix | Delete
if ( true === $amp_check ) {
[2203] Fix | Delete
ampforwp_remove_filters_for_class( 'wp_loaded', 'ICWP_WPTB_CssProcessor', 'onWpLoaded', 0 );
[2204] Fix | Delete
}
[2205] Fix | Delete
[2206] Fix | Delete
remove_action('wp_loaded', 'ct_add_nocache_script', 1);
[2207] Fix | Delete
[2208] Fix | Delete
}
[2209] Fix | Delete
[2210] Fix | Delete
//32. various lazy loading plugins Support
[2211] Fix | Delete
add_filter( 'amp_init', 'ampforwp_lazy_loading_plugins_compatibility' );
[2212] Fix | Delete
function ampforwp_lazy_loading_plugins_compatibility() {
[2213] Fix | Delete
[2214] Fix | Delete
// Disable HTTP protocol removing on script, link, img, srcset and form tags.
[2215] Fix | Delete
remove_filter( 'rocket_buffer', '__rocket_protocol_rewrite', PHP_INT_MAX );
[2216] Fix | Delete
remove_filter( 'wp_calculate_image_srcset', '__rocket_protocol_rewrite_srcset', PHP_INT_MAX );
[2217] Fix | Delete
if(function_exists('magplus_after_setup')){
[2218] Fix | Delete
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
[2219] Fix | Delete
if( function_exists('ampforwp_is_amp_inURL') && ampforwp_is_amp_inURL($url_path)) {
[2220] Fix | Delete
remove_action( 'template_redirect', 'magplus_pagination_redirect' );
[2221] Fix | Delete
}
[2222] Fix | Delete
}
[2223] Fix | Delete
//Lazy Load XT
[2224] Fix | Delete
global $lazyloadxt;
[2225] Fix | Delete
remove_filter( 'the_content', array( $lazyloadxt, 'filter_html' ) );
[2226] Fix | Delete
remove_filter( 'widget_text', array( $lazyloadxt, 'filter_html' ) );
[2227] Fix | Delete
remove_filter( 'post_thumbnail_html', array( $lazyloadxt, 'filter_html' ) );
[2228] Fix | Delete
remove_filter( 'get_avatar', array( $lazyloadxt, 'filter_html' ) );
[2229] Fix | Delete
}
[2230] Fix | Delete
[2231] Fix | Delete
//Removing bj loading for amp
[2232] Fix | Delete
function ampforwp_remove_bj_load() {
[2233] Fix | Delete
if ( function_exists( 'ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint() ) {
[2234] Fix | Delete
add_filter( 'bjll/enabled', '__return_false' );
[2235] Fix | Delete
}
[2236] Fix | Delete
}
[2237] Fix | Delete
add_action( 'bjll/compat', 'ampforwp_remove_bj_load' );
[2238] Fix | Delete
[2239] Fix | Delete
add_action('wp','ampforwp_remove_wp_actions',9);
[2240] Fix | Delete
function ampforwp_remove_wp_actions(){
[2241] Fix | Delete
//Disable Crazy Lazy for AMP #751
[2242] Fix | Delete
if( ampforwp_is_amp_endpoint() ){
[2243] Fix | Delete
remove_action( 'wp', array( 'CrazyLazy', 'instance' ) );
[2244] Fix | Delete
}
[2245] Fix | Delete
// Removing Marfeel plugin which was blocking internal pages of AMP #2423
[2246] Fix | Delete
remove_action('wp', 'render_marfeel_amp_content' );
[2247] Fix | Delete
}
[2248] Fix | Delete
//33. Google tag manager support added
[2249] Fix | Delete
// Moved to analytics-functions.php
[2250] Fix | Delete
[2251] Fix | Delete
//34. social share boost compatibility Ticket #387
[2252] Fix | Delete
function social_sharing_removal_code() {
[2253] Fix | Delete
remove_filter('the_content','ssb_in_content');
[2254] Fix | Delete
}
[2255] Fix | Delete
add_action('amp_init','social_sharing_removal_code', 9);
[2256] Fix | Delete
[2257] Fix | Delete
[2258] Fix | Delete
//35. Disqus Comments Support
[2259] Fix | Delete
add_action('ampforwp_post_after_design_elements','ampforwp_add_disqus_support');
[2260] Fix | Delete
function ampforwp_add_disqus_support() {
[2261] Fix | Delete
global $redux_builder_amp;
[2262] Fix | Delete
$width = $height = 420;
[2263] Fix | Delete
$layout = "";
[2264] Fix | Delete
$layout = 'responsive';
[2265] Fix | Delete
$display_comments_on = "";
[2266] Fix | Delete
$display_comments_on = ampforwp_get_comments_status();
[2267] Fix | Delete
if ( isset($redux_builder_amp['ampforwp-disqus-layout']) && 'fixed' == $redux_builder_amp['ampforwp-disqus-layout'] ) {
[2268] Fix | Delete
$layout = 'fixed';
[2269] Fix | Delete
}
[2270] Fix | Delete
$height = ampforwp_get_setting('ampforwp-disqus-height');
[2271] Fix | Delete
if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && 4 != $redux_builder_amp['amp-design-selector'] && $display_comments_on ) {
[2272] Fix | Delete
if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
[2273] Fix | Delete
global $post; $post_slug = rawurlencode($post->post_name);
[2274] Fix | Delete
[2275] Fix | Delete
$disqus_script_host_url = "https://ampforwp.appspot.com/?api=". AMPFORWP_DISQUS_URL;
[2276] Fix | Delete
[2277] Fix | Delete
if( $redux_builder_amp['ampforwp-disqus-host-position'] == 0 ) {
[2278] Fix | Delete
$disqus_script_host_url = esc_url( $redux_builder_amp['ampforwp-disqus-host-file'] );
[2279] Fix | Delete
}
[2280] Fix | Delete
[2281] Fix | Delete
$disqus_url = $disqus_script_host_url.'?disqus_title='.$post_slug.'&url='.rawurlencode(get_permalink()).'&disqus_name='. esc_url( $redux_builder_amp['ampforwp-disqus-comments-name'] ) ."/embed.js" ;
[2282] Fix | Delete
?>
[2283] Fix | Delete
<section class="amp-wp-content post-comments amp-wp-article-content amp-disqus-comments" id="comments">
[2284] Fix | Delete
<amp-iframe
[2285] Fix | Delete
height=<?php echo esc_attr($height) ?>
[2286] Fix | Delete
width=<?php echo esc_attr($width) ?>
[2287] Fix | Delete
layout="<?php echo esc_attr($layout) ?>"
[2288] Fix | Delete
sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"
[2289] Fix | Delete
resizable
[2290] Fix | Delete
frameborder="0"
[2291] Fix | Delete
src="<?php echo esc_url($disqus_url) ?>" title="<?php echo esc_html__('Disqus Comments','accelerated-mobile-pages'); ?>">
[2292] Fix | Delete
<div overflow tabindex="0" role="button" aria-label="Read more"><?php echo esc_html__('Disqus Comments Loading...','accelerated-mobile-pages') ?></div>
[2293] Fix | Delete
</amp-iframe>
[2294] Fix | Delete
</section>
[2295] Fix | Delete
<?php
[2296] Fix | Delete
}
[2297] Fix | Delete
}
[2298] Fix | Delete
}
[2299] Fix | Delete
[2300] Fix | Delete
add_filter( 'amp_post_template_data', 'ampforwp_add_disqus_scripts' );
[2301] Fix | Delete
function ampforwp_add_disqus_scripts( $data ) {
[2302] Fix | Delete
global $redux_builder_amp;
[2303] Fix | Delete
if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && is_singular() ) {
[2304] Fix | Delete
if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
[2305] Fix | Delete
if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
[2306] Fix | Delete
$data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
[2307] Fix | Delete
}
[2308] Fix | Delete
}
[2309] Fix | Delete
}
[2310] Fix | Delete
// remove direction attribute from the AMP HTMl #541
[2311] Fix | Delete
unset( $data['html_tag_attributes']['dir'] );
[2312] Fix | Delete
return $data;
[2313] Fix | Delete
}
[2314] Fix | Delete
[2315] Fix | Delete
// Facebook Comments Support #825
[2316] Fix | Delete
[2317] Fix | Delete
add_action('ampforwp_post_after_design_elements','ampforwp_facebook_comments_support');
[2318] Fix | Delete
function ampforwp_facebook_comments_support() {
[2319] Fix | Delete
global $redux_builder_amp;
[2320] Fix | Delete
if ( 4 != $redux_builder_amp['amp-design-selector'] ) {
[2321] Fix | Delete
echo ampforwp_facebook_comments_markup();
[2322] Fix | Delete
}
[2323] Fix | Delete
}
[2324] Fix | Delete
function ampforwp_facebook_comments_markup() {
[2325] Fix | Delete
[2326] Fix | Delete
global $redux_builder_amp;
[2327] Fix | Delete
$facebook_comments_markup = $lang = $locale = '';
[2328] Fix | Delete
$lang = ampforwp_get_setting('ampforwp-fb-comments-lang');
[2329] Fix | Delete
$display_comments_on = "";
[2330] Fix | Delete
$display_comments_on = ampforwp_get_comments_status();
[2331] Fix | Delete
if ( $redux_builder_amp['ampforwp-facebook-comments-support'] && $display_comments_on ) {
[2332] Fix | Delete
[2333] Fix | Delete
$facebook_comments_markup = '<section class="amp-wp-content post-comments amp-wp-article-content amp-facebook-comments" id="comments">';
[2334] Fix | Delete
if(true == ampforwp_get_setting('ampforwp-facebook-comments-title')){
[2335] Fix | Delete
$facebook_comments_markup .= '<h5>'. esc_html__(ampforwp_translation(ampforwp_get_setting('ampforwp-facebook-comments-title'), 'Leave a Comment'),'accelerated-mobile-pages') .'</h5>';
[2336] Fix | Delete
}
[2337] Fix | Delete
$facebook_comments_markup .= '<amp-facebook-comments width=486 height=357
[2338] Fix | Delete
layout="responsive" '.'data-locale = "'.esc_attr($lang).'"'.' data-numposts=';
[2339] Fix | Delete
$facebook_comments_markup .= '"'. esc_attr($redux_builder_amp['ampforwp-number-of-fb-no-of-comments']). '"';
[2340] Fix | Delete
if(ampforwp_get_data_consent()){
[2341] Fix | Delete
$facebook_comments_markup .= ' data-block-on-consent ';
[2342] Fix | Delete
}
[2343] Fix | Delete
$facebook_comments_markup .= 'data-href=" ' . esc_url(get_permalink()) . '"';
[2344] Fix | Delete
$facebook_comments_markup .= '></amp-facebook-comments> </section>';
[2345] Fix | Delete
[2346] Fix | Delete
return $facebook_comments_markup;
[2347] Fix | Delete
}
[2348] Fix | Delete
}
[2349] Fix | Delete
[2350] Fix | Delete
add_filter( 'amp_post_template_data', 'ampforwp_add_fbcomments_scripts' );
[2351] Fix | Delete
function ampforwp_add_fbcomments_scripts( $data ) {
[2352] Fix | Delete
[2353] Fix | Delete
global $redux_builder_amp;
[2354] Fix | Delete
$facebook_comments_check = "";
[2355] Fix | Delete
$facebook_comments_check = ampforwp_facebook_comments_markup();
[2356] Fix | Delete
[2357] Fix | Delete
if ( $facebook_comments_check && $redux_builder_amp['ampforwp-facebook-comments-support'] && ( is_singular() || ampforwp_is_front_page() ) && ( ampforwp_design_selector() == 1 || ampforwp_design_selector() == 2 || ampforwp_design_selector() == 3 )) {
[2358] Fix | Delete
if ( empty( $data['amp_component_scripts']['amp-facebook-comments'] ) ) {
[2359] Fix | Delete
$data['amp_component_scripts']['amp-facebook-comments'] = 'https://cdn.ampproject.org/v0/amp-facebook-comments-0.1.js';
[2360] Fix | Delete
}
[2361] Fix | Delete
}
[2362] Fix | Delete
return $data;
[2363] Fix | Delete
}
[2364] Fix | Delete
[2365] Fix | Delete
//37. compatibility with wp-html-compression
[2366] Fix | Delete
function ampforwp_copat_wp_html_compression() {
[2367] Fix | Delete
remove_action('template_redirect', 'wp_html_compression_start', -1);
[2368] Fix | Delete
remove_action('get_header', 'wp_html_compression_start');
[2369] Fix | Delete
[2370] Fix | Delete
if( class_exists('BunnyCDN') ){
[2371] Fix | Delete
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
[2372] Fix | Delete
if( function_exists('ampforwp_is_amp_inURL') && ampforwp_is_amp_inURL($url_path)) {
[2373] Fix | Delete
//Remove Action to remove CDN URL from BunnyCDN Plugin
[2374] Fix | Delete
remove_action("template_redirect", "doRewrite");
[2375] Fix | Delete
}
[2376] Fix | Delete
}
[2377] Fix | Delete
}
[2378] Fix | Delete
add_action('amp_init','ampforwp_copat_wp_html_compression');
[2379] Fix | Delete
[2380] Fix | Delete
//38. Extra Design Specific Features
[2381] Fix | Delete
add_action('pre_amp_render_post','ampforwp_add_extra_functions',12);
[2382] Fix | Delete
function ampforwp_add_extra_functions() {
[2383] Fix | Delete
global $redux_builder_amp;
[2384] Fix | Delete
if ( $redux_builder_amp['amp-design-selector'] == 3 ) {
[2385] Fix | Delete
require AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-3/functions.php';
[2386] Fix | Delete
}
[2387] Fix | Delete
}
[2388] Fix | Delete
[2389] Fix | Delete
//38. #529 editable archives
[2390] Fix | Delete
add_filter( 'get_the_archive_title', 'ampforwp_editable_archvies_title' );
[2391] Fix | Delete
function ampforwp_editable_archvies_title($title) {
[2392] Fix | Delete
global $redux_builder_amp;
[2393] Fix | Delete
$ampforwp_is_amp_endpoint = ampforwp_is_amp_endpoint();
[2394] Fix | Delete
[2395] Fix | Delete
if ( $ampforwp_is_amp_endpoint){
[2396] Fix | Delete
if ( is_category() ) {
[2397] Fix | Delete
$title = single_cat_title( ampforwp_translation($redux_builder_amp['amp-translator-archive-cat-text'], 'Category (archive title)').' ', false );
[2398] Fix | Delete
} elseif ( is_tag() ) {
[2399] Fix | Delete
$title = single_tag_title( ampforwp_translation($redux_builder_amp['amp-translator-archive-tag-text'], 'Tag (archive title)').' ', false );
[2400] Fix | Delete
}
[2401] Fix | Delete
}
[2402] Fix | Delete
return $title;
[2403] Fix | Delete
}
[2404] Fix | Delete
[2405] Fix | Delete
//39. #560 Header and Footer Editable html enabled script area
[2406] Fix | Delete
add_action('amp_post_template_footer','ampforwp_footer_html_output',11);
[2407] Fix | Delete
function ampforwp_footer_html_output() {
[2408] Fix | Delete
if(true == ampforwp_get_setting('ampforwp-footer-top')){
[2409] Fix | Delete
amp_back_to_top_link();
[2410] Fix | Delete
}
[2411] Fix | Delete
if( ampforwp_get_setting('amp-footer-text-area-for-html') ) {
[2412] Fix | Delete
echo ampforwp_get_setting('amp-footer-text-area-for-html') ;
[2413] Fix | Delete
}
[2414] Fix | Delete
//Quantcast Support #4951
[2415] Fix | Delete
if (ampforwp_get_setting('amp-quantcast-notice-switch')) {
[2416] Fix | Delete
$id = $hashcode = $country = $name = '';
[2417] Fix | Delete
$id = ampforwp_get_setting('amp-quantcast-id');
[2418] Fix | Delete
$hashcode = ampforwp_get_setting('amp-quantcast-hashcode');
[2419] Fix | Delete
$country = ampforwp_get_setting('amp-quantcast-publishercountrycode');
[2420] Fix | Delete
$name = ampforwp_get_setting('amp-quantcast-publishername');
[2421] Fix | Delete
$privacy = ampforwp_get_setting('amp-quantcast-privacy-mode');
[2422] Fix | Delete
$lang = ampforwp_get_setting('amp-quantcast-lang');
[2423] Fix | Delete
if (empty($privacy)) {
[2424] Fix | Delete
$privacy = 'GDPR';
[2425] Fix | Delete
}
[2426] Fix | Delete
if (empty($lang)) {
[2427] Fix | Delete
$lang = 'en';
[2428] Fix | Delete
}
[2429] Fix | Delete
[2430] Fix | Delete
if (!empty($id) && !empty($hashcode) && !empty($country) && !empty($name) ) {?>
[2431] Fix | Delete
<amp-consent id="quantcast" layout="nodisplay">
[2432] Fix | Delete
<script type="application/json">
[2433] Fix | Delete
{
[2434] Fix | Delete
"consentInstanceId": "quantcast",
[2435] Fix | Delete
"checkConsentHref": "https://apis.quantcast.mgr.consensu.org/amp/check-consent",
[2436] Fix | Delete
"consentRequired": "remote",
[2437] Fix | Delete
"promptUISrc": "https://quantcast.mgr.consensu.org/tcfv2/amp.html",
[2438] Fix | Delete
"clientConfig": {
[2439] Fix | Delete
"coreConfig": {
[2440] Fix | Delete
"quantcastAccountId": "<?php echo esc_html($id); ?>",
[2441] Fix | Delete
"privacyMode": ["<?php echo esc_html($privacy); ?>"],
[2442] Fix | Delete
"hashCode": "<?php echo esc_html($hashcode); ?>",
[2443] Fix | Delete
"publisherCountryCode": "<?php echo esc_html($country); ?>",
[2444] Fix | Delete
"publisherName": "<?php echo esc_html($name); ?>",
[2445] Fix | Delete
"vendorPurposeIds": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
[2446] Fix | Delete
"vendorFeaturesIds": [1, 2, 3],
[2447] Fix | Delete
"vendorPurposeLegitimateInterestIds": [2, 3, 4, 5, 6, 7, 8, 9, 10],
[2448] Fix | Delete
"vendorSpecialFeaturesIds": [1, 2],
[2449] Fix | Delete
"vendorSpecialPurposesIds": [1, 2],
[2450] Fix | Delete
"googleEnabled": false,
[2451] Fix | Delete
"lang_": "<?php echo esc_html($lang); ?>",
[2452] Fix | Delete
"displayUi": "always",
[2453] Fix | Delete
"publisherConsentRestrictionIds": [],
[2454] Fix | Delete
"publisherLIRestrictionIds": [],
[2455] Fix | Delete
"publisherPurposeIds": [],
[2456] Fix | Delete
"publisherPurposeLegitimateInterestIds": [],
[2457] Fix | Delete
"publisherSpecialPurposesIds": [],
[2458] Fix | Delete
"publisherFeaturesIds": [],
[2459] Fix | Delete
"publisherSpecialFeaturesIds": [],
[2460] Fix | Delete
"stacks": [1, 42],
[2461] Fix | Delete
"vendorListUpdateFreq": 30
[2462] Fix | Delete
}
[2463] Fix | Delete
}
[2464] Fix | Delete
}
[2465] Fix | Delete
</script>
[2466] Fix | Delete
<!-- PRIVACY BUTTON LOWER RIGHT -->
[2467] Fix | Delete
<div id="postPromptUI">
[2468] Fix | Delete
<button role="button" on="tap:quantcast.prompt()">
[2469] Fix | Delete
<svg style="height:20px">
[2470] Fix | Delete
<g fill="none">
[2471] Fix | Delete
<g fill="#FFF">
[2472] Fix | Delete
<path
[2473] Fix | Delete
d="M16 10L15 9C15 9 15 8 15 8L16 7C16 7 16 6 16 6 16
[2474] Fix | Delete
5 15 4 14 3 14 2 13 2 13 3L12 3C12 3 11 3 11 2L11 1C11 1 10 0 10 0 9 0 7 0 6 0 6 0
[2475] Fix | Delete
5 1 5 1L5 2C5 3 4 3 4 3L3 3C3 2 2 2 2 3 1 4 0 5 0 6 0 6 0 7 0 7L1 8C1 8 1 9 1 9L0
[2476] Fix | Delete
10C0 10 0 11 0 11 0 12 1 13 2 14 2 15 3 15 3 14L4 14C4 14 5 14 5 15L5 16C5 16 6 17
[2477] Fix | Delete
6 17 7 17 9 17 10 17 10 17 11 16 11 16L11 15C11 14 12 14 12 14L13 14C13 15 14 15 14
[2478] Fix | Delete
14 15 13 16 12 16 11 16 11 16 10 16 10ZM13 13L12 13C11 13 11 13 9 14L9 16C9 16 7 16 7
[2479] Fix | Delete
16L7 14C5 14 5 13 4 13L3 13C2 13 1 12 1 11L3 10C2 9 2 8 3 7L1 6C1 5 2 4 3 4L4 4C5 4 5
[2480] Fix | Delete
3 7 3L7 1C7 1 9 1 9 1L9 3C11 3 11 4 12 4L13 4C14 4 15 5 15 6L13 7C14 8 14 9 13 10L15
[2481] Fix | Delete
11C15 12 14 13 13 13ZM8 5C6 5 5 7 5 9 5 10 6 12 8 12 10 12 11 10 11 9 11 7 10 5 8 5ZM8
[2482] Fix | Delete
11C7 11 6 10 6 9 6 7 7 6 8 6 9 6 10 7 10 9 10 10 9 11 8 11Z" />
[2483] Fix | Delete
</g>
[2484] Fix | Delete
</g>
[2485] Fix | Delete
</svg>
[2486] Fix | Delete
PRIVACY
[2487] Fix | Delete
</button>
[2488] Fix | Delete
</div>
[2489] Fix | Delete
</amp-consent>
[2490] Fix | Delete
<amp-geo layout="nodisplay">
[2491] Fix | Delete
<script type="application/json">
[2492] Fix | Delete
{
[2493] Fix | Delete
"ISOCountryGroups": {
[2494] Fix | Delete
"<?php echo esc_html($country); ?>": ["<?php echo esc_html($country); ?>"]
[2495] Fix | Delete
}
[2496] Fix | Delete
}
[2497] Fix | Delete
</script>
[2498] Fix | Delete
</amp-geo>
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function