Tag Archives: custom function

How to add contact form 7 inside a custom function?

By | March 23, 2021

Here is a rough example for using contact form 7 inside a filter hook. add_filter( ‘wpcf7_validate_tel*’, static function ($result, $tag) { // Conditional logic that used to be in the function $url = home_url(add_query_arg(null, null)); if (!(strpos($url, ‘id’) && strpos($url, ‘form_id’))) { // This is the original callback, now moved here. // Assign the result… Read More »