Created
September 12, 2014 22:00
-
-
Save theMikeD/b1fe86dbc1fc15d1b312 to your computer and use it in GitHub Desktop.
Wordpress PHP to notify of missing plugins
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
// R E Q U I R E S | |
// The list of required plugins | |
$md_csa_required_plugins = array( | |
array( // ACF | |
'func' => 'get_field', | |
'call' => 'md_notify_acf', | |
), | |
array( // ACF Repeater | |
'func' => 'acf_register_repeater_field', | |
'call' => 'md_notify_acf_repeater', | |
), | |
array( // ACF Options | |
'func' => 'acf_set_options_page_title', | |
'call' => 'md_notify_acf_options', | |
), | |
array( // Genesis Taxonomy Images | |
'func' => 'gtaxi_activation', | |
'call' => 'md_notify_genesis_taxonomy_images', | |
), | |
array( // Custom Taxonomy Order NE | |
'func' => 'customtaxorder_register_settings', | |
'call' => 'md_notify_custom_taxonomy_order_ne', | |
), | |
); | |
//------------------------------------------------------------------------------ | |
// Check to ensure that all required plugins are installed | |
function md_check_for_required_plugins () { | |
global $md_csa_required_plugins; | |
foreach ( $md_csa_required_plugins as $plugin ) { | |
if(!function_exists($plugin['func'])) { | |
add_action( 'admin_notices', $plugin['call'] ); | |
} | |
} | |
} | |
md_check_for_required_plugins(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment