• Resolved motivmedia

    (@motivmedia)


    Currently looking into creating CF7 forms from another (homebrewn) plugin. It sems that most things things are in post_content AND postmeta: _form, _mail, _mail_2, _messages, _additional_settings. Which means just _locale is only in postmeta. Frontend and backend exclusively use the postmeta. Emptying the post_content and then copying the form results in the copy again having the content, so I assume any kind of saving action, either manually via the admin or copying, recreates the post_content.

    So if I create a form programmatically, could I just leave the post_content empty?

    And if so, out of curiosity, what’s the purpose of (re)creating and having the post_content this way?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Contact Form 7 puts a concatenated string of all the contact form properties into the post_content column. By default, the search query (?s=) targets of WordPress are post_content and post_title. Therefore, having text for search in post_content is very convenient when you want to make your CPT data WP search-compatible.

    Thread Starter motivmedia

    (@motivmedia)

    Hi @takayukister, that makes a lot of sense 🙂 Thank you for the info!
    From that I take, that for creating a functioning form, the post_content doesn’t matter, right?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Right.

    Thread Starter motivmedia

    (@motivmedia)

    Awesome! 😀
    Marking this as solved. And while I have your attention:
    Thank you for your great work!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Creating forms programmatically’ is closed to new replies.