You should do it like so:
add_action( 'wpcf7_init', 'custom_add_form_tag_my_source' );
function custom_add_form_tag_my_source() {
// "my-source" is the type of the form-tag
wpcf7_add_form_tag( 'my-source', 'custom_my_source_form_tag_handler' );
}
function custom_my_source_form_tag_handler( $tag ) {
return isset( $_COOKIE['my_source'] ) ? $_COOKIE['my_source'] : '';
}
See the documentation for more details.
Or you can also try this, to parse regular shortcodes:
add_filter( 'wpcf7_mail_components', function( $components ){
$components['body'] = do_shortcode( $components['body'] );
return $components;
} );
Related Posts:
- Integrate Razorpay quick payments plugin with contact form7 plugin
- How to add a shortcode button to the TinyMCE editor?
- How to customise the output of the WP image gallery shortcode from a plugin?
- Contact form 7 select box different value-text than content-text in option [closed]
- How to include code only on specific pages?
- Custom media upload content for inserting custom post shortcode
- Why “Contact Form 7” doesn’t update PHPmailer library?
- Checking if an attribute exists in a shortcode
- How to get current post ID in Contact Form 7 wpcf7_before_send_mail hook action
- To Disable WordPress Rest API or Not To Disable?
- how to include other plugins css files in a shortcode?
- What characters are allowed as a shortcode tag and how should they be sanitized?
- All shortcodes not working on custom theme
- enqueue script only if it is not already enqueue
- Shortcode output appears before post body [duplicate]
- Autogenerate wordpress shortcodes using array?
- PHP Deprecated: Non-static method should not be called statically
- How to parse nested shortcodes?
- Loading shortcode with ajax
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Adding Custom Fields for Img in Posts
- How to call shortcode function directly and pass $atts
- How To Ignore a Filter On Applying Filter the Content In a Function
- Cannot strip JW Player shortcode?
- Shortcode display outside the div
- Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?
- User content database [closed]
- Find all strings between an enclosing shortcode
- Hide some shortcodes on posts from back-end
- Trouble implementing python on WordPress
- wordpress Shortocode running twice?
- Is there a function to search for a wildcard value when calling a shortcode?
- Shortcode in a blog post, footer and related products stop working
- shortcode which is introduced into entry the blog, and appears in side bar
- Call/Run a Mathematica (.m) Shell Script from WordPress Page/Blog
- How to display single arbitrary facebook post with a shortcode?
- Multiple level shortcodes
- Custom shortcode with dynamic rewrite
- Using “excerpt_more” filter for a specific post type
- Posting code inside the post instead of in the template file using shortcode
- Allow user to input shortcode into wordpress widget
- How to use shortcode of any plugin to show it visually where i want?
- apply_filters to content but ignore shortcodes
- Space in WordPress Attribute Causing Problems
- Why function hooked using object are executing at all time?
- Shortcode registered from a plugin not recognized
- How to Set Limit with WordPress Get Bookmarks Shortcode
- Strange get_the_* behavior with php 5.4
- How to load a plugin when doing an Ajax call? [duplicate]
- Contact Form 7: custom validation [closed]
- Is it right way to create shortcode?
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Strip shortcode from excerpt [duplicate]
- Need to change contact email depending where user is from
- Retrieving old forms in Contact Form 7 [closed]
- Convert usernames listed by the Groups plugin shortcode to displayed names?
- Pulling RSS from site and display it in posts
- Trying to Understand Shortcodes.
- Integrate Mailchimp to a Contact Form 7 contact form [closed]
- Creating Features List in WordPress Post
- Shortcode return is printing a 1 afterward
- How to use ‘Event Manager Shortcodes’ plugin via the php code? [closed]
- Embedding BitBucket Code in Posting
- Next and Previous Pagination button not displaying in WordPress
- Do shortcodes affect page indexing by search engines?
- How put a file when the email is sent to user contact form 7
- Contact Form 7 Default value from url [closed]
- do_shortcodes() isn’t working
- Any way to hook into WP after a page displays?
- WordPress shortcode plugin not working
- WP Customer Reviews call short code on another page [closed]
- How to do Conact form 7 name field validation? [closed]
- How to show in front End images using Visual Composer attach_images?
- Display HTML5 jQuery Audio Player On Front Page
- Shortcode returning specific content of a post
- Invalid argument supplied for foreach()
- Contact form 7 – How to send mail to two different E-mail Address [closed]
- Seo Problems in My meta Discription [closed]
- prevent contact form 7 from submission on certain condition
- I am experiencing difficulty fulfilling client request
- cURL External API request displays content above other content on page
- Beginner question: Accessing js script in plugin
- Shortcode to do math with url variables
- How can I get the permalink of a page on which shortcode has been used
- Subtract Using GravityWP Count Plugin
- How to get URL param for pagination in shortcode?
- qTranslate‑X is not translating all shortcodes
- thumbnail_width not working in wordpress most popular post plugin
- Buffered output in chunks and shortcode – how do I achieve that?
- How can I add a zip code service availability checker in WordPress without Woocommerce? [closed]
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- Problem with a shortcode generating a error [closed]
- plugin doesn’t retrieve data from database
- Display file contents within Plugin
- How can I create a drawable image for a contact form
- How do I edit text color for shortcode?
- correct way to enqueue js and css files for wordpress shortcode?
- How to get next day date of a specific day
- Custom Plugin not Displaying in the Website Production environment (Divi)
- Can I add two wordpress shortcode plugins in the same site (not the same page)?