Contact Form 7 White Screen/Fata Error Unknown

[ad_1]

This is the error I got when I turned on the debugger in wp-config.php:

Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given in /opt/bitnami/wordpress/wp-includes/class-wp-hook.php:308 Stack trace: #0 /opt/bitnami/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters() #1 /bitnami/wordpress/wp-content/plugins/contact-form-7/includes/functions.php(216): apply_filters() #2 /bitnami/wordpress/wp-content/plugins/contact-form-7/includes/contact-form.php(851): wpcf7_autop_or_not() #3 /bitnami/wordpress/wp-content/plugins/contact-form-7/includes/contact-form.php(923): WPCF7_ContactForm->replace_all_form_tags() #4 /bitnami/wordpress/wp-content/plugins/contact-form-7/includes/contact-form.php(623): WPCF7_ContactForm->form_elements() #5 /bitnami/wordpress/wp-content/plugins/contact-form-7/includes/contact-form-functions.php(229): WPCF7_ContactForm->form_html() #6 [internal function]: {closure}() #7 /bitnami/wordpress/wp-content/plugins/contact-form-7/includes/l10n.php(147): call_user_func() #8 /bitnami/wordpress/wp-content/plugins/contact-form-7/includes/contact-form-functions.php(233): wpcf7_switch_locale() #9 /opt/bitnami/wordpress/wp-includes/shortcodes.php(355): wpcf7_contact_form_tag_func() #10 [internal function]: do_shortcode_tag() #11 /opt/bitnami/wordpress/wp-includes/shortcodes.php(227): preg_replace_callback() #12 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(308): do_shortcode() #13 /opt/bitnami/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters() #14 /bitnami/wordpress/wp-content/themes/leadstart/template-parts/content-notitle.php(16): apply_filters() #15 /opt/bitnami/wordpress/wp-includes/template.php(785): require(‘…’) #16 /opt/bitnami/wordpress/wp-includes/template.php(718): load_template() #17 /opt/bitnami/wordpress/wp-includes/general-template.php(204): locate_template() #18 /bitnami/wordpress/wp-content/themes/leadstart/blank-page.php(12): get_template_part() #19 /opt/bitnami/wordpress/wp-includes/template-loader.php(106): include(‘…’) #20 /opt/bitnami/wordpress/wp-blog-header.php(19): require_once(‘…’) #21 /opt/bitnami/wordpress/index.php(17): require(‘…’) #22 {main} thrown in /opt/bitnami/wordpress/wp-includes/class-wp-hook.php on line 308

I tried removing autop so many ways in the past but I had an issue where it caused a fatal error anytime I tried to use the Contact Form 7 plugin. I think there needs to be a fixed in the next release.

//remove autop from everywhere

remove_filter('widget_text_content', 'wpautop');

remove_filter('the_excerpt', 'wpautop');

remove_filter('the_content', 'wpautop');

remove_filter('widget_text_content', 'wpautop');

remove_filter('the_content', 'wptexturize');

add_filter('widget_text_content', 'leadstart_removing_autop', 999);

add_filter('widget_custom_html_content', 'leadstart_removing_autop', 999);

function removing_autop($content)

{

  $content = str_replace(['<p>', '</p>'], ['', ''], $content);

  return $content;

}

I am using PHP version 8.1.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer