Skip to content

Instantly share code, notes, and snippets.

@theMikeD
Created September 12, 2014 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theMikeD/b1fe86dbc1fc15d1b312 to your computer and use it in GitHub Desktop.
Save theMikeD/b1fe86dbc1fc15d1b312 to your computer and use it in GitHub Desktop.
Wordpress PHP to notify of missing plugins
// 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