Hooks inside widgets?

Home Forums Support Hooks inside widgets?

Home Forums Support Hooks inside widgets?

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #1998070
    Elvin
    Staff
    Customer Support

    It baffles me since this features is not because of a limitation with WordPress but because a non-existing GeneratePress hook.

    A theme can’t inject a hook to a pre-made widget block. Widget blocks are hard-coded by its developer so its rendered HTML structure is fixed.:) (the content is dynamic, taken from its text field but the structure is fixed)

    While some have filter hooks, it’s usually something minor like changing the widget heading/title or its class selector.

    Depending what you’re trying to do, I think it’s doing a template on Block Element and hooking it to a portable hook may be a good idea.

    Check the portable_hook shortcode snippet provided here –
    https://generatepress.com/forums/topic/hook-in-hook/#post-1636333

    A wise man once said:
    "Have you cleared your cache?"

    #1998081
    Johnny

    True. I should be specific again. I am referring to the GeneratePress theme. So to my understanding even with the GeneratePress theme AND the GeneratePress plugin there is no way to hook into the contents of a sidebar widget. Only above or below the entire sidebar (not within an individual widget).

    #1998088
    Elvin
    Staff
    Customer Support

    I am referring to the GeneratePress theme. So to my understanding even with the GeneratePress theme AND the GeneratePress plugin there is no way to hook into the contents of a sidebar widget.

    That’s correct. For reason I’ve stated on my previous reply. πŸ™‚

    Only above or below the entire sidebar (not within an individual widget).

    That’s correct as well. With the hooks I’ve mentioned here – https://generatepress.com/forums/topic/hooks-inside-widgets/#post-1998031

    As a workaround solution if you want to hook something in between widgets, you can add your own hook there w/ a shortcode, manually. πŸ˜€

    A wise man once said:
    "Have you cleared your cache?"

    #1998109
    Johnny

    Thank you for the replies. My original comment was simply to confirm that GeneratePress does NOT have the ability to hook into a widget (through the GP plugin or GP theme). Again thank you for the replies.

    #1998121
    Elvin
    Staff
    Customer Support

    No problem. Feel free to open a new topic if you need further help in relation to this. πŸ™‚

    A wise man once said:
    "Have you cleared your cache?"

Viewing 5 posts - 16 through 20 (of 20 total)
  • You must be logged in to reply to this topic.