/** * GET USER ASOCIATION POSITION ***********************************/ function wpdc_the_asociation_position($user_id) { $output = ''; if (is_user_role('subscriber', $user_id)) { $output .= change_role_name('subscriber'); if (get_the_author_meta('asociation_status', $user_id) == 'pendiente') { $output .= ' | Pendiente de asociaciarse'; } } else { $pos = get_the_author_meta('asociation_position', $user_id); $res = get_the_author_meta('asociation_responsability', $user_id); if (!empty($pos)) { $output .= change_role_name($pos); } if (!empty($pos) && !empty($res)) { $output .= ' | '; } if (!empty($res)) { $output .= change_role_name($res); } if (empty($res) && empty($pos)) { $output .= change_role_name('author'); } } echo $output; }
<option value="author" <?php if ($filter == 'author') { echo 'selected'; } ?> ><?php echo change_role_name('author'); ?> </option> <option value="editor" <?php if ($filter == 'editor') { echo 'selected'; } ?> ><?php echo change_role_name('editor'); ?> </option> </select> </div> <div class="wrap wrap--frame wrap--frame__middle"> <select name="order"> <option value="registered" <?php if ($order == 'registered') { echo 'selected'; } ?> >Fecha creación</option> <option value="validate_date" <?php if ($order == 'validate_date') {
<figure class="wrap wrap--photo"> <a href="<?php echo get_author_posts_url($user->ID); ?> "> <img src="<?php if (function_exists('get_wp_user_avatar_src') && get_wp_user_avatar_src($user->ID, 100, 'medium') != '') { echo get_wp_user_avatar_src($user->ID, 100, 'medium'); } elseif ($user->userphoto_image_file != '') { echo get_bloginfo('url') . '/wp-content/uploads/userphoto/' . $user->userphoto_image_file; } else { echo get_stylesheet_directory_uri() . '/img/default/nophoto.png'; } ?> "/> <div class="overflow overflow--black"> <p> <?php if (get_the_author_meta('asociation_position', $user->ID) != '') { echo '<strong>' . change_role_name(get_the_author_meta('asociation_position', $user->ID)) . '</strong>'; } ?> <?php echo '<br>' . get_the_author_meta('first_name', $user->ID) . '<br>' . get_the_author_meta('last_name', $user->ID); ?> </p> </div> </a> </figure> </div>
if (!empty($_POST['presidente'])) { foreach ($juntales as $juntal) { if (get_the_author_meta('asociation_position', $juntal->ID) == 'presidente') { $juntal->remove_role('editor'); $juntal->add_role(esc_attr('author')); update_user_meta($juntal->ID, 'asociation_position', ''); update_user_registry_track($juntal->ID, 'sin cargo'); } } foreach ($juntales as $juntal) { if ($juntal->ID == $_POST['presidente']) { $juntal->remove_role('author'); $juntal->add_role(esc_attr('editor')); update_user_meta($juntal->ID, 'asociation_position', 'presidente'); $msg .= '<p>El usuario ' . wpdc_get_user_name($juntal->ID) . ' es el nuevo lider!</p>'; update_user_registry_track($juntal->ID, change_role_name('presidente')); } } } } if ($msg) { $alerts_success .= $msg; } } /* CONFIGURATION SECRETARY * ***************************************************** */ if (esc_attr($_POST['action']) == 'configuration-secretary') { if (esc_attr($_POST['updatesection']) == 'change_member_status') { $msg = '';