Skip to content

Commit

Permalink
Add wpcf7_shortcode_callback action hook
Browse files Browse the repository at this point in the history
  • Loading branch information
takayukister committed Sep 20, 2023
1 parent 42b605a commit ffa81b7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions includes/contact-form-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '',
Expand Down Expand Up @@ -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;
}


Expand Down

0 comments on commit ffa81b7

Please sign in to comment.