splorp / tersus

An achingly simple WordPress theme without all the usual cruft.
GNU General Public License v3.0
99 stars 6 forks source link

Parent theme should check if Tersus functions exist #57

Closed Avengio closed 10 years ago

Avengio commented 10 years ago

In order to be able to add or change Tersus functions from within the child theme, the parent theme should check to see if the function has been declared from the child theme.

http://stackoverflow.com/questions/19039492/override-a-function-with-child-themes-functions-php

-b

PS. [Waves]

splorp commented 10 years ago

Ooh, good one.

Also, hi!

splorp commented 10 years ago

Just updated the issue description a little bit.

One a related note, would it be useful to namespace all Tersus-specific functions with a tersus- prefix?

Avengio commented 10 years ago

I like the idea of a prefix. -b

cdharrison commented 10 years ago

Prefix would be good. Fairly common practice if I recall.

splorp commented 10 years ago

Good enough. We’re already prefixing our custom title, comment callback, and gallery functions … may as well do the whole works while we’re wrapping everything with stylish function_exists shiz.

splorp commented 10 years ago

Here’s some additional background on pluggable functions as they pertain to child themes.

http://wp.tutsplus.com/tutorials/creative-coding/understanding-wordpress-pluggable-functions-and-their-usage/

I’ll be implementing the wrappers shortly.

splorp commented 10 years ago

All theme functions have been properly namespaced per commit 2cc1d220ae5aeb7cbc73acd06ea36716f7e402df

splorp commented 10 years ago

With the exception of the link delimiter functions (which I want to combine into fewer, case-based functions), all custom tersus_* functions are now pluggable per the following commits:

efa7335d4e0b97882a4170019c39ee9f32d7c19e 70a74c54f4220a2f227b053cf06a8b39ff4a46fb 439dfe2702a16f944f729df7451c621d87105d67 1b5cfa0ae802af9384796d8d2d6ffaaa1bfa1ebd 31d905b072db47233b3d52d10c7e3b46fd5892cf 91df5a1c60e90355ebcf18ad812059ecb8f6f2df e77869a8b42d923be924f3105f1d7d1b3b0032cf 962802e3ba047ceaf929fd039efb9058de473237 9c00d5f56e94a6dbd542fe9f4370d72e8ab64560 d3b7175e815b03b6a4728b73e2a72b69500c7440

Let me know if you spot anything funky.