Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Saves the content of our meta box
- add_action( 'save_post', 'save_meta_details' );
- // WP meta box attributes
- function save_meta_details( $post_id ) {
- global $post;
- // Skip auto save
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
- return $post_id;
- }
- // Check for your post type
- if( $post->post_type == 'menu' ) {
- if( isset($_POST['price']) ) { update_post_meta( $post->ID, 'price', $_POST['price'] );}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement