[wp-hackers] best way for custom rewrites in a theme

William Satterwhite whsatterwhite at gmail.com
Sat Jan 26 21:35:18 UTC 2013


Agreed with Justin 100%. Whatever code you add to a functions.php file in a
theme for custom rewrites should exist as a plugin. It's as simple as
creating a new file, dropping in your code, and making sure the header in
your file follows the WordPress plugin standard. Then you can take
advantage of the registration_activation_hook with out trying to use some
alternate hook.

Not only that, but if you're adding custom rewrites/routing to your
website, wouldn't you want it to be theme independent? Maybe you want to
run a seasonal theme or create a new theme all together, so why create more
work/restrictions by building that part in to the theme's functions.php
file?

On Sat, Jan 26, 2013 at 4:31 PM, Justin Tadlock <justin at justintadlock.com>wrote:

> Why would a theme be touching rewrite rules?  Whatever it is, I'm guessing
> it's best to put that functionality in a plugin.
>
>
> On 1/26/2013 1:48 PM, chris wrote:
>
>> Usally I use register_activation_hook for flush, what hook is the best to
>> use for a theme?
>>
>>
>>
>> ______________________________**_________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.**com <wp-hackers at lists.automattic.com>
>> http://lists.automattic.com/**mailman/listinfo/wp-hackers<http://lists.automattic.com/mailman/listinfo/wp-hackers>
>>
>>
> ______________________________**_________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.**com <wp-hackers at lists.automattic.com>
> http://lists.automattic.com/**mailman/listinfo/wp-hackers<http://lists.automattic.com/mailman/listinfo/wp-hackers>
>



-- 
Hunter Satterwhite
http://linkedin.com/in/hsatterwhite
(252) 762-5177


More information about the wp-hackers mailing list