September 11, 2017 at 2:13 pm
#19246
saulbw
Participant
Another method which directly removes the action that shows the notice:
add_action('admin_init', function() { global $wp_filter; if (!empty($wp_filter['admin_notices']->callbacks[10])) { foreach ($wp_filter['admin_notices']->callbacks[10] as $hook_key => $hook) { if (is_array($hook['function']) && $hook['function'][0] instanceof \Yoast_Plugin_License_Manager && $hook['function'][1] == 'display_admin_notices') { unset($wp_filter['admin_notices']->callbacks[10][$hook_key]); } } } });