Hi,
2 questions:
1) I have created a cpt called Notes which is a child of Posts, so Notes can be added to Posts (note name, due date, note status). I'd also like to be able to also have a field to select an Admin or an Editor user to apply/assign to each Note. So I was thinking I could possible create a checkboxes or select field and then somehow auto-populate it with all users of those 2 roles Is this possible?
2) Is it possible to somehow have this Notes cpt trigger an email reminder X days before the "due date" field is reached?
Thanks,
Tim
Hello,
Q1) If you are going to setup one-to-one relationship between "Notes" post and WordPress users, the best option is using WP built-in feature post author, you can try these:
1) Edit post type "Notes", in section "Sections to display when editing", enable option "Author".
2) Edit each "Notes", you can setup the post author of it.
Q2) This is possible with Toolset Forms plugin, see our document:
https://toolset.com/course-lesson/setting-up-automatic-post-expiration/
section "Sending email notifications when posts expire", screenshot:
https://toolset.com/wp-content/uploads/2014/08/cred-post-expiration-notification-options-1.png
Thanks, that sort of works, but if I want to create or edit a Note from within a Blog post, I can only edit the custom fields, I would not be able to add/change the Note Author.
hidden link
Tim
There isn't such kind of built-in feature within Toolset Types plugin, as I mentioned above, you need to edit each single "Note" post, and setup it's post author.
oh, you mean I would have to set the Author manually? There's no way an Author select field can be added to a Toolset form?
I'm sure I've seen other forum topics about adding cred forms and adding author select fields to forms... no?
Tim
There isn't such kind of built-in feature within Toolset plugins, it needs custom codes, for example, you can create a custom select field, use filter hook "wpt_field_options" to trigger a custom PHP function:
https://toolset.com/documentation/programmer-reference/types-api-filters/#wpt_field_options
Get the WordPress users you want, and populate the select field options:
https://developer.wordpress.org/reference/functions/get_users/
Then put above custom field into your post form for creating new Notes.
After user submit the form, use action hook "cred_save_data" to trigger a PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
In above PHP function, update the post author to the specific user:
https://developer.wordpress.org/reference/functions/wp_update_post/
For your reference.
OK, please let me know if you need more assistance for it. thanks