defined( 'ABSPATH' ) or exit; // Theme constants define( 'GLB__PATH', trailingslashit( get_template_directory() ) ); define( 'GLB__URI', trailingslashit( get_template_directory_uri() ) ); define( 'GLB__VERSION', '1.0.0' ); define( 'GLB__ID', 'glb' ); // Action to load the theme translation add_action( 'after_setup_theme', 'glb__translation_import', 5 ); /** * Load the translation files into the theme textdomain * * @return void */ function glb__translation_import() { load_theme_textdomain( 'glb', get_template_directory() . '/languages' ); } /** * We must check PHP version to ensure the theme can * be worked fine */ if ( version_compare( PHP_VERSION, '5.3', '<' ) ) { // Register action to checking theme requirements add_action( 'after_switch_theme', 'glb__requirement_check', 10, 2 ); // Action to sending a notice while hosting does // not meet the minimum requires add_action( 'admin_notices', 'glb__requirement_notice' ); /** * Check the theme requirements * * @param string $name Theme's name * @param object $theme The theme object * * @return void */ function glb__requirement_check( $name, $theme ) { // Switch back to previous theme switch_theme( $theme->stylesheet ); } /** * Show the warning message when hosting environment doesn't * meet the theme minimum requires. * * @return void */ function glb__requirement_notice() { printf( '
%s