WordPress.org

Forums

Where to place my hacked code? (8 posts)

  1. prara
    Member
    Posted 11 years ago #

    Where should I place my hacked codes so I can see them and put them back in place whenever I upgrade my WP.

  2. Anonymous
    Unregistered
    Posted 11 years ago #

    If it is a hack, you'll have to create an empty my-hacks.php file, paste your hacks, then enable hacks in the admin options of WP. If it's a plugin, you simply drop the file in the wp-content/plugins folder (assuming you are using WP 1.2).

  3. prara
    Member
    Posted 11 years ago #

    How does the my-hacks.php work? Say I modified one function in wp-includes>links.php
    Thank you.

  4. prara
    Member
    Posted 11 years ago #

    Ok here's partly an answer: http://wiki.wordpress.org/index.php/my-hacks.php
    But how about that function I modified in links.php
    It can be sure overwritten when I upload a new version of WP.
    How do I place that in my-hacks.php?

  5. unoamigo
    Member
    Posted 11 years ago #

    A good way to do this is to simply turn your hack into a plugin, very little actually needs to be done for this to work. It pretty much involves adding the proper commenting to the top of your "hack."
    As a plugin you will also not need to include the 'wp-blog-header.php" in your code.
    Prara, with your modified link code, in order to avoid having the issue of losing it when you upgrade. Just give it a different name such as "prara_links()" and put it in your own custom Plugin file. Then you will always have it.
    Take a quick look at the source to some of the existing 1.2 Plugins and you will see just how easy it is to turn your hacks into plugins.
    Have Fun! :-)

  6. carthik
    Member
    Posted 11 years ago #

    unoamigo, I was wondering if you could write a quick and dirty (or clean and detailed) "How to write a plugin" if you are familiar with the scheme of things. That's a doc that will be useful that's missing right now. :)

  7. unoamigo
    Member
    Posted 11 years ago #

    Well, I'd be happy too, but it will have to wait till Tuesday or Wednesday. It's kindove finals week here and a paper is due Monday at 5PM, test on tuesday, presentation on Thursday.
    Yeah, I have a pretty slack finals week, but I should at least take Monday and half of Tuesday seriously. ;-)
    I'm reasonably familiar with it (WP 1.2 Stats), although I have a hunch that there are probably a few cool things I don't know about yet.

  8. prara
    Member
    Posted 11 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.