SHARE
TWEET

Untitled

a guest May 11th, 2012 23 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Save reordering from plugin settings page
  2. function psort_save_order() {
  3.        
  4.         global $mouldings_options;
  5.        
  6.         $list = $mouldings_options['profile_element_order'];
  7.         $new_order = $_POST['list_items'];
  8.         $new_list = array();
  9.        
  10.         // update order
  11.         foreach($new_order as $v) {
  12.                 if(isset($list[$v])) {
  13.                         $new_list[$v] = $list[$v];
  14.                 }
  15.         }
  16.  
  17.         $mouldings_options['profile_element_order'] = $new_list;
  18.        
  19.         // save the new order
  20.         update_option('mouldings_settings', $mouldings_options);
  21.        
  22.         die();
  23. }
  24. add_action('wp_ajax_psort_update_order', 'psort_save_order');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top