gglstmp_del_site

The Google Sitemap by BestWebSoft gglstmp del site function.

Description

gglstmp_del_site( $gglstmp_wmt, $gglstmp_sv ); 

Parameters (2)

0. $gglstmp_wmt
The gglstmp wmt.
1. $gglstmp_sv
The gglstmp sv.

Usage

  1. if ( !function_exists( 'gglstmp_del_site' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-sitemap-by-bestwebsoft/google-sitemap-plugin.php'; 
  3.  
  4. // The gglstmp wmt. 
  5. $gglstmp_wmt = null; 
  6.  
  7. // The gglstmp sv. 
  8. $gglstmp_sv = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = gglstmp_del_site($gglstmp_wmt, $gglstmp_sv); 
  12.  

Defined (1)

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

/google-sitemap-plugin.php  
  1. function gglstmp_del_site( $gglstmp_wmt, $gglstmp_sv ) { 
  2. global $gglstmp_settings; 
  3.  
  4. $gglstmp_url_home = home_url( '/' ); 
  5.  
  6. echo '<h3 style="font-size: 1em;">' . sprintf( __( 'Site info for %s', 'google-sitemap-plugin' ), '<a href="' . $gglstmp_url_home . '" target="_blank">' . $gglstmp_url_home . '</a>' ) . ':</h3><div class="gglstmp_wmt_content">'; 
  7.  
  8. try { 
  9. $gglstmp_wmt_sitemaps = $gglstmp_wmt->sitemaps->listSitemaps( $gglstmp_url_home )->getSitemap(); 
  10. foreach ( $gglstmp_wmt_sitemaps as $gglstmp_wmt_sitemap ) { 
  11. try { 
  12. $gglstmp_wmt->sitemaps->delete( $gglstmp_url_home, $gglstmp_wmt_sitemap->path ); 
  13. } catch ( Google_Service_Exception $e ) {} 
  14. } catch ( Google_Service_Exception $e ) {} 
  15. try { 
  16. $gglstmp_wmt->sites->delete( $gglstmp_url_home ); 
  17. printf( '<div>%s.</div>', __( 'This site has been successfully deleted from Google Webmaster Tools', 'google-sitemap-plugin' ) ); 
  18. unset( $gglstmp_settings['site_vererification_code'] ); 
  19. update_option( 'gglstmp_settings', $gglstmp_settings ); 
  20.  
  21. } catch ( Google_Service_Exception $e ) { 
  22. printf( '<div>%s.</div>', __( 'This site has not been added to Google Webmaster Tools', 'google-sitemap-plugin') ); 
  23. echo '</div><!-- .gglstmp_wmt_content -->';