• I wanted to use only shortcode block but an error occurs when you try to disable all Post Type options.

    Uncaught TypeError: array_values(): Argument #1 ($array) must be of type array, null given in /var/www/html/wp-content/plugins/was-this-article-helpful/index.php:230
    Stack trace:
    #0 /var/www/html/wp-content/plugins/was-this-article-helpful/index.php(230): array_values()
    #1 /var/www/html/wp-includes/class-wp-hook.php(307): wthf_options_page()
    #2 /var/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 /var/www/html/wp-includes/plugin.php(474): WP_Hook->do_action()
    #4 /var/www/html/wp-admin/admin.php(259): do_action()
    #5 /var/www/html/wp-admin/options-general.php(10): require_once('...')
    #6 {main}
      thrown

    Can you fix it please?
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there 👋 
    same issue on my side:

    [05-Jun-2022 23:06:25 UTC] PHP Warning:  Undefined array key "wthf_types" in ~wp-content/plugins/was-this-article-helpful/index.php on line 230
    [05-Jun-2022 23:06:25 UTC] PHP Fatal error:  Uncaught TypeError: array_values(): Argument #1 ($array) must be of type array, null given in ~wp-content/plugins/was-this-article-helpful/index.php:230
    Stack trace:
    #0 ~wp-content/plugins/was-this-article-helpful/index.php(230): array_values()
    #1 ~wp-includes/class-wp-hook.php(307): wthf_options_page()
    #2 ~wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 ~wp-includes/plugin.php(476): WP_Hook->do_action()
    #4 ~wp-admin/admin.php(259): do_action()
    #5 ~wp-admin/options-general.php(10): require_once('...')
    #6 {main}
      thrown in ~wp-content/plugins/was-this-article-helpful/index.php on line 230

    Maybe linked to php8 (i’m using this one).
    Thank you for your help!
    Warm regards,
    Ludovic

    Same issue! This is a really basic error and shouldn’t take too long to fix. But I won’t go about telling you how, because I’m not sure of all the inticate plugin details.

    But what I did end up doing was changing wthf_types update_option line. I started out by just always updaiting to empty array. That did uncheck both option on options page, but also it started to show helpful block on all pages and posts. Bad design!

    Then I changed option updatu to array with single string ‘no-type’ and that seems to be working e.g. not showing any helpful blocks by default on any post or page.

    Now I can go about and use the shorcode you have created, but am not sure why there is one if you can’t even turn off default outputs to contents.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Error with disabling all post type option’ is closed to new replies.