Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Created March 11, 2013 15:45
Show Gist options
  • Select an option

  • Save jdevalk/5135158 to your computer and use it in GitHub Desktop.

Select an option

Save jdevalk/5135158 to your computer and use it in GitHub Desktop.
<?php
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
require_once plugin_dir_path( __FILE__ ) . 'admin/ajax.php';
} else if ( defined('DOING_CRON') && DOING_CRON ) {
$options = get_option( 'Yoast_Google_Analytics' );
if ( isset( $options['yoast_tracking'] ) && $options['yoast_tracking'] )
require_once plugin_dir_path( __FILE__ ) . 'inc/class-tracking.php';
} else {
load_plugin_textdomain( 'gawp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
require_once plugin_dir_path( __FILE__ ) . 'inc/functions.php';
if ( is_admin() ) {
require_once plugin_dir_path( __FILE__ ) . 'admin/class-admin.php';
} else {
require_once plugin_dir_path( __FILE__ ) . 'frontend/class-frontend.php';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment