Metro_Sitemap::is_blog_public PHP Method

is_blog_public() public static method

public static is_blog_public ( )
    public static function is_blog_public()
    {
        return 1 == get_option('blog_public');
    }

Usage Example

 /**
  * Find the next day with posts to process
  * @param int $year
  * @param int $month
  * @param int $day
  * @return void, just updates options.
  */
 public static function find_next_day_to_process($year, $month, $day)
 {
     $halt = get_option('msm_stop_processing') === true;
     if ($halt || !Metro_Sitemap::is_blog_public()) {
         // Allow user to bail out of the current process, doesn't remove where the job got up to
         // or If the blog became private while sitemaps were enabled, stop here.
         delete_option('msm_stop_processing');
         delete_option('msm_sitemap_create_in_progress');
         return;
     }
     update_option('msm_sitemap_create_in_progress', true);
     $days_being_processed = get_option('msm_days_to_process');
     $months_being_processed = get_option('msm_months_to_process');
     $years_being_processed = get_option('msm_years_to_process');
     $total_days = count($days_being_processed);
     $total_months = count($months_being_processed);
     $total_years = count($years_being_processed);
     if ($total_days && $day > 1) {
         // Day has finished
         unset($days_being_processed[$total_days - 1]);
         update_option('msm_days_to_process', $days_being_processed);
         self::generate_sitemap_for_year_month(array('year' => $year, 'month' => $month));
     } else {
         if ($total_months and $month > 1) {
             // Month has finished
             unset($months_being_processed[$total_months - 1]);
             delete_option('msm_days_to_process');
             update_option('msm_months_to_process', $months_being_processed);
             self::generate_sitemap_for_year(array('year' => $year));
         } else {
             if ($total_years > 1) {
                 // Year has finished
                 unset($years_being_processed[$total_years - 1]);
                 delete_option('msm_days_to_process');
                 delete_option('msm_months_to_process');
                 update_option('msm_years_to_process', $years_being_processed);
                 self::generate_full_sitemap();
             } else {
                 // We've finished - remove all options
                 delete_option('msm_days_to_process');
                 delete_option('msm_months_to_process');
                 delete_option('msm_years_to_process');
                 delete_option('msm_sitemap_create_in_progress');
             }
         }
     }
 }
All Usage Examples Of Metro_Sitemap::is_blog_public