[theme-reviewers] pluggable functions

Sayontan Sinha sayontan at gmail.com
Tue Oct 30 14:59:02 UTC 2012


It is not just for child themes that "function_exists" is useful. While it
is true that only one theme is active at any point of time, sometimes a
theme and a plugin have a common name (I have a plugin called Photonic,
which I discovered later shares its name with a commercial theme), and it
might so happen that their function names are shared. In such a situation
it is safe to use a check for the function definitions.

On Tue, Oct 30, 2012 at 9:53 AM, Bruce Wampler <weavertheme at gmail.com>wrote:

> I'd like to add a note to this discussion. Using 'function_exists' has
> been common practice for quite some time, and I always thought its main
> purpose was for child themes. Making a filter work is really much more
> difficult. Almost anyone with even a slight idea of how PHP works can copy
> the original function to a child's functions.php, make a few wording, or
> even simple logic changes, to the function, and make the child work how
> they want. While this kind of rote programming may not be best practice,
> I'm sure there are thousands of small child themes that use this practice.
>
> I think there are too many existing child themes dependent on
> 'function_exists' to ever disallow that, at least for existing themes.
>
> Bruce Wampler
>
> And besides,
>
>
>>>>> On Sat, Oct 27, 2012 at 2:46 PM, Philip M. Hofer (Frumph) <
>>>>> philip at frumph.net> wrote:
>>>>>
>>>>>>   Most functions being pluggable, i.e. function_exists (if that’s
>>>>>> what you’re referring to) is actually a good idea.
>>>>>>
>>>>>> This allows those functions to be re-written if necessary in the
>>>>>> functions.php of the child theme.
>>>>>>
>>>>>> I would consider this best practice.
>>>>>> e-reviewers<http://lists.wordpress.org/mailman/listinfo/theme-reviewers>
>>>>>>
>>>>>
>>
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>


-- 
Sayontan Sinha
http://mynethome.net | http://mynethome.net/blog
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20121030/b6dc656f/attachment.htm>


More information about the theme-reviewers mailing list