WordPress hooks

Hooks

It wouldn't be WordPress if it didn't have hooks, and Gust comes with plenty to make sure you have control over what's being output. We're still working on ensuring this list is exhaustive, so there may be a few extra filters lurking around the codebase. If you find one that's not on this list, or you've found somewhere that needs a new one, let us know and we'll take a look at getting it added.

Filters

FilterArgumentsDescription
gust_attachment_url$url, $attachment_idThe URL for an attachment retrieved from wp_get_attachment_url.
gust_content_class_names$class_namesThe class names used on the content container on single posts.
gust_content_functions$functionsAn array of function definitions to be displayed as options for the user. See dynamic data for more details.
gust_content_safelist$safelist, $nodesAn array of class names used on an individual page. The safelist is extracted from the list of nodes.
gust_enable_post_types$post_typesReturns a list of post types that the Gust page builder can be used on.
gust_fonts$fontsReturns a list of custom fonts to be used in the theme. Each element in the list should contain an ID and a URL.
gust_form_details$form_detailsA named array of form details. To, from, subject, message, etc
gust_function_content$value, $id, $contextReturns the content for a function selected by the user. See dynamic data for more details.
gust_include_wc_styles$includeDetermines whether or not we should include WooCommerce styles
gust_{$nodeId}_node_class_name_list$class_names, $componentA list of class names to be applied to an element when building the safelist. Not used in final output.
gust_node_class_name_list$class_names, $nodeA list of class names to be applied to an element when building the safelist. Not used in final output.
gust_option_class_names$class_names, $option, $option_value, $current_details, $nodeThe class names to add to the element based on its selected options. Used when building the safelist, not in the final output. See building components.
gust_regions$regionsA list of regions controlled by Gust. Currently only header and footer.
gust_region_content$region_content, $region_keyThe content for the Gust region.
gust_register_component$json, $componentNameThis is run before each component is registered. You can override an entire component's JSON with this filter. Great for overriding core components.
gust_render_component$component, $componentNameThis is called whenever Gust tries to render a component. It should return the component details. Again, you could override the implementation of a core component here, but on only when pages are being built. This does not effect the editor.
gust_repeater_items$repeater_items, $context, $tag, $component_detailsThe repeatable items used in a component that supports repeating. Note that this is not the same as looping through context. See building components for more details.
gust_safelist$safelistAn array of all class names used on the site.
gust_safelist_files$filesAn array of filesGust should scan for class names. These are absolute path names and include the results from gust_safelist_templates once they have been mapped over locate_template.
gust_safelist_templates$templatesAn array of file paths that Gust should scan for class names, relative to the theme directory. All files go through locate_template.
gust_search_form_params$form_paramsThe search parameters used for the built in search form.
gust_settings$settings, Gust_AdminAllows developers to add settings sections or settings.
gust_setting_input_types$setting_input_types, Gust_AdminReturns a map of setting types and their render function. Developers can add new ones for custom setting inputs, or update the existing ones.
gust_tag_attributes$attributes, $context, $tagThe attributes applied to a tag when rendering.
gust_tag_class_names$class_names, $context, $tagThe class names applied to a tag when rendering.
gust_tag_pre_output$output, $context, $tagThe tag output without the wrapping tag markup ( e.g. a div's content without the surrounding
).
gust_tag_post_output$output, $context, $tagThe final tag output.
gust_templates$templatesAn array of template categories and their definitions available for use in the page builder.
gust_theme_safelist$theme_safelistAn array of class names hard coded into the theme.
gust_{$tagId}_attributes$attributes, $context, $componentDetailsModify any attributes being output on a component node.
gust_{$tagId}_class_names$classNames, $context, $componentDetailsModify any classes being output onto a component node.
gust_{$tagId}_output$output, $context, $componentDetailsModify the full HTML of a component node.
gust_{$tagId}_tag_name$tagName, $context, $componentDetailsWhen a component node is being rendered the tag is run through this filter so you can change it if you need to.

Actions

ActionArgumentsDescription
gust_init$gustRuns after Gust has been initialised. This is useful for adding and removing hooks and filters that Gust has added.
gust_form_sent$form_detailsA named array of form details. To, from, subject, message, etc
gust_post_activateRuns after Gust has been activated.
gust_region$region_idDisplays the region. This is most commonly used for displaying the header and footer.
gust_register_components$gust_componentsAllows developers to register components. An instance of the Gust_Components class is passed in.

Subscribe

No spam, just product updates.