title: Wordpress Cron Job calling class function doesn't work
body: <blockquote>
    <p>I am using Wordpress Cron Job to call static function of a class.</p>
    
    <p>The cron event is triggered but the function isn't called.</p>
    
    <p>Can you help me to fix it?</p>
  </blockquote>
  
  <p>Here is my functions.php file.</p>
  
  <pre><code>...    
  if (! wp_next_scheduled ( 'calculate_score' )) {
      wp_schedule_event(current_time( 'timestamp' ), 'hourly', 'calculate_score');
  }
  
  add_action('calculate_score', 'calculate_score');
  function calculate_score()
  {   
      require_once ASIATHEMES_TEMPLATE_DIR."/../../../wp-load.php";
      require_once ASIATHEMES_TEMPLATE_DIR.'/../../../wp-content/plugins/football-pool/admin/class-football-pool-admin.php';
      require_once ASIATHEMES_TEMPLATE_DIR.'/../../../wp-content/plugins/football-pool/admin/class-football-pool-admin-score-calculation.php';
  
      Football_Pool_Admin_Score_Calculation::process();
  }
  ...
  </code></pre>
  
  <blockquote>
    <p>process() is a static function of
    Football_Pool_Admin_Score_Calculation Class.</p>
  </blockquote>
  
  <p>Here is the file.</p>
  
  <pre><code>&lt;?php
  class Football_Pool_Admin_Score_Calculation extends Football_Pool_Admin {
      public static function process() {
          // session data is initiated in Football_Pool-&gt;init
  
          // initialize variables
          global $wpdb;
      ...
      }
  </code></pre>
  
  <blockquote>
    <p>This function can be called from other php file, but not in cron job.</p>
  </blockquote>