From ffa81b7851c43d187afbeb43b8ef54bec0ddb772 Mon Sep 17 00:00:00 2001 From: Takayuki Miyoshi Date: Wed, 20 Sep 2023 16:57:28 +0900 Subject: [PATCH] Add wpcf7_shortcode_callback action hook #1278 --- includes/contact-form-functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/contact-form-functions.php b/includes/contact-form-functions.php index db730282..ab27017e 100644 --- a/includes/contact-form-functions.php +++ b/includes/contact-form-functions.php @@ -221,7 +221,7 @@ function wpcf7_contact_form_tag_func( $atts, $content = null, $code = '' ) { return '[contact-form-7]'; } - if ( 'contact-form-7' == $code ) { + if ( 'contact-form-7' === $code ) { $atts = shortcode_atts( array( 'id' => '', @@ -269,11 +269,15 @@ function wpcf7_contact_form_tag_func( $atts, $content = null, $code = '' ) { return $contact_form->form_html( $atts ); }; - return wpcf7_switch_locale( + $output = wpcf7_switch_locale( $contact_form->locale(), $callback, $contact_form, $atts ); + + do_action( 'wpcf7_shortcode_callback', $contact_form, $atts ); + + return $output; }