Problem:
This customer had created a custom hook to auto assign some numbers to a custom field, however he wanted to prefix the numbers when they are being saved.
Solution:
To add a prefix when manually updating custom field take a look at the example below.
update_post_meta( $post_id, 'wpcf-checklist-task-id', 'SUP'.$last_id );
Notice that i added 'SUP'.$last_id, this will add the text 'SUP' to the id.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
This topic contains 1 reply, has 2 voices.
Last updated by 6 years, 10 months ago.
Assisted by: Shane.