Skip Navigation

[Gelöst] Al crear un registro de usuario que tambien se cree una entrada

This support ticket is created vor 2 Jahre, 7 Monate. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 Antwort, has 2 Stimmen.

Last updated by Luo Yang vor 2 Jahre, 7 Monate.

Assisted by: Luo Yang.

Author
Artikel
#2158227

Hola Nigel, como puedo hacer una vez el usuario se registra en el portal, se cree una entrada con su nombre de usuario ?
Tengo una entrada con el nombre de "usuarios" y una vez el usuario se registra al portal, con la funcion "Cread_save_data" quiero que se cree a la vez.
tengo este codigo:

add_action( 'cred_save_data', 'tssupp_author_term', 10, 2 );
function tssupp_author_term( $post_id, $form_data ){
  
    if ( in_array( $form_data['id'], array( 4427 ) ) ) {   // el numero 4427 es el ID del formulario para el registro del usuario
        
        $post = get_post( $post_id );
        $author_id = $post->post_author;   
        $author = get_the_author_meta( 'display_name', $author_id );
 
        wp_set_object_terms( $post_id, $author );
     }
}  

Pero no se donde indicar el nombre de la entrada "usuarios"
Haber si me puedes indicar como hacelo.
Saludos.
Rafa Corts

#2159267

Hello,

I can answer this ticket in English, hope it is not a problem.
I assume you are going to add a taxonomy term after user submit this post form.

If it is, you can replace this line from:

wp_set_object_terms( $post_id, $author );

To:

wp_set_object_terms( $post_id, $author, 'TAX-SLUG' );

Please replace TAX-SLUG with your custom taxonomy slug

More help:
https://developer.wordpress.org/reference/functions/wp_set_object_terms/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.