remove shortcode pagination for specific url referrer

Question

i want to remove pagination (pagination shortcode ) in post form specific url referrer like google,
i tried with this code but is not working for pagination shortcode < !--nextpage-- > , it is working for others shortcodes !!!

add_action('get_header', 'my_referrer_check');

function my_referrer_check ()
 {
$referer_parse = parse_url($_SERVER['HTTP_REFERER']); 
if(strpos($referer_parse['host'], 'google.com') ==true)
  {
  add_filter( 'the_content','remove_shortcode' );   
  }
 }
function remove_shortcode( $content ) 
{
  $content = strip_shortcodes( $content );
  return $content;
}
0
Nail Otmane 3 years 2020-03-29T16:53:34-05:00 0 Answers 87 views 0

Leave an answer

Browse
Browse