Filter and Action Hooks - makeitworkpress/waterfall GitHub Wiki
Waterfall has many filters and action hooks which allow you to modify settings and templates.
Action Hooks
The Action Hooks are categorized below.
The shop template class
These action hooks are executed on the Woocommerce shopping catalog page.
Name | Passed parameters | Description |
---|---|---|
'woocommerce_archive_description' |
None | The description in the Woocommerce catalog page. |
'woocommerce_before_shop_loop' |
None | The hook executed before the loop of products in the Woocommerce catalog page. |
'woocommerce_shop_loop' |
None | The hook executed within the loop of products in the Woocommerce catalog page |
'woocommerce_after_shop_loop' |
None | The hook executed after the loop of products in the Woocommerce catalog page. |
'woocommerce_no_products_found' |
None | The hook executed when no products are found in the Woocommerce catalog page. |
The header template
These action hooks are executed on the main header template.
Name | Passed parameters | Description |
---|---|---|
'waterfall_before_header' |
None | Executed before the display of the navigation header |
'waterfall_after_header' |
None | Executed after the display of the navigation header |
'waterfall_main_content_begin' |
None | Executed just after the main html tag |
The footer template
These action hooks are executed on the main footer template.
Name | Passed parameters | Description |
---|---|---|
'waterfall_before_footer' |
None | Executed before the display of the main footer |
'waterfall_after_footer' |
None | Executed after the display of the main footer |
'waterfall_main_content_end' |
None | Executed just before the clsoing of main html tag |
The singular template
These action hooks are executed on the singular template, used to display pages and posts. The hooks are dynamically formed, using the post type object name indicated by {post-type}. For a post, this is for example 'waterfall_before_post_header'
.
Please note that these hooks are not executed if the Theme Builder from Elementor Pro is used to designing a singular page.
Name | Passed parameters | Description |
---|---|---|
'waterfall_before_{post-type}_header' |
None | Executed before the singular title header |
'waterfall_after_{post-type}_header' |
None | Executed after the search title header |
'waterfall_before_{post-type}_content_container' |
None | Displayed just before the content container begins |
'waterfall_before_{post-type}_content' |
None | Displayed before the content is displayed |
'waterfall_after_{post-type}_content' |
None | Displayed after the content is displayed |
'waterfall_after_{post-type}_sidebar' |
None | Displayed after the sidebar is displayed |
'waterfall_after_{post-type}_content_container' |
None | Displayed just after the content container ends |
'waterfall_after_{post-type}_main_content' |
None | Displayed just after the main content wrapper ends |
'waterfall_before_{post-type}_related' |
None | Displayed just before the related posts content is displayed |
'waterfall_after_{post-type}_related' |
None | Displayed just after the related posts content is displayed |
'waterfall_before_{post-type}_footer' |
None | Displayed just before the content footer is displayed |
'waterfall_after_{post-type}_footer' |
None | Displayed just after the content footer is displayed |
The index template
These action hooks are executed on the index template, used to display archives. Please note that these hooks are not executed if the Theme Builder from Elementor Pro is used to design archives.
Name | Passed parameters | Description |
---|---|---|
'waterfall_before_archive_header' |
None | Executed before the archive title header |
'waterfall_after_archive_header' |
None | Executed after the archive title header |
'waterfall_before_archive_content_container' |
None | Displayed just before the content container begins |
'waterfall_before_archive_posts' |
None | Displayed before the archive posts are displayed |
'waterfall_after_archive_posts' |
None | Displayed after the archive posts are displayed |
'waterfall_after_archive_sidebar' |
None | Displayed after the sidebar is displayed |
'waterfall_after_archive_content_container' |
None | Displayed just after the content container ends |
'waterfall_after_archive_main_content' |
None | Displayed just after the main content section |
The search template
These action hooks are executed on the search template, used to display search results pages. Please note that these hooks are not executed if the Theme Builder from Elementor Pro is used to design search pages.
Name | Passed parameters | Description |
---|---|---|
'waterfall_before_search_header' |
None | Executed before the search title header |
'waterfall_after_search_header' |
None | Executed after the search title header |
'waterfall_before_search_content_container' |
None | Displayed just before the content container begins |
'waterfall_before_search_posts' |
None | Displayed before the search posts are displayed |
'waterfall_after_search_posts' |
None | Displayed after the search posts are displayed |
'waterfall_after_search_sidebar' |
None | Displayed after the sidebar is displayed |
'waterfall_after_search_content_container' |
None | Displayed just after the content container ends |
'waterfall_after_search_main_content' |
None | Displayed just after the main content section |
The 404 template
These action hooks are executed on the 404-page template. Please note that these hooks are not executed if the Theme Builder from Elementor Pro is used to design search pages.
Name | Passed parameters | Description |
---|---|---|
'waterfall_before_404_header' |
None | Executed before the 404 title header |
'waterfall_after_404_header' |
None | Executed after the 404 title header |
The products archive template
These action hooks are executed on the products archive template, usually the Woocommerce Catalog page. Please note that these hooks are not executed if the Theme Builder from Elementor Pro is used to design shopping pages.
Name | Passed parameters | Description |
---|---|---|
'waterfall_before_product_archive_header' |
None | Executed before the product catalog title header |
'waterfall_after_product_archive_header' |
None | Executed after the product catalog title header |
'waterfall_before_product_archive_content_container' |
None | Displayed just before the content container begins |
'waterfall_before_product_archive_posts' |
None | Displayed before the products are displayed |
'waterfall_after_product_archive_posts' |
None | Displayed after the products are displayed |
'waterfall_after_product_archive_sidebar' |
None | Displayed after the sidebar is displayed |
'waterfall_after_product_archive_content_container' |
None | Displayed just after the content container ends |
The single products template
These action hooks are executed on the products archive template, usually a Woocommerce single product. Please note that these hooks are not executed if the Theme Builder from Elementor Pro is used to design product pages.
Name | Passed parameters | Description |
---|---|---|
'waterfall_before_product_breadcrumbs' |
None | Executed before the display of the breadcrumbs |
'waterfall_before_product_content_container' |
None | Displayed just before the content container begins |
'waterfall_before_product_content' |
None | Displayed before the product content is displayed |
'waterfall_after_product_content' |
None | Displayed after the product content is displayed |
'waterfall_after_product_sidebar' |
None | Displayed after the sidebar is displayed |
'waterfall_after_product_content_container' |
None | Displayed just after the content container ends |
Filter Hooks
Waterfall utilizes many filter hooks, which are categorized below per function.
General Filter Hooks
These are general filters.
Name | Passed parameters | Description |
---|---|---|
'waterfall_blog_schema_post_types' |
$types The array of post types |
The array with post type names that may receive BlogPosting microdata schemas. |
'waterfall_configurations' |
$templates The array of configurations |
The array with all configurations that are loaded for the Waterfall theme. |
'waterfall_execute_methods' |
$methods The array of methods |
The array with all configuration keys and corresponding classes that are responsible for implementing these respective configurations. |
'waterfall_language_path' |
$path The language path |
The current path to the languages files. |
'waterfall_exlude_post_types' |
$path The array of post types excluded from saving |
Waterfall saves the currently registered post types in the database, so they can be accessed before the 'init' hook is executed. These post types are used in dynamically created customizer fields. This filter allows to filter out some of these post types. |
'waterfall_templates' |
$templates The array of template names |
The names for the different WordPress templates that are relocated to the templates/ folder in the Waterfall theme. |
'waterfall_sidebar_class' |
$class The class name |
The CSS class name that is added to the body tag for determining the display of the sidebars. |
Basic Template Classes
These are filters used by the base class, which prepares data to be inserted into templates.
Name | Passed parameters | Description |
---|---|---|
'waterfall_meta_properties' |
$properties The meta properties, $class The view class which fills these properties. |
The post meta properties load in a template |
'waterfall_customizer_properties' |
$properties The general customizer properties, $class The view class which fills these properties. |
The general customizer properties load in a template |
'waterfall_layout_properties' |
$properties The layout customizer properties being load for the given template, $class The view class which fills these properties. |
The layout customizer properties load in a template |
'waterfall_woocommerce_properties' |
$properties The Woocommerce customizer properties, $class The view class which fills these properties. |
The Woocommerce customizer properties load in a template |
'waterfall_disabled_section' |
$disabled Boolean value if a section is disabled, $prefix The current section being disabled, $context A more specific context of the section for singular posts or pages which is disabled. |
If a certain section in a template is disabled |
The footer template class
These are filters used in the footer template class, which prepares variables to be inserted into the actual footer template.
Name | Passed parameters | Description |
---|---|---|
'waterfall_footer_properties' |
$properties The custom footer data properties |
The keys for the properties that are loaded for the site footer |
'waterfall_footer_args' |
$args The footer molecule arguments |
The arguments for the footer molecule, a component from WP Components |
'waterfall_footer_scroll_args' |
$args The footer molecule arguments |
The arguments for the footer scroll atom, a component from WP Components |
The header template class
Name | Passed parameters | Description |
---|---|---|
'waterfall_header_properties' |
$properties The custom header data properties |
The keys for the properties that are loaded for the site header |
'waterfall_header_args' |
$args The header molecule arguments |
The arguments for the header molecule, a component from WP Components |
The index template class
These are filters used in the index template class, which prepares variables to be inserted into the actual index template.
Name | Passed parameters | Description |
---|---|---|
'waterfall_index_properties' |
$properties The custom index properties |
The keys for the properties that are loaded for the content of archives |
'waterfall_archive_header_args' |
$args The archive title header molecule arguments |
The arguments for the archive post-header molecule, a component from WP Components |
'waterfall_archive_posts_args' |
$args The archive posts molecule arguments |
The arguments for the archive posts molecule, which is responsible for displaying the posts in an archive. This is a component from WP Components |
The nothing template class
These are filters used in the nothing template class, which prepares variables to be inserted into the actual 404 template.
Name | Passed parameters | Description |
---|---|---|
'waterfall_404_properties' |
$properties The custom 404 page properties |
The keys for the properties that are loaded for the 404 page |
'waterfall_404_header_args' |
$args The 404 page title header molecule arguments |
The arguments for the 404 post-header molecule, a component from WP Components |
The product template class
These are filters used in the product template class, which prepares variables to be inserted into the actual single product template.
Name | Passed parameters | Description |
---|---|---|
'waterfall_product_properties' |
$properties The single product page properties |
The keys for the properties that are loaded for the single product page |
'waterfall_single_product_breadcrumbs' |
$args The breadcrumb arguments |
The arguments for the breadcrumbs on a single procuct page. The breadcrumb is a component from WP Components |
The shop template class
These are filters used in the shop template class, which prepares variables to be inserted into the actual product catalog template.
Name | Passed parameters | Description |
---|---|---|
'waterfall_catalog_properties' |
$properties The catalog page properties |
The keys for the properties that are loaded for the woocommerce catalog page |
'woocommerce_show_page_title' |
$show Boolean value if the catalog title is shown |
The filter for displaying the title in the catalog or shop page |
'waterfall_product_archive_header_args' |
$args The catalog page title header molecule arguments |
The arguments for the catalog page post-header molecule, a component from WP Components |
The singular template class
These are filters used in the singular template class, which prepares variables to be inserted into the actual singular template.
Name | Passed parameters | Description |
---|---|---|
'waterfall_social_share_networks' |
$networks An array of social sharing networks |
The keys for the social sharing networks that may be shown in the sharing buttons |
'waterfall_singular_properties' |
$properties The singular template properties |
The keys for the properties that are loaded in a singular template |
'waterfall_singular_schema' |
$scheme The string for the microdata schema |
The microdata schema that is used for pages or posts, such as 'itemscope="itemscope" itemtype="http://schema.org/CreativeWork"' |
'waterfall_content_header_args' |
$args The singular template title header molecule arguments |
The arguments for the singular template post-header molecule, a component from WP Components |
'waterfall_content_content_args' |
$args The array of singular template content arguments |
The arguments for the content displayed in singular templates. This content is a component from WP Components |
'waterfall_content_sidebar_args' |
$args The array of singular template sidebar arguments |
The arguments for the sidebar displayed in singular templates. This sidebar is a component from WP Components |
'waterfall_related_args' |
$args The array of singular template related posts arguments |
The arguments for the related posts displayed in singular templates. The related posts is a component from WP Components |
'waterfall_related_paginate_args' |
$args The array of singular template pagination arguments |
The arguments for the post pagination displayed in singular templates. The post pagination is a component from WP Components |
'waterfall_content_footer_args' |
$args The array of singular template content footer arguments |
The arguments for the content footer displayed in singular templates. This is the footer of an actual post or page, usually displaying the comments and author information. The content footer is a component from WP Components |
Utility Filters
These are the filters used in utility functions.
Name | Passed parameters | Description |
---|---|---|
'waterfall_main_schema' |
$schema The micro scheme |
Returns the main micro scheme used in the theme, such as 'http://schema.org/WebPageElement' . |
'waterfall_image_sizes' |
$options The array of image sizes |
Returns the array of image sizes, for example, used in customizer fields. |
'waterfall_column_options' |
$options The array of columns |
Returns the array of columns, used in customizer fields. |
'waterfall_grid_gaps' |
$options The array of columns |
Returns the array of supported grid gaps, used in customizer fields. |
'waterfall_sidebar_options' |
$options The array of sidebar options |
Returns the array of sidebar options, used in customizer fields. |
'waterfall_container_options' |
$options The array of container options |
Returns the array of container width options, used in customizer fields. |
'waterfall_height_options' |
$options The array of height options |
Returns the array of section height options, used in customizer fields. |
'waterfall_align_options' |
$options The array of align options |
Returns the array of text alignment options, used in customizer fields. |
'waterfall_button_options' |
$options The array of button options |
Returns the array of button type options, used in customizer fields. |
'waterfall_background_options' |
$options The array of background options |
Returns the array of featured image options, used in the customizer. |
'waterfall_float_options' |
$options The array of float options |
Returns the array of element floating options, used in the customizer. |
'waterfall_grid_options' |
$options The array of grid options |
Returns the array of post display style options, used in the customizer. |
'waterfall_social_loaded_networks' |
$networks The array of social sharing networks |
Returns the array of social networks that are checked against social sharing networks registered in the customizer |
'waterfall_archive_post_type' |
$type The post type archive |
Returns the primary post type for a given archive |