Created
December 12, 2012 15:56
-
-
Save GoZOo/4268937 to your computer and use it in GitHub Desktop.
Add class and attributes from custom blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Add class and attributes from custom blocks | |
*/ | |
function phptemplate_preprocess_block(&$vars) { | |
if(isset($vars['block']->attributes)) { | |
if(isset($vars['block']->attributes['class'])) { | |
$vars['classes_array'] = array_merge($vars['classes_array'], $vars['block']->attributes['class']); | |
unset($vars['block']->attributes['class']); | |
} | |
if(!empty($vars['block']->attributes)) { | |
$vars['attributes_array'] = array_merge($vars['attributes_array'], $vars['block']->attributes); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment