fritids

Untitled

Apr 30th, 2012
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.50 KB | None | 0 0
  1. <?php
  2. /**
  3.  * JobRoller Submit Job Process
  4.  * Processes a job submission.
  5.  *
  6.  *
  7.  * @version 1.0
  8.  * @author AppThemes
  9.  * @package JobRoller
  10.  * @copyright 2010 all rights reserved
  11.  *
  12.  */
  13.  
  14. function jr_process_submit_profile_form( /*$success_redirect = '' */) {
  15.    
  16.     nocache_headers();
  17.  
  18. //appthemes_auth_redirect_login();
  19. global $current_user, $wp_roles, $post, $posted;
  20. get_currentuserinfo();
  21.  
  22. $userdata = wp_get_current_user(); // grabs the user info and puts into vars
  23.  
  24. // check to see if the form has been posted. If so, validate the fields
  25. if(!empty($_POST['submit'])) {
  26.  
  27.     require_once(ABSPATH . 'wp-admin/includes/user.php');
  28.     require_once(ABSPATH . WPINC . '/registration.php');
  29.  
  30.     check_admin_referer('update-profile_' . get_current_user_id());
  31.  
  32.     $errors = edit_user($user_ID);
  33.  
  34.     $errmsg = '';  
  35.     if ( is_wp_error( $errors ) ) foreach( $errors->get_error_messages() as $message ) $errmsg = $message;
  36.  
  37.     // if there are no errors, then process the ad updates
  38.     if($errmsg == '') {
  39.         // update the user fields
  40.         do_action('personal_options_update', $user_ID);
  41.  
  42.         // update the custom user fields
  43.         foreach ( array( 'twitter_id', 'facebook_id', 'linkedin_profile' ) as $field )
  44.             update_user_meta($user_ID, $field, strip_tags(stripslashes($_POST[$field])));
  45.  
  46.         $d_url = $_POST['dashboard_url'];
  47.         wp_redirect( './?updated=true&d='. $d_url );
  48.  
  49.     } else {
  50.         $errmsg = '<ul class="errors"><li>' . $errmsg . '</li></ul>';
  51.     }
  52. }  
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment