Save and Reuse Custom Fields

This topic contains 5 replies, has 2 voices, and was last updated by  Stiofan O’Connor 7 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #367317

    Wayne Harvey
    Expired Member
    Post count: 102

    Hi there,
    Just wondering if there is a way to save or copy a custom field for reuse. I’ve got several fields that I’m wanting to replicate all but a couple of the settings. I notice that on the custom fields page, there are 3 sections: Setup New Field, Predefined Fields and Custom Fields at the bottom. How do you use the the Custom Fields area. It kind of looks like I should be able to maybe save my fields to there for reuse?? Is there a way to create my own Predefined Fields because that would give me the functionality I need?
    I did have a look at https://wpgeodirectory.com/custom-field-improvements-in-new-v1-6-6/
    but that seemed a little more complex in that it involves outputting a twitter feed as well. Is there a more concise or simpler way to do what I’m after?
    Hope I explained clearly enough!
    Cheers
    Wayne

    #367481

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Wayne,

    You can use that example, just give it a uninque name, so instead of
    $custom_fields[‘twitter_feed’] make it something like $custom_fields[‘my_custom_x’]

    It’s the field type that sets why type of field it is and you can fill everything else in from there.

    Stiofan

    #367610

    Wayne Harvey
    Expired Member
    Post count: 102

    OK, thanks for the quick reply, I’ll try it in a couple of days and see how I make out.
    Wayne

    #368348

    Wayne Harvey
    Expired Member
    Post count: 102

    Hi Stiofan
    I created the custom field but have a couple of quick questions.
    Some of the custom field types I want to add are not just “text” fields. For example, if I want to add a multiselect input fields and file upload fields what do I substitute the bolded code below with, is it “select”. Do you have a list of the exact field type names that I can use?

    ‘field_type’ => ‘text‘, //
    ‘class’ => ‘gd-twitter’,
    ‘icon’ => ‘fa fa-twitter’,

    Also, how would I pre-define the option values for a multiselect field?
    Can I predefine field display locations?
    Thanks
    Wayne

    #368350

    Wayne Harvey
    Expired Member
    Post count: 102

    Hello again,
    I have been digging around in you various functions files and have found out the answers to all of the above questions. Sorry for the bother.
    Thanks again,
    Wayne

    #368539

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Wayne,

    Thanks for letting us know, just for anyone else reading this you can find some examples here: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-admin/dummy-data/property_sale.php

    Thanks,

    Stiofan

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount