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
/home/sportsfe.../httpdocs/wp-conte.../plugins/accelera.../includes/vendor/amp/includes
File: amp-helper-functions.php
<?php
[0] Fix | Delete
namespace AMPforWP\AMPVendor;
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[2] Fix | Delete
exit;
[3] Fix | Delete
}
[4] Fix | Delete
function amp_get_permalink( $post_id ) {
[5] Fix | Delete
$pre_url = apply_filters( 'amp_pre_get_permalink', false, $post_id );
[6] Fix | Delete
$amp_url = '';
[7] Fix | Delete
if ( false !== $pre_url ) {
[8] Fix | Delete
return $pre_url;
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
$structure = get_option( 'permalink_structure' );
[12] Fix | Delete
if ( empty( $structure ) ) {
[13] Fix | Delete
$amp_url = add_query_arg( AMP_QUERY_VAR, 1, get_permalink( $post_id ) );
[14] Fix | Delete
} else {
[15] Fix | Delete
$get_permalink = get_permalink( $post_id );
[16] Fix | Delete
if( $get_permalink != false){
[17] Fix | Delete
$amp_url = trailingslashit( $get_permalink );
[18] Fix | Delete
$amp_url = ampforwp_end_point_controller($amp_url);
[19] Fix | Delete
}
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
return apply_filters( 'amp_get_permalink', $amp_url, $post_id );
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
function post_supports_amp( $post ) {
[26] Fix | Delete
// checking for $post->ID and $post->post_type since dynamically generated pages does not have these value set
[27] Fix | Delete
if(isset($post))
[28] Fix | Delete
{
[29] Fix | Delete
// Because `add_rewrite_endpoint` doesn't let us target specific post_types :(
[30] Fix | Delete
if ( isset($post->post_type) && ! post_type_supports( $post->post_type, AMP_QUERY_VAR ) ) {
[31] Fix | Delete
return false;
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
if ( post_password_required( $post ) ) {
[35] Fix | Delete
return false;
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
if ( isset($post->ID) && true === apply_filters( 'amp_skip_post', false, $post->ID, $post ) ) {
[39] Fix | Delete
return false;
[40] Fix | Delete
}
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
return true;
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
/**
[47] Fix | Delete
* Are we currently on an AMP URL?
[48] Fix | Delete
*
[49] Fix | Delete
* Note: will always return `false` if called before the `parse_query` hook.
[50] Fix | Delete
*/
[51] Fix | Delete
function is_amp_endpoint() {
[52] Fix | Delete
return false !== get_query_var( AMP_QUERY_VAR, false );
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
function amp_get_asset_url( $file ) {
[56] Fix | Delete
return plugins_url( sprintf( 'assets/%s', $file ), AMPFORWP__FILE__ );
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function