get( 'Name' ) ); define( 'BALTIC_URL', $_baltic->get( 'ThemeURI' ) ); define( 'BALTIC_AUTHOR', $_baltic->get( 'Author' ) ); define( 'BALTIC_AUTHOR_URI', $_baltic->get( 'AuthorURI' ) ); define( 'BALTIC_VERSION', $_baltic->get( 'Version' ) ); define( 'BALTIC_DOMAIN', $_baltic->get( 'TextDomain' ) ); // Dir path define( 'BALTIC_DIR', wp_normalize_path( get_template_directory() ) ); define( 'BALTIC_INC', BALTIC_DIR . "/inc" ); // URI path define( 'BALTIC_URI', get_template_directory_uri() ); /** * Prevent switching Baltic theme if did not meet minimum requirement. * * @return void */ function baltic_switch_theme() { switch_theme( WP_DEFAULT_THEME ); unset( $_GET['activated'] ); add_action( 'admin_notices', 'baltic_compatibility_notice' ); } /** * Compatibility notice * * @return void */ function baltic_compatibility_notice() { $html_message = ''; if ( version_compare( $GLOBALS['wp_version'], '4.7', '<' ) ) { // Translators: %1$s: Theme name, %2$s: Current WordPress version $message = sprintf( __( '%1$s theme requires at least WordPress version 4.7. You are running version %2$s. Please upgrade and try again.', 'baltic' ), esc_html( BALTIC_NAME ), $GLOBALS['wp_version'] ); $html_message = sprintf( '