aioseop_mrt_exclude_this_page

The All In One SEO Pack aioseop mrt exclude this page function.

Description

aioseop_mrt_exclude_this_page( (null) $url = null ); 

Parameters (1)

0. $url — Optional. (null) => null
The url.

Usage

  1. if ( !function_exists( 'aioseop_mrt_exclude_this_page' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'all-in-one-seo-pack/inc/aioseop_functions.php'; 
  3.  
  4. // The url. 
  5. $url = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = aioseop_mrt_exclude_this_page($url); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/aioseop_functions.php  
  1. function aioseop_mrt_exclude_this_page( $url = null ) { 
  2. static $excluded = false; 
  3. if ( $excluded === false ) { 
  4. global $aioseop_options; 
  5. $ex_pages = ''; 
  6. if ( isset( $aioseop_options['aiosp_ex_pages'] ) ) { 
  7. $ex_pages = trim( $aioseop_options['aiosp_ex_pages'] ); 
  8. if ( ! empty( $ex_pages ) ) { 
  9. $excluded = explode( ', ', $ex_pages ); 
  10. if ( ! empty( $excluded ) ) { 
  11. foreach ( $excluded as $k => $v ) { 
  12. $excluded[ $k ] = trim( $v ); 
  13. if ( empty( $excluded[ $k ] ) ) { 
  14. unset( $excluded[ $k ] ); 
  15. if ( empty( $excluded ) ) { 
  16. $excluded = null; 
  17. if ( ! empty( $excluded ) ) { 
  18. if ( $url === null ) { 
  19. $url = $_SERVER['REQUEST_URI']; 
  20. } else { 
  21. $url = parse_url( $url ); 
  22. if ( ! empty( $url['path'] ) ) { 
  23. $url = $url['path']; 
  24. } else { 
  25. return false; 
  26. if ( ! empty( $url ) ) { 
  27. foreach ( $excluded as $exedd ) { 
  28. if ( $exedd && ( stripos( $url, $exedd ) !== false ) ) { 
  29. return true; 
  30.  
  31. return false;