Tagged: capability, elegant solution, metabox, post status, role, tricky
- This topic has 2 replies, 2 voices, and was last updated 7 years, 6 months ago by
zanedickens.
-
AuthorPosts
-
-
July 16, 2014 at 3:08 pm #2015
zanedickensMemberI was hoping someone would be able to point me in a more elegant and less brute force approach to my particular problem.
- I have a numerous custom post types – all award entry forms.
- I have five judges who need to score each entry
- The judges must not be able to see each other’s scores
- The number of questions changes per post type / entry
At the moment I have:
A metabox that can only be seen by capability ‘judge’ – which allows all five judges to see the scoring box.
The scorecard is a select per question (8 in this instance) which the judge then selects and updates the entry (CPT). That’s fine for one judge marking all posts.
But the problem comes in with 5 judges (who cannot see each other’s scores) and 12 different CPTs with different questions e.g. 5 questions, 7 questions, 9 questions
Which leads me to making 60 different metaboxes!
Which is is fine if I didn’t care about the future maintenance of the project or doing it properly.
I had thought to use the Comment Metabox but I can’t see a way to have anything but a text field :/
I’d appreciate any suggestions, thanks in advance!
-
July 16, 2014 at 10:31 pm #2019
SteveKeymaster@zanedickens– Luckily you’re using Piklist 😉
You can easily save the data to the current users profile. This way you use ONE Post Type form, but save the data as user_meta.
First make sure that this is at the top of each file:
$current_user = wp_get_current_user();
Add this to each field:
,'scope' => 'user_meta' ,'object_id' => $current_user->ID
This should work with the current version of Piklist. If not, email us at [email protected]
-
July 22, 2014 at 2:08 pm #2037
zanedickensMemberThanks Steve! I’ll give it a go and report back. I’m now using Piklist on two projects and seeing it as an essential part of any future ones. Thank you for all the time and effort you have put in this.
-
-
AuthorPosts
- The topic ‘Have a Metabox take inputs’ is closed to new replies.