Re-arrange custom fields after creation

We created a number of custom fields but realized a very important, 4th item was left out. Now it's at the bottom of the post custom fields, how can I change the order?

I couldn't see a way to re-arrange in the CustomPress plugin?

  • DavidM

    Just as a bit of additional information, I ran through a test of this and was indeed able to change the order by re-ordering the items in the database.

    The custom fields are all stored sequentially ( after the initial 'a{' ) in ct_custom_fields in wp_options and each field should show somewhat like the following:
    s:18:"text_4ddb00c2af7e6";a:7:{s:11:"field_title";s:4:"testfield";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:8:"Test Field.";s:11:"object_type";a:1:{i:0;s:5:"tests";}s:8:"field_id";s:18:"text_4ddb00c2af7e6";}

    You can simply arrange those fields to be in the order your prefer them.

    Given there's not currently an option, this does appear to function as a workaround, but I will mention this to the developers in case it can be added easily as an option.

  • Bob Randklev

    Ok thanks for the suggestion but where does the field start and stop?

    I've looked at the table many times but cannot see where the "City" field starts and stops?
    a:8:{s:22:"textarea_4de55c8ac59e4";a:7:{s:11:"field_title";s:24:"Organization Description";s:10:"field_type";s:8:"textarea";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:26:"Describe your organization";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:22:"textarea_4de55c8ac59e4";}s:18:"text_4de55cac5c74b";a:7:{s:11:"field_title";s:7:"Address";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:25:"Enter your street address";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55cac5c74b";}s:18:"text_4de55cbfd2862";a:7:{s:11:"field_title";s:5:"State";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:0:"";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55cbfd2862";}s:18:"text_4de55cd3eb99a";a:7:{s:11:"field_title";s:3:"Zip";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:0:"";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55cd3eb99a";}s:18:"text_4de55cea85e18";a:7:{s:11:"field_title";s:5:"Phone";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:0:"";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55cea85e18";}s:18:"text_4de55d273062d";a:7:{s:11:"field_title";s:8:"Map Link";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:27:"Link to online map location";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55d273062d";}s:18:"text_4de55d3fa72f3";a:7:{s:11:"field_title";s:7:"Website";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:25:"Your organization website";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55d3fa72f3";}s:18:"text_4dee85f9b9321";a:7:{s:11:"field_title";s:4:"City";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:0:"";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4dee85f9b9321";}}

  • DavidM

    Hi bobrandklev,

    Fortunately, how it's displaying when pasted here makes it easier to see where they're separated! The following appears to be your City field:
    s:18:"text_4dee85f9b9321";a:7:s:11:"field_title";s:4:"City";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:0:"";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4dee85f9b9321";}

    And I believe the following would be what you're looking for, with that City field as the 4th item?
    a:8:{s:22:"textarea_4de55c8ac59e4";a:7:{s:11:"field_title";s:24:"Organization Description";s:10:"field_type";s:8:"textarea";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:26:"Describe your organization";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:22:"textarea_4de55c8ac59e4";}s:18:"text_4de55cac5c74b";a:7:{s:11:"field_title";s:7:"Address";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:25:"Enter your street address";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55cac5c74b";}s:18:"text_4de55cbfd2862";a:7:{s:11:"field_title";s:5:"State";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:0:"";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55cbfd2862";}s:18:"text_4dee85f9b9321";a:7:{s:11:"field_title";s:4:"City";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:0:"";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4dee85f9b9321";}s:18:"text_4de55cd3eb99a";a:7:{s:11:"field_title";s:3:"Zip";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:0:"";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55cd3eb99a";}s:18:"text_4de55cea85e18";a:7:{s:11:"field_title";s:5:"Phone";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:0:"";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55cea85e18";}s:18:"text_4de55d273062d";a:7:{s:11:"field_title";s:8:"Map Link";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:27:"Link to online map location";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55d273062d";}s:18:"text_4de55d3fa72f3";a:7:{s:11:"field_title";s:7:"Website";s:10:"field_type";s:4:"text";s:16:"field_sort_order";s:7:"default";s:20:"field_default_option";N;s:17:"field_description";s:25:"Your organization website";s:11:"object_type";a:1:{i:0;s:8:"drawings";}s:8:"field_id";s:18:"text_4de55d3fa72f3";}}

    How would that work for you?

  • DavidM

    Hi guys,

    I agree, it'd be great to see this added directly in CustomPress. We've got a new developer on board for this. I'll try and see if there are any plans with this one.

    Meanwhile, and while I understand any hesitation in adding yet another plugin, this one's quite an extensive one that's well worth looking into. The Custom Fields Suite plugin provides for very extensive management of custom fields and it works perfectly alongside CustomPress.
    http://wordpress.org/plugins/custom-field-suite/

    Perhaps that may work for ya?

    Cheers,
    David