woocommerce_category_based_sitemaps

The Woocommerce Category based sitemaps woocommerce category based sitemaps class.

Defined (1)

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

/classes/class-admin-settings.php  
  1. class woocommerce_category_based_sitemaps { 
  2.  
  3.  
  4.  
  5. public function __construct() { 
  6.  
  7. add_action('admin_enqueue_scripts', array(&$this, 'wccs_register_scripts')); 
  8. add_action('admin_init', array(&$this, 'woocommerce_sitemap_register_settings')); 
  9. add_action('admin_menu', array(&$this, 'wccs_admin_menu'), 99); 
  10. add_action('wp_ajax_wcgenerate_sitemap', array(&$this, 'wccs_ajax_sitemap_generate')); 
  11. add_action('wp_ajax_wccsping_sitemap', array(&$this, 'wccsping_sitemap')); 
  12.  
  13.  
  14. public function wccs_register_scripts() { 
  15. wp_register_script( 'wccs', ''.wccs_PLUGIN_URL.'js/wccs.js' ); 
  16. wp_register_style ( 'wccs', ''.wccs_PLUGIN_URL.'css/wccs.css' ); 
  17.  
  18. public function wccs_admin_menu() { 
  19. $slug = add_submenu_page( 'woocommerce', __('Sitemaps'), __('Sitemaps'), 'manage_woocommerce', 'wc_category_sitemaps', array(&$this, 'woocategory_based_sitemap')); 
  20.  
  21. public function woocategory_based_sitemap() { 
  22. wp_enqueue_script('wccs'); 
  23. wp_enqueue_style('wccs'); 
  24. include ('admin-form.php'); 
  25.  
  26. public function woocommerce_sitemap_register_settings() { 
  27.  
  28. register_setting('wccs_settings_group', 'wccs_settings'); 
  29.  
  30.  
  31. public function wccs_ajax_sitemap_generate() { 
  32. $this->wccs_generate_sitemap(); 
  33. die(); 
  34.  
  35. public function wccsping_sitemap() { 
  36. $this->wccs_ping_sitemap_process(); 
  37. die(); 
  38.  
  39. public function wccs_generate_sitemap() { 
  40. wccs_generate_sitemap_function(); 
  41. global $wccs_options; 
  42. if ( isset($wccs_options['xmltitle']) && $wccs_options['xmltitlename'] !='' ) 
  43. {  
  44. if ( isset($wccs_options['folder']) && $wccs_options['foldername'] !='' ) { 
  45. $indexsitemapname=''.$wccs_options['foldername'].'/'.$wccs_options['xmltitlename'].'.xml'; 
  46. } else { 
  47. $indexsitemapname=''.$wccs_options['xmltitlename'].'.xml'; 
  48. } else { 
  49.  
  50. if ( isset($wccs_options['folder']) && $wccs_options['foldername'] !='' ) { 
  51. $indexsitemapname=''.$wccs_options['foldername'].'/product_category_index.xml'; 
  52. } else { 
  53. $indexsitemapname='product_category_index.xml'; 
  54.  
  55. echo 'Your <a href="'.site_url().'/'.$indexsitemapname.'">'.$indexsitemapname.'</a> sitemap has been updated successfully.'; 
  56.  
  57. public function wccs_ping_sitemap_process() { 
  58. wccs_ping_sitemap_function(); 
  59.  
  60.  
  61.  
  62.  
  63.