Created
September 24, 2021 08:32
-
-
Save daomapsieucap/ab973684e9b0e0426d077e46879aa095 to your computer and use it in GitHub Desktop.
Plugin Requirements for WordPress theme
This file contains hidden or 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 | |
| /** | |
| * Plugin Requirements | |
| */ | |
| add_action('admin_notices', 'dc_theme_dependencies'); | |
| function dc_theme_dependencies(){ | |
| if(!is_plugin_active('framework_plugin/framework_plugin.php')){ | |
| echo '<div class="error"><p>' . __('The current theme requires plugin [Your Plugin Name], please install and activate [Your Plugin Name] plugin', 'dc') . '</p></div>'; | |
| } | |
| } | |
| if(!is_plugin_active('framework_plugin/framework_plugin.php')){ | |
| return; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment