sitemap_tab_options

Function to add writepanel tabs field options since version 1.0.0.

Description

sitemap_tab_options(); 

Usage

  1. if ( !function_exists( 'sitemap_tab_options' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-category-based-sitemaps/includes/wccs-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = sitemap_tab_options(); 
  7.  

Defined (1)

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

/includes/wccs-functions.php  
  1. function sitemap_tab_options() { 
  2. global $post; 
  3. global $wccs_options; 
  4.  
  5.  
  6.  
  7.  
  8.  
  9. $sitemap_tab_options = array( 
  10. 'priority' => get_post_meta($post->ID, '_sitemappriority', true),  
  11. 'change' => get_post_meta($post->ID, '_sitemapchange', true),  
  12. 'exclude' => get_post_meta($post->ID, '_sitemapexclude', true) 
  13. ); 
  14.  
  15. if ($sitemap_tab_options['priority'] == '') { 
  16. if ( (isset($wccs_options['productpriority'])) && ($wccs_options['productpriority'] != '' ) ) { 
  17. $sitemap_tab_options['priority']=$wccs_options['productpriority'];  
  18. } else { 
  19. $sitemap_tab_options['priority']='0.5'; 
  20. if ($sitemap_tab_options['change'] == '') { 
  21.  
  22. if ( (isset($wccs_options['productchange'])) && ($wccs_options['productchange'] != '' ) ) { 
  23. $sitemap_tab_options['change']=$wccs_options['productchange']; 
  24. } else { 
  25. $sitemap_tab_options['change']='monthly'; 
  26. ?> 
  27. <div id="sitemap_tab_data" class="panel woocommerce_options_panel"> 
  28. <div class="options_group"> 
  29. <p class="form-field"> 
  30. <?php woocommerce_wp_checkbox( array( 'id' => '_sitemapexclude', 'label' => __('Exclude from sitemap', 'wccs'), 'description' => __('Enable this option to prevent this product entry into sitemap.', 'wccs') ) ); ?> 
  31. </p> 
  32.  
  33.  
  34.  
  35. <p class="form-field"> 
  36. <label><?php _e('Priority:', 'wccs'); ?></label> 
  37.  
  38. <select id="_sitemappriority" name="_sitemappriority"> 
  39. <option value="0.0" <?php selected($sitemap_tab_options['priority'], '0.0'); ?>>0.0</option> 
  40. <option value="0.1" <?php selected($sitemap_tab_options['priority'], '0.1'); ?>>0.1</option> 
  41. <option value="0.2" <?php selected($sitemap_tab_options['priority'], '0.2'); ?>>0.2</option> 
  42. <option value="0.3" <?php selected($sitemap_tab_options['priority'], '0.3'); ?>>0.3</option> 
  43. <option value="0.4" <?php selected($sitemap_tab_options['priority'], '0.4'); ?>>0.4</option> 
  44. <option value="0.5" <?php selected($sitemap_tab_options['priority'], '0.5'); ?>>0.5</option> 
  45. <option value="0.6" <?php selected($sitemap_tab_options['priority'], '0.6'); ?>>0.6</option> 
  46. <option value="0.7" <?php selected($sitemap_tab_options['priority'], '0.7'); ?>>0.7</option> 
  47. <option value="0.8" <?php selected($sitemap_tab_options['priority'], '0.8'); ?>>0.8</option> 
  48. <option value="0.9" <?php selected($sitemap_tab_options['priority'], '0.9'); ?>>0.9</option> 
  49. <option value="1.0" <?php selected($sitemap_tab_options['priority'], '1.0'); ?>>1.0</option> 
  50. </select> 
  51.  
  52.  
  53. </p> 
  54.  
  55. <p class="form-field"> 
  56. <label> <?php _e('Change Frequency:', 'wccs'); ?></label> 
  57.  
  58. <select id="_sitemapchange" name="_sitemapchange"> 
  59. <option value="always" <?php selected($sitemap_tab_options['change'], 'always'); ?>>Always</option> 
  60. <option value="hourly" <?php selected($sitemap_tab_options['change'], 'hourly'); ?>>Hourly</option> 
  61. <option value="daily" <?php selected($sitemap_tab_options['change'], 'daily'); ?>>Daily</option> 
  62. <option value="weekly" <?php selected($sitemap_tab_options['change'], 'weekly'); ?>>Weekly</option> 
  63. <option value="monthly" <?php selected($sitemap_tab_options['change'], 'monthly'); ?>>Monthly</option> 
  64. <option value="yearly" <?php selected($sitemap_tab_options['change'], 'yearly'); ?>>Yearly</option> 
  65. <option value="never" <?php selected($sitemap_tab_options['change'], 'never'); ?>>Never</option> 
  66. </select>  
  67. </p>  
  68. </div>  
  69. </div> 
  70. <?php