WordPress.org

Ready to get started?Download WordPress

Forums

question about my-hack.php (6 posts)

  1. maestro42
    Member
    Posted 6 years ago #

    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!

  2. whooami
    Member
    Posted 6 years ago #

    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.

  3. maestro42
    Member
    Posted 6 years ago #

    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.

  4. whooami
    Member
    Posted 6 years ago #

    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 :)

  5. spc0000
    Member
    Posted 6 years ago #

    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.

  6. Stephen Rider
    Member
    Posted 5 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.