Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

min version #13

Open
paulcollett opened this issue Feb 7, 2018 · 0 comments
Open

min version #13

paulcollett opened this issue Feb 7, 2018 · 0 comments

Comments

@paulcollett
Copy link
Owner

possible code:

if ( ! version_compare( PHP_VERSION, '5.4', '>=' ) ) {
	add_action( 'admin_notices', 'ftt_fail_php_version' );
} elseif ( ! version_compare( get_bloginfo( 'version' ), '4.5', '>=' ) ) {
	add_action( 'admin_notices', 'ftt_fail_wp_version' );
} else {
	require get_parent_theme_file_path( 'inc/theme.php' );
}

function ftt_fail_php_version() {
	/* translators: %s: PHP version */
	$message = sprintf( esc_html__( 'Food Truck Theme requires PHP version %s+, theme is currently NOT ACTIVE.', 'food-truck' ), '5.4' );
	$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
	echo wp_kses_post( $html_message );
}

function ftt_fail_wp_version() {
	/* translators: %s: WordPress version */
	$message = sprintf( esc_html__( 'Food Truck Theme requires WordPress version %s+. Because you are using an earlier version, the theme is currently NOT ACTIVE.', 'food-truck' ), '4.5' );
	$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
	echo wp_kses_post( $html_message );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant