All_in_One_SEO_Pack_Compatibility

Class All_in_One_SEO_Pack_Compatibility.

Defined (1)

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

/inc/compatability/compat-init.php  
  1. class All_in_One_SEO_Pack_Compatibility { 
  2.  
  3. /** 
  4. * All_in_One_SEO_Pack_Compatibility constructor. 
  5. * @since 2.3.6 
  6. */ 
  7. public function __construct() { 
  8.  
  9. $this->load_compatibility_classes(); 
  10.  
  11.  
  12. /** 
  13. * Load Compatibility Hooks. 
  14. * @since 2.3.6 
  15. */ 
  16. public function load_compatibility_hooks() { 
  17. // We'll use this until we set up our classes. 
  18. if ( class_exists( 'jetpack' ) ) { 
  19. add_filter( 'jetpack_get_available_modules', array( $this, 'remove_jetpack_sitemap' ) ); 
  20. add_filter( 'jetpack_site_verification_output', array( 
  21. $this,  
  22. 'filter_jetpack_site_verification_output',  
  23. ), 10, 1 ); 
  24.  
  25. /** 
  26. * Filter Jetpack's site verification. 
  27. * If we have a value for a particular verification, use ours. 
  28. * @param $ver_tag 
  29. * @since 2.3.7 
  30. * @return string 
  31. */ 
  32. function filter_jetpack_site_verification_output( $ver_tag ) { 
  33.  
  34. global $aioseop_options; 
  35.  
  36. if ( isset( $aioseop_options['aiosp_pinterest_verify'] ) && ! empty( $aioseop_options['aiosp_pinterest_verify'] ) && strpos( $ver_tag, 'p:domain_verify' ) ) { 
  37. return ''; 
  38.  
  39.  
  40. if ( isset( $aioseop_options['aiosp_google_verify'] ) && ! empty( $aioseop_options['aiosp_google_verify'] ) && strpos( $ver_tag, 'google-site-verification' ) ) { 
  41. return ''; 
  42.  
  43. if ( isset( $aioseop_options['aiosp_bing_verify'] ) && ! empty( $aioseop_options['aiosp_bing_verify'] ) && strpos( $ver_tag, 'msvalidate.01' ) ) { 
  44. return ''; 
  45.  
  46. return $ver_tag; 
  47.  
  48.  
  49. /** 
  50. * Remove Jetpack's sitemap. 
  51. * @param array $modules All the Jetpack modules. 
  52. * @since 2.3.6 
  53. * @since 2.3.6.1 Make sure we only disable Jetpack's sitemap if they're using ours. 
  54. * @return array 
  55. */ 
  56. public function remove_jetpack_sitemap( $modules ) { 
  57.  
  58. global $aioseop_options; 
  59. // Check if AIOSEOP's sitemap exists. 
  60. if ( isset( $aioseop_options['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_sitemap'] ) && $aioseop_options['modules']['aiosp_feature_manager_options']['aiosp_feature_manager_enable_sitemap'] === 'on' ) { 
  61. unset( $modules['sitemaps'] ); // Remove Jetpack's sitemap. 
  62.  
  63. return $modules; 
  64.  
  65. /** 
  66. * Load Compatibility classes. 
  67. * @since 2.3.6 
  68. */ 
  69. public function load_compatibility_classes() { 
  70. // Eventually we'll load our other classes from here. 
  71. $this->load_compatibility_hooks();