Updating – Effects custom code?

This topic contains 4 replies, has 4 voices, and was last updated by  Paolo 9 years, 9 months ago.

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

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #12418

    boxportable
    Buyer
    Post count: 42

    If I modify some core files will updating replace these?

    I added stuff to the custom-field files mainly.

    #12419

    purpleedge
    Expired Member
    Post count: 539

    If you modified code in the geodirectory plugin folders then yes they will be overwritten.

    If you want to modify code you need a child theme and you copy the bits you want to modify to your functions.php file, or copy the whole file to a /geodirectory/ folder in your child theme.

    #12432

    Guust
    Moderator
    Post count: 29970

    PurpleEdge is 100% correct. [thanks]

    #12647

    boxportable
    Buyer
    Post count: 42

    Being able to copy the template files over if fine but in regards to custom fields I coded into 3 of the core files that wont be possible or will I need to add all the code modifications into my own functions.php?

    Doing that isn’t easy because the code I added was within switches and if statements in the core files.

    I mean that doesn’t seem very developer friendly am I going about adding my own custom fields the wrong way? should I be using some hooks?

    #12689

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    modoifying the files of a plugin is never a good idea. Obviously updates will overwrite your changes and there is nothing we can do about that.

    The only way to modify a plugin to make sure it fits your needs is through hooks.

    If there are no hooks to specifically do what you need, you can ask for them and if we see a use for it that will be beneficial for most users, we will add them.

    Thank you

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

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

Open Support Ticket