Index of /rel/released/software/own/WP-contact-2-post

Icon  Name                        Last modified      Size  Description
[PARENTDIR] Parent Directory - [   ] contact-2-post-1.0.0.zip 2026-09-26 13:43 12K [TXT] README.html 2026-09-26 13:43 4.3K make-core [TXT] README.md 2026-09-26 13:43 2.4K [TXT] readme.txt 2026-09-26 13:39 2.6K
make-core

WP-contact-2-post

Version: 1.0.0

Create a "Pending" post from a Contact Form 7 submission, after Flamingo saves it. The post content comes from a template page.

See readme.txt for the user documentation.


How it works

store-cf7-file-uploads saves images in wpcf7beforesendmail and fires nmrcreateattachmentidgenerated. This plugin collects those IDs.

Flamingo saves the message in wpcf7submit, then fires wpcf7afterflamingo with flamingoinboundid. This plugin hooks that action, so no post is made when Flamingo does not store the message (donotstore: true), or for spam.

The form's "createpost" and "posttemplate" Additional Settings are read with WPCF7ContactForm::istrue() and pref().

The template page is split with parseblocks(). Attribute blocks are removed, {field} is replaced only in the block HTML (not in the block comment JSON), then serializeblocks().


Notes

File fields: CF7 saves a hash of the file as the field value, so {file-field} in a template shows that hash. The images are attached to the post instead.

store-cf7-file-uploads only saves image files.

Post author is the user with the site's adminemail, else the lowest ID administrator. Content is still filtered by core kses, because kses checks the submitter (not logged in), not the author.

If publish-date is valid, the date is fixed (postdategmt is set), so publishing keeps it; a future date makes the post "Scheduled". If there is no valid publish-date, the post date "floats": it is set when the post is published.

ninja-auto-post-expire only acts on posts if its "Post" option is set to "Yes" in Settings, Post Expire Settings.


Test

test/setup.php and test/submit.php are run with wp-cli on a test site with all the plugins active. They are not in the dist zip.

wp eval-file test/setup.php
wp eval-file test/submit.php full attach   # post, attachment, expiry
wp eval-file test/submit.php notitle       # title UNDEFINED
wp eval-file test/submit.php nostore       # no post
wp eval-file test/submit.php nocreate      # no post
wp eval-file test/submit.php badslug       # no post, error_log
wp eval-file test/submit.php full spam     # no post
wp post list --post_type=post --post_status=pending