Support » Plugin: Amazon Associates Link Builder » is_amp_endpoint() inside tracking_api_helper.php

  • DrLightman

    (@drlightman)


    
        public function insert_pixel( $impression_params ) {
            $body = json_decode( $impression_params, true );
            $pixel_url = $body["pixel-url"];
            if ( ! is_amp_endpoint() ) {
                echo '<img src="' . $pixel_url . '" style="display:none"></img>';
            }
        }
    

    I see you don’t perform a proper function_exists('is_amp_endpoint') before using is_amp_endpoint() so this code may trigger a Fatal Error if AMP plugin is not active.

    • This topic was modified 8 months ago by DrLightman.
  • The topic ‘is_amp_endpoint() inside tracking_api_helper.php’ is closed to new replies.