Advertisement
Guest User

Problem Fix

a guest
Sep 22nd, 2011
1,094
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. // Saves the content of our meta box
  2. add_action( 'save_post', 'save_meta_details' );
  3.  
  4. // WP meta box attributes
  5. function save_meta_details( $post_id ) {
  6.     global $post;
  7.     // Skip auto save
  8.     if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
  9.         return $post_id;
  10.     }
  11.     // Check for your post type
  12.     if( $post->post_type == 'menu' ) {
  13.         if( isset($_POST['price']) ) { update_post_meta( $post->ID, 'price', $_POST['price'] );}
  14.  
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement