Well I just asking myself this, there are two ways I could implement this. What would be a better fit to coding standards? Or is this just a a matter of personal like?
And what about php and memory, assuming this would be way more complicated and executed very often. Would it cost more memory to create a function or a variable?
Solution 1:
function stuff(){
[...]
$fluid = ( current_theme_supports('greatness') ) ? '-greatness' : '';
$output = '<div class="box' . $fluid . '">';
[...]
}
Solution 2:
function stuff_alternative(){
[...]
$output = '<div class="box' . bootgen_is_great() . '">';
[...]
}
function bootgen_is_great(){
if ( current_theme_supports( 'greatness' ) )
return '-greatness';
}
