WordPress.org

Support

Support » How-To and Troubleshooting » question about my-hack.php

question about my-hack.php

  • I see that it says use legacy my-hacks.php. I’m guessing this may be phased out in some future release and/or it is not the best way to do things.

    I have some custom functions that I have in my-hacks.php that just do some simple things – most just return some code.

    What is the correct way to implement small little functions I write (i.e. to return some navigation code, where I just say get_navigation();) so that I don’t have to worry about updating in the future?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • whooami

    @whooami

    Member

    I still use a my-hacks.php; the other way to handle that file is to just code your own little plugin that makes all of those functions available to you.

    Both those ways avoid editing core files, and having to worry about things being ‘lost’ when you upgrade.

    yea, that is true, except that now I have to remember to save my-hacks.php file before replacing the file structure when upgrading.

    I guess the best way is to write a little plugin that calls all the functions.

    whooami

    @whooami

    Member

    yea, that is true, except that now I have to remember to save my-hacks.php file before replacing the file structure when upgrading.

    thats one of the purposes of backing up. Ive had the same my-hacks for nearly 4 years — add stuff, remove stuff, same file 🙂

    I’m kinda frustrated, and I just happened to land on this thread after searching for about ten minutes. I’m looking to (1) create a my-hacks.php file to upload and use, and (2) use this file to change the behavior of the allowed_tags() function to customize the XHTML markup that is allowed during comments submission. Can anyone suggest where I might find some instructions to accomplish this? Much thanks in advance.

    In WP 2.8 you can make a mu-plugins folder inside wp-content. Any PHP files placed therein are activated like plugins. (Technically speaking, they activate before plugins do….)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘question about my-hack.php’ is closed to new replies.
Skip to toolbar