Modifying Core Files

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

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

Open Support Ticket
  • Author
    Posts
  • #15065

    boxportable
    Buyer
    Post count: 42

    I have found myself making many many edits to core files, I know you can copy the template folder over to your theme directory to make sure edits to these files are protected but what about core edits?

    I find myself having to update 20+ files every update to include the changes I made again

    #15100

    Paolo
    Site Admin
    Post count: 31206

    Core edits should only be made using hooks and filters. And if a hook for the mod you want to make isn’t available it should be requested.

    There is no other possible solution to this…

    #15160

    boxportable
    Buyer
    Post count: 42

    Where can I find a complete list of hooks and filters?

    I looked at the documentation wiki thing on the site it doesn’t seem to list any… unless I completely missed them

    #15195

    Paolo
    Site Admin
    Post count: 31206

    Developers documentation is still under construction.

    Given that we are still adding/editing hooks listening to members feedback, we prefered to hold on untill we had a more definitive list.

    The idea is to take wordpress codex as example and edit a page for each and every function of the plugin.

    This as you can imagine will require time and it will be a work in progress.

    At the moment you can find most in geodirectory_hooks_actions.php and for templates in geodirectory_template_actions.php

    Ask questions here for any doubt.

    Thanks

    #15388

    boxportable
    Buyer
    Post count: 42

    What hooks would I use for custom field html?

    I have added in 2 new custom fields for the plugin one field for extra listing images using the WordPress media manager and another plugin to set business opening hours per day to show “closed, closing soon, open, opening soon” on the front end.

    These were added by editing 3 files and adding some extra script files for the media manager etc, I don’t know how this can be accomplished with hooks as I have placed my edits in the same places as the current fields which is in the middle of switches and if statements :/

    #15391

    boxportable
    Buyer
    Post count: 42

    When editing actions in the core files I take it I should be copying the whole action to the template files then removing the action and re-adding it and then having my modified code this way?

    #15444

    Paolo
    Site Admin
    Post count: 31206

    That is correct.

    If you want to check out some exmaples, you can look through this posts : https://wpgeodirectory.com/support/search/?bbp_search=remove_action

    Thx

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