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
- Contact form 7 select box different value-text than content-text in option [closed]
- How to get current post ID in Contact Form 7 wpcf7_before_send_mail hook action
- Adding Custom Fields for Img in Posts
- How To Ignore a Filter On Applying Filter the Content In a Function
- Shortcode display outside the div
- Pass $this to function nested in another public function of the same class
- shortcode doesn’t work
- Calling shortcode in wp_localize_script strips result
- WordPress shortcodes & performance
- Is it possible to make shortcodes NOT case sensitive?
- Layout shop page: resize images and columns
- How to add inline css/js inside a shortcode
- How extend shortcode default values for a plugin?
- Shortcode in AJAX popup
- Server side validation for Contact Form 7 [closed]
- Looking for a solution – slightly convoluted problem
- Can I use a Shortcode output as an HTML attribute value?
- WP theme with Backbone
- Can wp_localize_script be used within a shortcode?
- Force [wordpress_social_login] shortcode to display where it is embedded [closed]
- How to generate CSS from a shortcode within a plugin
- Storing Options in a Shortcode
- Custom CSS for plugin form
- Show history of post revisions on front end
- How to remove html code in excel downloads using phpspreadsheet with wordpress plugins shortcode
- Shortcode based chart plugin
- Plugin shortcodes not working in custom theme
- Input with spaces in Shortcode attributes overwritten by defaults
- How to put JQuery/Ajax inside shortcode?
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- Can someone please tell me what is wrong with my plugin?
- Trouble with editing template for “List category posts” plugin
- WordPress Shortcode to get URL Parameters $_GET[‘name’] redirects for no reason at all
- WordPress function not being called from jQuery method
- Getting value from dymanic text variable into Contact Form 7
- creating html reusable blocks via shortcodes
- Single API call exposed via shortcode with params
- SEO Friendly URL on dynamic product page produced via shortcode
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Insert content of a post into another
- plugin shortcode output
- How to Create a shortcode to this php function
- What is @Action in WordPress?
- Where are theme codes located for WordPress?
- How to have sample page for each new register users in a membership website
- using do_shortcode
- plugin shortcode not working on ajax request call
- Modify page title and subtitle with a plugin
- How to activate a plugin on the activation of a theme?
- Add Shortcode tag in Widget/Sidebar
- WPTouch – how to remove shortcodes or make shortcodes function
- Contact Form 7 – Show image on successful send? [closed]
- Custom shortcode for displaying user based on a role parameter
- WordPress Plugin Insert Html Code with Shortcode
- IF condition based on wp_remote_get output
- shortcode not return any thing in Gutnburg
- Send email to multiple addresses on Contact Form 7, but exclude personal details on all but one
- Shortcode not working – quotes seems strange
- Get all the URLs of the pages that uses a specific shortcode
- Get Image Having the ID [closed]
- Add the_post_thumbnail_url to a shortcode in function.php
- Form Plugin for Api Requests which is used via Shortcode
- Echo out element to another page.
- how to check if a shortcode is used more than one time in the same post
- Adding a Tag Parameter / Filter to My Shortcode
- Rename Smart YouTube’s httpv back to http for all posts
- acceptance_as_validation: on is not working Contact form 7 [closed]
- Contact Form 7 is not redirecting the “Thank-You” page with the removal of CSS and JS of plugins
- How to use a shortcode or an application to dynamically embed content from one WordPress site to another?
- Managing and deleting transients with dynamically generated transient names
- Thumbnail image doesn’t show up in Shortcode output
- list of custom post by custom field in frontend
- get_post_meta shortcode returns empty field
- JS working when used normally but not in wordpress
- Make the product page as homepage WooCommerce
- WordPress Shortcodes – Return $Variable
- Shortcode function not showing up on mobile browser
- shortcodes not working [dt_carousel & [dt_fancy_image
- Get Current Post ID in WP Loop For GiveWP
- Shortcode generated widget to appear on same line as heading text and button
- Form is not getting submitted [closed]
- wordpress Shortocode running twice?
- Shortcode in a blog post, footer and related products stop working
- Using “excerpt_more” filter for a specific post type
- Space in WordPress Attribute Causing Problems
- Shortcode registered from a plugin not recognized
- Strange get_the_* behavior with php 5.4
- Contact Form 7: custom validation [closed]
- Strip shortcode from excerpt [duplicate]
- Embedding BitBucket Code in Posting
- Next and Previous Pagination button not displaying in WordPress
- Do shortcodes affect page indexing by search engines?
- How to show in front End images using Visual Composer attach_images?
- Shortcode to do math with url variables
- How can I get the permalink of a page on which shortcode has been used
- How to get URL param for pagination in shortcode?
- Buffered output in chunks and shortcode – how do I achieve that?
- How can I create a drawable image for a contact form
- How to get next day date of a specific day