WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Order
This plugin deletes all custom post meta data (3 posts)

  1. nicole2292
    Member
    Posted 2 years ago #

    WARNING! Do not use the custom post order plugin if you have custom metadata saved for your posts using custom fields. After reordering with this plugin ALL custom meta data for the posts you reordered will be LOST!

    Drew, please provide a fix asap! This is a massive problem which could have potentially disastrous effects for users with a lot of custom meta data on their sites.

    Nicole

    http://wordpress.org/extend/plugins/order-up-custom-post-order/

  2. nicole2292
    Member
    Posted 2 years ago #

    OK I have now found a workaround for this so that you don't lose your custom meta data when using this plugin.

    You must include an if statement before you use update_post_meta() so that update_post_meta() will not be run with empty meta data fields when the plugin saves the post order.

    function save_custom_featured_fields($postid) {
    	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
    		return;
    	if(isset($_POST['featured']))
    	update_post_meta( $postid, 'featured', $_POST['featured'] );
    }
    
    add_action( 'edit_post', 'save_custom_featured_fields' );

    I hope this helps anyone else who is experiencing this problem.

  3. Eric J T
    Member
    Posted 1 year ago #

    Does the currently available version of this plugin solve this issue?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic