Forums

custom field display (1 post)

  1. realobject
    Member
    Posted 1 month ago #

    When setting up several custom fields in a post, these fields do not always appear in the order they were input.

    I found a possible answer to the problem by updating the
    pop.php - update_postmeta_cache() function.

    The original instruction is
    'if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key,
    meta_value FROM $wpdb->postmeta WHERE post_id IN ($id_list)", ARRAY_A)
    ) {'

    It has been changed to:
    'if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key,
    meta_value FROM $wpdb->postmeta WHERE post_id IN ($id_list) order by
    meta_id", ARRAY_A) ) {'

    where the custom fields are order by meta_id.

    Is this update correct. Is there any impact in some other part of the
    application?

Reply

You must log in to post.

About this Topic