post_type ); /* Check if the current user has permission to edit the post. */ if ( !current_user_can( $post_type->cap->edit_post, $post_ID ) ) return $post_ID; // /* Get the posted data and sanitize it for use as an HTML class. */ $new_meta_value = ( isset( $_POST['accesstype_visibility'] ) ? sanitize_html_class( $_POST['accesstype_visibility'] ) : null ); $meta_key = 'accesstype_visibility'; /* update the meta value */ update_post_meta( $post_ID, $meta_key, $new_meta_value ); } // add hook for saving accesstype data for post add_action( 'save_post', 'accesstype_save_post_meta', 10, 2); ?>