Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Edit Profile
- *
- * This is the template that displays our custom artists list page layout.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
- get_header(); ?>
- <div id="primary">
- <div id="content" role="main">
- <?php
- global $user_ID, $current_user;
- if( !$user_ID >= 1) {
- $user_ID = $current_user->ID;
- }
- $user_info = get_userdata($user_ID);
- ?>
- <div class="editprofile-top">
- Welcome <a href="<?php echo get_author_posts_url($user_ID); ?>"><?php echo $user_info->display_name; ?></a>. You can view your profile <a href="<?php echo get_author_posts_url($user_ID); ?>">here</a>.
- </div><!--END EDIT PROFILE TOP-->
- <div id="tabs" class="ui-tabs">
- <ul class="edit-tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header">
- <li class="tab edit-profile"><a href="#edit-profile">Edit Profile</a></li>
- <li class="tab add-work"><a href="#add-work">Add Work</a></li>
- <li class="tab add-event"><a href="#add-event">Add Event</a></li>
- </ul>
- <div id="edit-profile" class="ui-tabs-panel ui-widget-content">
- <?php if(!is_user_logged_in()){
- _e('You must be logged in to edit your profile.', 'profile');
- echo '<br/>';
- login_with_ajax();
- } else {
- /* Update user password. */
- if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
- if ( $_POST['pass1'] == $_POST['pass2'] ) {
- wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );
- } else {
- $error = __('The passwords you entered do not match. Your password was not updated.', 'profile');
- }
- }
- ?>
- <?php if ( $error ) {
- echo '<p class="error">' . $error . '</p>';
- }?>
- <form id="your-profile" enctype="multipart/form-data" action="<?php the_permalink(); ?>" method="post">
- <?php wp_nonce_field('update-user_' . $user_id); ?>
- <?php if ( $wp_http_referer ) : ?>
- <input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" />
- <?php endif; ?>
- <p>
- <input type="hidden" name="from" value="profile" />
- <input type="hidden" name="checkuser_id" value="<?php echo $user_ID ?>" />
- </p>
- <?php $collective =& Collective::get_instance();
- $collective->admin_edit_profile();
- ?>
- <div class="update">
- <input type="hidden" name="action" value="update" />
- <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user_id); ?>" />
- <input name="updateuser" type="submit" id="updateuser" class="submit button" value="<?php _e('Update Profile', 'profile'); ?>" />
- </div><!-- /.update -->
- </form>
- <?php } ?>
- </div><!-- /#edit-profile -->
- <div id="add-work" class="ui-tabs-panel ui-widget-content">
- <?php gravity_form(4); ?>
- </div><!-- /#add-work -->
- <div id="add-event" class="ui-tabs-panel ui-widget-content">
- <?php gravity_form(1); ?>
- </div><!-- /#add-event -->
- </div><!-- /#tabs -->
- </div><!-- #content -->
- </div><!-- #primary -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement