WordPress.org

Forums

Contact Form 7 Dynamic Text Extension
[resolved] get custom_field based on post id and key (2 posts)

  1. Popescu M
    Member
    Posted 1 year ago #

    Hi, I have a small directory website where visitors can click on a send email button that opens a page like site.com/send-email/id where id is the post_id and then send an email to the company which has that id.

    How can I populate the contact form email address based on the custom field key and that id? I saw [dynamictext recipient-email uneditable "CF7_get_custom_field key='user_email'"] but is there a way to get the variable from the url and use it?

    Thank you!

    https://wordpress.org/plugins/contact-form-7-dynamic-text-extension/

  2. sevenspark
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Popescu,

    That ID is likely stored in a $_GET variable, so you may be able to retrieve it that way. Alternatively, you could parse the URL, but the value is almost certainly present in either the $_GET array or Query Vars.

    If you need to determine a value based on both a custom field and the post ID, you'd probably need to write a custom shortcode to do that.

    Hope that helps,

    Chris

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7 Dynamic Text Extension
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.