Required Custom Taxonomy Field - Not Required
Support › MB Term Meta › Required Custom Taxonomy Field - Not Required
- This topic has 3 replies, 2 voices, and was last updated 3 years, 4 months ago by
Long Nguyen.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
December 7, 2021 at 1:27 AM #32463
Nic
ParticipantHello,
I run the latest version of Metabox and WordPress multisite. I noticed today that for a custom taxonomy with custom fields made with Metabox, required fields are not required. So, even though I have marked the taxonomies custom fields as "required" the user can still create a new taxonomy post while leaving those required fields empty.
Is this an issue anyone else has run into? Is there an option I am missing or a way to fix it?
December 7, 2021 at 10:18 AM #32472Long Nguyen
ModeratorHi Nic,
Can you please share the code that creates custom fields on your site? I will re-check it on my site.
December 7, 2021 at 11:25 PM #32484Nic
ParticipantHere it is:
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Shifts', 'your-text-domain' ), 'id' => 'shifts', 'taxonomies' => ['shift'], 'fields' => [ [ 'name' => __( 'Start Time', 'your-text-domain' ), 'id' => $prefix . 'shift-start-time', 'type' => 'time', 'placeholder' => __( 'Military Time', 'your-text-domain' ), 'required' => true, 'tooltip' => [ 'icon' => '', 'position' => 'top', 'content' => 'Provide the time that the clinical shift starts in military time.', ], ], [ 'name' => __( 'End Time', 'your-text-domain' ), 'id' => $prefix . 'shift-end-time', 'type' => 'time', 'placeholder' => __( 'Military Time', 'your-text-domain' ), 'required' => true, 'tooltip' => [ 'icon' => '', 'position' => 'top', 'content' => 'Provide the time that the clinical shift ends in military time.', ], ], [ 'name' => __( 'Total Hours', 'your-text-domain' ), 'id' => $prefix . 'shift_total_hours', 'type' => 'number', 'desc' => __( 'In hours and minutes are decimals. Visit <a href="https://www.engineeringtoolbox.com/minutes-decimal-hours-d_1699.html">this website for minute decimal values.</a>', 'your-text-domain' ), 'min' => 0, 'max' => 24, 'std' => 12, 'required' => true, 'tooltip' => [ 'icon' => '', 'position' => 'top', 'content' => 'How many total hours will the student be at the clinical site for this shift? To display hours and minutes use decimals. .', ], ], ], ]; return $meta_boxes; }
December 8, 2021 at 11:16 AM #32486Long Nguyen
ModeratorHi,
Thanks, I see that issue. I've escalated it to the development team to fix it in the next update.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.