Remove or deactivate unneeded predefined fields

This topic contains 6 replies, has 3 voices, and was last updated by  Alex Rollin 5 years, 6 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #488076

    Steven
    Full Member
    Post count: 38

    I’d like to remove predefined fields that I’ll never use, like real estate-related ones, from the list of available fields in ADD NEW EVENT FORM FIELD in SETTINGS/CUSTOM FIELDS. How can I do that please?

    Thanks

    #488086

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Steven,

    Here is a code snippet you can add (via the code snippet plugin)
    that will remove the property ones, you can do the same with any of them:

    add_filter('geodir_custom_fields_predefined','_my_hide_gd_predefineds',10,2);
    function _my_hide_gd_predefineds($custom_fields, $post_type ){
      
      // You can unset any field you want
      unset($custom_fields['property_status']);
      unset($custom_fields['property_furnishing']);
      unset($custom_fields['property_typeproperty_bedrooms']);
      unset($custom_fields['property_bedrooms']);
      unset($custom_fields['property_bathrooms']);
      unset($custom_fields['property_area']);
      unset($custom_fields['property_features']);
     
      return $custom_fields;
    }

    Thanks,

    Stiofan

    #488088

    Steven
    Full Member
    Post count: 38

    Hi Stiofan,

    Thanks for the quick and easy to follow reply!

    Steve

    #488090

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You are welcome 🙂

    #488094

    Steven
    Full Member
    Post count: 38

    That worked like a charm…and took all of a minute to do!

    It defaults to RUN SNIPPET EVERYWHERE. Should I leave it at that?

    After you answer you can close this discussion if you want.

    Thanks,
    Steve

    #488097

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    The ideal setting would be admin only, it does not need to run on the Frontend.

    Thanks,

    Stiofan

    #488100

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
Viewing 7 posts - 1 through 7 (of 7 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