<?php
/**
 * Sage includes
 *
 * The $sage_includes array determines the code library included in your theme.
 * Add or remove files to the array as needed. Supports child theme overrides.
 *
 * Please note that missing files will produce a fatal error.
 *
 * @link https://github.com/roots/sage/pull/1042
 */
define('THEME_DIR',get_template_directory());
define('THEME_URL', get_template_directory_uri());

/* ReduxFramework Start */ 
if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/ReduxCore/framework.php' ) ) {
	
	require_once( dirname( __FILE__ ) . '/ReduxFramework/ReduxCore/framework.php' );
	require_once( dirname( __FILE__ ) . '/ReduxFramework/sample/theme-config.php' );
	//require_once( dirname( __FILE__ ) . '/ReduxFramework/sample/sample-config.php' );
	//die('x');
}


$sage_includes = [
  'lib/utils.php',                 // Utility functions
  'lib/init.php',                  // Initial theme setup and constants
  'lib/wrapper.php',               // Theme wrapper class
  'lib/conditional-tag-check.php', // ConditionalTagCheck class
  'lib/config.php',                // Configuration
  'lib/assets.php',                // Scripts and stylesheets
  'lib/titles.php',                // Page titles
  'lib/extras.php',                // Custom functions
  'framework/post.options.php',          // Custom functions
];

foreach ($sage_includes as $file) {
  if (!$filepath = locate_template($file)) {
    trigger_error(sprintf(__('Error locating %s for inclusion', 'sage'), $file), E_USER_ERROR);
  }

  require_once $filepath;
}
unset($file, $filepath);

add_shortcode('all_country', 'get_all_countries');
function get_all_countries(){
    global $wpdb;
    $countries = $wpdb->get_results( "SELECT * FROM wp_countries" );
    return $countries;
}

?>