Are the hooks outlined in the projects page, namely:

hook_styles_containers()
hook_styles_styles()
hook_styles_containers_alter(&$style)
hook_styles_styles_alter(&$style)

still valid in Styles 2.x? I'm attempting to call the *_alter hooks in my module and I don't see any evidence that they are getting invoked.

Thanks,
cocoloco

CommentFileSizeAuthor
#3 updated-readme-1091272.patch1020 bytesoxyc

Comments

oxyc’s picture

Hey,

I think i found the root of the problem, however I'm not certain how to tackle it. Read my comment

cocoloco’s picture

Did some looking in the code and I found:

drupal_alter('styles_default_styles', $styles);

which allowed me to implement HOOK_styles_default_styles_alter() to accomplish what I needed.

Note: I also found the following other _alter hooks in the code, however haven't tested them:

HOOK_styles_default_containers_alter
HOOK_styles_default_presets_alter

It might help other people looking to line in with the Styles 2.x API to update the project page with updated hook names, since it seems the project page and README file are out of date.

-cocoloco

oxyc’s picture

Status: Active » Needs review
StatusFileSize
new1020 bytes
cocoloco’s picture

Thanks for posting this patch oxyc.

aaron’s picture

Status: Needs review » Fixed

got it, thanks @oxyc & @cocoloco!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.