Last active
August 29, 2015 13:59
-
-
Save grok/10745973 to your computer and use it in GitHub Desktop.
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
Warning: call_user_func_array() expects parameter 1 to be a valid callback, array must have exactly two members in /wp-includes/plugin.php on line 429 |
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 | |
final class Theme { | |
//... | |
private function _declare_dependencies() | |
{ | |
if(!class_exists('GFForms')) | |
{ | |
add_action('admin_notices', array_map(array($this, 'dependency_missing'), array('Gravity Forms'))); | |
} | |
} | |
//.. | |
} | |
?> |
Fundamentally my code wasn't even working.
It only looked like it did because the array_map was calling the function -- duh.
The return was an array -- which is not a callable function -- which produced the error.
So I needed to break it out into simpler actions -- utilizing do_action and remove_action later so it isn't called twice.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Figured it out: