Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it
    Registrato dal
    Apr 2014
    Messaggi
    323

    WordPress estendere profilo utente

    salve si può estendere il profilo utente tipo aggiungere , città, telefono, fax.

    avete idea?

  2. #2
    Utente di HTML.it
    Registrato dal
    Apr 2014
    Messaggi
    323
    ho trovato questo codice:

    codice:
    
    
    add_action( 'show_user_profile', 'extra_user_profile_fields' );
    add_action( 'edit_user_profile', 'extra_user_profile_fields' );
    
    
    function extra_user_profile_fields( $user ) { ?>
    <h3><?php _e("Extra profile information", "blank"); ?></h3>
    
    
    <table class="form-table">
    <tr>
    <th><label for="address"><?php _e("Address"); ?></label></th>
    <td>
    <input type="text" name="address" id="address" value="<?php echo esc_attr( get_the_author_meta( 'address', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description"><?php _e("Please enter your address."); ?></span>
    </td>
    </tr>
    <tr>
    <th><label for="city"><?php _e("City"); ?></label></th>
    <td>
    <input type="text" name="city" id="city" value="<?php echo esc_attr( get_the_author_meta( 'city', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description"><?php _e("Please enter your city."); ?></span>
    </td>
    </tr>
    <tr>
    <th><label for="province"><?php _e("Province"); ?></label></th>
    <td>
    <input type="text" name="province" id="province" value="<?php echo esc_attr( get_the_author_meta( 'province', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description"><?php _e("Please enter your province."); ?></span>
    </td>
    </tr>
    <tr>
    <th><label for="postalcode"><?php _e("Postal Code"); ?></label></th>
    <td>
    <input type="text" name="postalcode" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'postalcode', $user->ID ) ); ?>" class="regular-text" /><br />
    <span class="description"><?php _e("Please enter your postal code."); ?></span>
    </td>
    </tr>
    </table>
    <?php }
    
    
    add_action( 'personal_options_update', 'save_extra_user_profile_fields' );
    add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' );
    
    
    function save_extra_user_profile_fields( $user_id ) {
    
    
    if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
    
    
    update_user_meta( $user_id, 'address', $_POST['address'] );
    update_user_meta( $user_id, 'city', $_POST['city'] );
    update_user_meta( $user_id, 'province', $_POST['province'] );
    update_user_meta( $user_id, 'postalcode', $_POST['postalcode'] );
    }
    ?>
    va bene ?

    lo preso da qui:

    https://bavotasan.com/2009/adding-ex...-user-profile/ .

    Ma questo viene solamente quando faccio nuovo e modifica utente...

    per far che quando l'utente si registra come devo fare?

    Grazie mille e buona domenica.

  3. #3
    Utente di HTML.it
    Registrato dal
    Apr 2014
    Messaggi
    323
    nessuno?

  4. #4
    Moderatore di CMS L'avatar di kalosjo
    Registrato dal
    Jul 2001
    residenza
    In culo alla luna
    Messaggi
    1,999
    Non so se può esserti di aiuto questo plugin:

    https://it.wordpress.org/plugins/adv...custom-fields/

    ho trovato anche questo

    http://www.wpbeginner.com/plugins/ho...-registration/
    Scusate i puntini di sospensione...... La verità è che non ho argomenti....

  5. #5
    Utente di HTML.it
    Registrato dal
    Apr 2014
    Messaggi
    323
    ok, ora vedo..grazie mille.

  6. #6
    Utente di HTML.it
    Registrato dal
    Apr 2014
    Messaggi
    323
    ma uno gratis.. non c'è ne sono?
    Io lo faccio per divertimento ma non per lavoro..

    hai idea.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.