| 开发者 | plugin999 |
|---|---|
| 更新时间 | 2026年11月27日 17:17 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
shortcodefield (visible text input) and shortcodehidden (hidden input) — that automatically populate their values from any WordPress shortcode.
Stop hardcoding form values. Instead, let your CF7 forms pull live data directly from the current post, the logged-in user, a WooCommerce product, custom meta fields, or any shortcode you define.
Whether you need to pass the current page URL, the post title, or a user's username silently in a hidden field, this plugin makes it seamless — no coding required after setup.
🔧 What You Can Do
DYFCF7_get_post_title.DYFCF7_get_current_user.DYFCF7_get_custom_field key='your_key'.DYFCF7_page_url.get_bloginfo() value using DYFCF7_get_bloginfo.DYFCF7_get_product.shortcodefield for a visible, editable text input, or shortcodehidden for a silent hidden field — perfect for tracking metadata without showing it to users.shortcodefield as required using the asterisk variant (shortcodefield*), and CF7's standard validation will enforce it.DYFCF7_get_post_title key='post_title' | Get any post/page property (post_title, post_author, ID, etc.) |
| DYFCF7_get_current_user key='user_login' | Get any property of the currently logged-in user |
| DYFCF7_get_custom_field key='meta_key' | Get a custom field (post meta) value by key |
| DYFCF7_page_url | Get the URL of the current page |
| DYFCF7_get_bloginfo show='name' | Get site info (name, URL, admin_email, etc.) |
| DYFCF7_get_product key='name' | Get WooCommerce product data on product pages |
💡 How It Works
In the CF7 form editor, click the shortcodefield or shortcodehidden tag button. In the popup, enter a shortcode name — without the square brackets — into the value field. For example, to pre-fill a field with the current post title, enter:
DYFCF7_get_post_title key='post_title'
The plugin resolves the shortcode on page load and injects the result as the field's value. You can also pass any custom shortcode you have registered in your theme's functions.php.
🔗 Resources
/wp-content/plugins/, or install directly via the WordPress Plugins screen.Yes. Contact Form 7 must be installed and activated for this plugin to work.
Absolutely. Any shortcode registered in WordPress — whether from a plugin, your theme, or functions.php — can be used as the field value. Enter the shortcode name and attributes without the square brackets.
After inserting the tag into your form, go to the Mail tab in CF7 and insert the corresponding mail tag (e.g., [your-field-name]) into the email body or subject.
Yes. Use the shortcodehidden tag type to insert an invisible field that captures any shortcode value — such as the current page URL, post ID, or user info — and includes it in the form submission without displaying it to the visitor.
shortcodefield tag required-field compatible?Yes. Use shortcodefield* (with an asterisk) to mark the field as required. CF7's built-in validation will prevent form submission if the field is empty.
Yes. The DYFCF7_get_product shortcode retrieves product data and works on product pages, shop pages, cart, and checkout pages.
Enter the shortcode without square brackets, and use single quotes for attribute values. Example: DYFCF7_get_post_title key='post_name'. Do not use double quotes inside the tag generator value field.
shortcodefield tag type — a visible, editable text input populated via shortcode.shortcodehidden tag type — a hidden input populated via shortcode.DYFCF7_get_post_title, DYFCF7_get_current_user, DYFCF7_get_custom_field, DYFCF7_page_url, DYFCF7_get_bloginfo, DYFCF7_get_product.shortcodefield*.