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

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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).

    Thread Starter prara

    (@prara)

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

    Thread Starter prara

    (@prara)

    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?

    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! 🙂

    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. 🙂

    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.

    Thread Starter prara

    (@prara)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Where to place my hacked code?’ is closed to new replies.