1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
<?php
global $current_user, $wp_roles;
$error = array();
/* If profile was saved, update profile. */
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'update-user' ) {
if ( !empty( $_POST['job_listing_category'] ) )
update_user_meta( $current_user->ID, 'job_listing_category', esc_attr( $_POST['job_listing_category'] ) );
if ( !empty( $_POST['metier'] ) )
update_user_meta( $current_user->ID, 'metier', $_POST['metier'] );
if ( !empty( $_POST['description'] ) )
update_user_meta( $current_user->ID, 'description', esc_attr( $_POST['description'] ) );
if ( count($error) == 0 ) {
do_action('edit_user_profile_update', $current_user->ID);
wp_redirect( get_permalink() );
exit;
}
}
?>
<form method="post" id="adduser" action="<?php the_permalink(); ?>">
<table>
<?php
function get_terms_dropdown_taxonomy($taxonomies, $args){
$taxonomies = array('job_listing_category'); // CHANGE ME
$args = array(
'order'=>'ASC',
'hide_empty'=>false,
'parent'=> 0
);
$myterms = get_terms($taxonomies, $args);
$optionname = "job_listing_category";
echo "<div class='input_wrap div_".$optionname."'>";
echo "<tr><td>Domaines :</td><td><select id='apskritis' class='select_".$optionname."' name='".$optionname."' required>'";
echo "<option value='0' >Domaines</option>";
foreach($myterms as $term){
if ( $term->parent == 0) {
echo "<option value='{$term->slug}'>{$term->name}</option>";
}
}
echo "</select></td></tr>";
echo "</div>";
} echo get_terms_dropdown_taxonomy($taxonomies, $args);
?>
<tr><td><?php _e('Préciser votre métier:', 'profile') ?></td>
<td>
<input type="text" name="metier" id="metier" required value="<?php the_author_meta( 'metier', $current_user->ID ); ?>"></input>
</td>
</tr>
<tr>
<td>
<label for="description"><?php _e('Dossier technique', 'profile') ?></label></td>
<td> <textarea name="description" id="description" rows="3" cols="50"><?php the_author_meta( 'description', $current_user->ID ); ?></textarea></td>
</tr><!-- .form-textarea -->
<?php
//action hook for plugin and extra fields
do_action('edit_user_profile',$current_user);
?>
<tr><td></td><td> <?php echo $referer; ?>
<input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profile'); ?>" />
<?php wp_nonce_field( 'update-user' ) ?>
<input name="action" type="hidden" id="action" value="update-user" /></td></tr></table>
</p>
</form> |
Partager