Custom Fields
Re-Envisioned
Support General Post title and custom field

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #31316
    Long Nguyen
    Moderator

    Hi Mariano,

    In your case, the code should be

    add_action( 'rwmb_gruppo-campi-pazienti-orto_after_save_post', 'update_post_title' );
    
    function update_post_title( $post_id ) {
        // Get the field value
        $my_meta = rwmb_meta( 'text_f71tmmr7ws', '', $post_id );
        
        // Preprare update post
        $my_post = array(
            'ID' => $post_id,
            'post_title' => $my_meta,
        );
    
        wp_update_post( $my_post );
    }

    Let me know how it goes.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.