• Resolved deanhibbert

    (@deanhibbert)


    Hi! We’ve been using disable-gutenberg for several years now. It’s worked great for us! But we’ve run into a snag that’s causing our automated deploy processes some trouble…

    We use WP CLI to install our plugins for our self-hosted WP instances, but ever since disable-gutenberg 3.0+, the plugin throws a fatal error whenever we try to activate it via the command line:

    PHP Fatal error:  Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "disable_gutenberg_dismiss_notice_activate" not found or invalid function name in /.../wp-includes/class-wp-hook.php:310

    I believe this is because the file defining the function disable_gutenberg_dismiss_notice_activate (in inc/settings-reset.php) is being required only if is_admin() is true. This explains how we’re able to activate the plugin on the WP backend, but not via the CLI!

    We’re able to replicate this on a fresh WP install with no other plugins and the default themes:
    1. wp plugin install disable-gutenberg will successfully install the plugin.
    2. wp plugin activate disable-gutenberg will cause the fatal error.
    3. Activating the plugin in the backend works without any problems!

    I was able to successfully activate the plugin with WP CLI when I moved disable-gutenberg.php:100 out of the is_admin() check.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal error when installing via WP CLI’ is closed to new replies.