2

Is it possible to set the postDate for a new (disabled) entry created using the GuestEntries plugin?

Otherwise when posting a GuestEntry the postDate is not set until the entry is enabled or re-saved from Craft.


Posting this with an answer as it may be useful to other people. If there are better ways to do this please add them.

1 Answer 1

3

You can add a hidden field for your postDate to your GuestEntry form, e.g.

<input type="hidden" name="postDate" value="{{ now|date("Y-m-j H:i:s") }}" />

This adds the postDate using Craft's YYYY-MM-DD HH:MM:SS format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.