Problem:
The main issue being described here is that the user wanted to update their custom field using php.
Solution:
To do this you will need to use the function in the link below.
https://codex.wordpress.org/Function_Reference/update_post_meta
A practical example of this can be seen below.
function save_post_func_2134( $post_id ) { $post_type = 'doctor-order'; if ( $post_type == get_post_type ( $post_id ) ) { $my_post = array( 'ID' => $post_id, 'order-id' => 'dts-' . $post_id, 'post_title' => 'dts-' . $post_id ); update_post_meta( $post_id, 'wpcf-order-id', 'dts-'.$post_id); remove_action('save_post', 'save_post_func_2134'); wp_update_post( $my_post ); } } add_action( 'save_post', 'save_post_func_2134' );
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.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
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)
Este tema contiene 2 respuestas, tiene 2 mensajes.
Última actualización por hace 5 años, 4 meses.
Asistido por: Shane.