Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Saving values for metaboxes in wordpress

function wporg_save_postdata( $post_id ) {
    if ( array_key_exists( 'wporg_field', $_POST ) ) {
        update_post_meta(
            $post_id,
            '_wporg_meta_key',
            $_POST['wporg_field']
        );
    }
}
add_action( 'save_post', 'wporg_save_postdata' );
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Saving #values #metaboxes #wordpress
ADD COMMENT
Topic
Name
4+6 =