• Resolved Alexandre Simard

    (@brocheafoin)


    Hello there!

    I use Storefront as a parent theme on many sites. Usually, my child theme includes a few remove_action calls to either remove some elements outright or move them around in the page order.

    Since 2.0, Storefront has been rewritten using classes instead of prefixed functions. Example: what used to be performed by the storefront_add_customizer_css function is now done in the add_customizer_css of the Storefront_Customizer class. Furthermore, the instance used when hooking into WordPress is anonymous. It seems that if I want to remove the action, I can no longer just call remove_action because I do not have a reference to the instance. Google gives me this kind of workaround, which I don’t really want to have to do.

    Is there any plan to make the Storefront classes behave like singletons and provide a class method to retrieve their unique instance?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey!

    There are no plans to do that right now.

    If you’re removing the inline CSS required by the Customizer, that renders the rest of the Customizer integration useless, no? Might as well remove it all.

    In that case, you can just redefine the Storefront_Customizer class to do what you need.

    It all depends on what you need to do.

    Cheers

    Thread Starter Alexandre Simard

    (@brocheafoin)

    Thanks for the answer. I guess I just prefer using hooks to pluggable functions/classes. Seems more future-proof to me. I’ll manage, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing actions and filters since 2.0’ is closed to new replies.