Roots Discourse

Woocommerce conflict - apply_filters

**Fatal error** : Uncaught ArgumentCountError: Too few arguments to function WC_Template_Loader::unsupported_theme_title_filter()
... **plugins/woocommerce/includes/class-wc-template-loader.php**  on line  **399**

This error occurs when using

apply_filters('the_title', $post->post_title)

in my controllers. Has anyone had this occur? Using latest version of WC.

I would check for add_filter('the_title' throughout your codebase in case something else is causing a conflict.
Also, maybe $post->post_title is null.

Alternatively, you can use get_the_title($post) which will run the filter for you.

Simplifying to

‘title’ => $post->post_title

works. Also, apply_filters worked before adding WC. Just wanted to try and find out why this is conflicting.