Title: Multiple Parameters in a single CF7 field
Last modified: March 16, 2024

---

# Multiple Parameters in a single CF7 field

 *  Resolved [gcarnegie](https://wordpress.org/support/users/gcarnegie/)
 * (@gcarnegie)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/multiple-6/)
 * How should I combine multiple dynamic (or literal) fields in a single CF7 field?
 * eg, I am populating a dynamic_textarea with the post_date,
 * [dynamic_textarea your-message “CF7_get_current_var key=’post_date'”]
 * but:
    1. The Post_Date needs reformtting from “2024-06-15 21:06:00” to UK date “15/06/
       24”.
    2. I also want to add some standard text before the date, within the same dynamic_textarea:–“
       I am interested in working with you regarding [TITLE], on [reformat(POST_DATE)]”
 * Any help would be appreciated.
    -  This topic was modified 2 years, 2 months ago by [gcarnegie](https://wordpress.org/support/users/gcarnegie/).
    -  This topic was modified 2 years, 2 months ago by [gcarnegie](https://wordpress.org/support/users/gcarnegie/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Tessa (they/them), AuRise Creative](https://wordpress.org/support/users/tessawatkinsllc/)
 * (@tessawatkinsllc)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/multiple-6/#post-17509978)
 * So you’ll want to use a [custom shortcode](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/custom-shortcodes/)
   for this, something like:
 *     ```wp-block-code
       function gcarnegie_textarea()
       {
           // Call the CF7_get_current_var function directly, returns date formatted as YYYY-MM-DD HH:mm:ss
           $date = wpcf7dtx_get_current_var(array('key' => 'post_date'));
           if ($date) {
               // Convert string to DateTime object in UK date (GMT)
               $date = date_create_from_format('Y-m-d H:i:s', $date, new DateTimeZone('GMT'));
               if ($date !== false) {
                   // Get the current title
                   $title = wpcf7dtx_get_current_var(array('key' => 'post_title'));
                   // Return with desired format and additional text
                   return sprintf(
                       'I am interested in working with you regarding %s on %s',
                       $title,
                       $date->format('j/n/y')
                   );
               }
           }
           return ''; // Return empty string on failure
       }
       add_shortcode('gcarnegie_textarea', 'gcarnegie_textarea');
       ```
   
 * And then in your form tag, you can simply use this:
 *     ```wp-block-code
       [dynamic_textarea your-message "gcarnegie_textarea"]
       ```
   
    -  This reply was modified 2 years, 2 months ago by [Tessa (they/them), AuRise Creative](https://wordpress.org/support/users/tessawatkinsllc/).
      Reason: Wrong date format in code, whoopsies

Viewing 1 replies (of 1 total)

The topic ‘Multiple Parameters in a single CF7 field’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7-dynamic-text-extension/assets/icon-256x256.
   png?rev=3019574)
 * [Contact Form 7 - Dynamic Text Extension](https://wordpress.org/plugins/contact-form-7-dynamic-text-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-dynamic-text-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-dynamic-text-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-dynamic-text-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-dynamic-text-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-dynamic-text-extension/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tessa (they/them), AuRise Creative](https://wordpress.org/support/users/tessawatkinsllc/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/multiple-6/#post-17509978)
 * Status: resolved