title: How to add a PHP script to wordpress
body: <p>I have a code that fetch data from an API and add the data as posts in Wordpress. It's suppose to run hourly.</p>
  
  <p>I don't understand where i place this script in wordpress?</p>
  
  <p>This is the script, it's a php class with a hourly trigger.</p>
  
  <pre><code>class MND_News_Importer
  {
      private function _schedule_import()
          {
              // If the schedule isn't set
              if ( !wp_next_scheduled( self::CRON_NAME ) )
              {
                  // Use the built in function wp_schedule event to run the function every hour
                  wp_schedule_event( time(), 'hourly', self::CRON_NAME );
              }
          }
  }
  </code></pre>
  
  <p>Full code can be found here: <a href="http://webbgaraget.se/2014/05/28/importera-nyheter-fran-mynewsdesk-till-wordpress-del-1/" rel="nofollow">http://webbgaraget.se/2014/05/28/importera-nyheter-fran-mynewsdesk-till-wordpress-del-1/</a></p>
  
  <p>Where am i suppose to place this code?</p>