Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.6.11, custom field, hidden field
- This topic has 3 replies, 3 voices, and was last updated 8 years, 10 months ago by
Steven Zahm.
-
AuthorPosts
-
10/19/2017 at 11:32 am #438297
Randy Abidin
ParticipantHi Steven,
I’ve created custom fields and would like to make them hidden.
I’ve successfully created the custom fields via your QuickTips.
However, I populate one of these fields programmatically and do not want an editor/admin to see or modify the content of this field.I tried replacing ‘text’ with ‘hidden’ in the custom field definition but it removes it completely from the form.
After creating the custom field, if I remove the script from QuickTips so it does not appear on the update screen, that custom field then shows up in the WordPress Custom Fields section of the member’s update screen.
Any suggestion on how to make this hidden to editor/admin?
Thanks!
Randy10/19/2017 at 12:26 pm #438302Steven Zahm
Keymaster@ Randy
So, you need the field in the form, but hidden, correct? Untested but you should be able to this…
Change the field type from
textto hidden in your existing code.Add the code to the snippet:
add_action( 'cn_meta_field-hidden', 'cn_register_custom_hidden_field', 10, 3 ); function cn_register_custom_hidden_field( $field, $value, $entry ) { cnHTML::input( array( 'type' => 'hidden', 'prefix' => '', 'class' => '', 'id' => $field['id'], 'name' => $field['id'], 'readonly' => isset( $field['readonly'] ) && TRUE === $field['readonly'] ? TRUE : FALSE, 'before' => '', 'after' => '', ), $value ); }Hope that helps, let me know.
10/19/2017 at 3:59 pm #438310Randy Abidin
GuestSteven,
Perfect!!!!
Thanks
Randy10/20/2017 at 9:01 am #438349Steven Zahm
Keymaster@ Randy
Great to hear :)
-
AuthorPosts
- You must be logged in to reply to this topic.
