Support » How-To and Troubleshooting » Lose the data in Custom Fields

Lose the data in Custom Fields

  • nicojaure



    I’m having some problems with the custom fields.
    I have made a custom post type and modified the admin to make the custom fields more friendly.
    I’m using:

    add_action("admin_init", "add_muro");
    add_action('save_post', 'update_muro');
    add_action('edit_post', 'update_muro');

    Everything seems great but after some time the flieds appear empty.

    Can you helpme with some tip?
    Tell me if you need to know anything else…


Viewing 4 replies - 1 through 4 (of 4 total)
  • extatix


    It’s autosave that messes it up. Did you include

    if ( defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE )
    		return $post_id;
    		if ('page' == $_POST['post_type']) {
            if (!current_user_can('edit_page', $post_id)) {
                return $post_id;
        } elseif (!current_user_can('edit_post', $post_id)) {
            return $post_id;

    in your functions?



    thanks extatix!
    I thought it was the autosave but I was not sure.

    I’m not using it
    where it should be?
    I’m puting it before “funtion xx (yy) {” and after the rest of the code.

    thanks again.



    I’ve put it in my save function.



    I did it but the problem is still there.
    Did it solve it in your case?
    Are there any way to turn off autosave?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Lose the data in Custom Fields’ is closed to new replies.
Skip to toolbar