Created
March 2, 2012 05:27
-
-
Save jackperry/1955918 to your computer and use it in GitHub Desktop.
Wordpress Save Custom Fields on Autosave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function save_fields() | |
{ | |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) | |
return $post_id; | |
global $post; | |
update_post_meta($post->ID, 'field_name', $_POST['field_name']); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment