Last active
June 23, 2016 18:05
-
-
Save MaximeCulea/e11139de89d6a1bbebb7f0ea556d5899 to your computer and use it in GitHub Desktop.
Require ACF activation for a custom theme.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( 'get_field' ) ) { | |
add_action( 'template_redirect', 'template_redirect_warning_missing_acf', 0 ); | |
function template_redirect_warning_missing_acf() { | |
wp_die( sprintf( 'This theme can\'t work without ACF plugin. <a href="%s">Please login to admin</a>, and activate it !', wp_login_url() ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add php tags