Riode Hooks: Actions and Filters

Actions and Filters are provided by WordPress to allow your plugin to ‘hook into’ the rest of WordPress; the same concept is used by Riode to allow hooking into Riode specific functionality so that you can modify it in a child theme or even a plugin.

How To Use a Hook Or A Filter?

So, let’s assume you wanna show product tab accordion in particular single product page. At that time, you can show as accordion using our Riode filter.

Step 1: Copy the single product template file and modify the code in that file.

Step 2: Use a filter in a child theme’s single product/tabs.php.

Following is an example code.

add_filter( 'riode_single_product_data_tab_type', function() {
return 'accordion';
});

Actions are similar to the filters. By using an action, you don’t edit or overwrite the core code which is why, your code will rarely need to be changed.

Conversion For Child Themes

If you’d like to learn how to convert Child Themes, you should use actions and filters as much as possible. you can show many actions and filters on following code.

Actions List
1. Riode/inc/action_filter/action-filter.php
// Breadcrumb and blocks
add_action( 'riode_before_content', 'riode_func_add_block' );
add_action( 'riode_before_inner_content', 'riode_func_add_block' );
add_action( 'riode_after_inner_content', 'riode_func_add_block' );
add_action( 'riode_after_content', 'riode_func_add_block' );
// Page layout
add_action( 'riode_print_before_page_layout', 'riode_print_layout_before' );
add_action( 'riode_print_after_page_layout', 'riode_print_layout_after' );
2. Riode/inc/add-on/skeleton/skeleton.php
// Sidebar skeleton
add_action( 'riode_sidebar_content_start', array( $this, 'sidebar_content_start' ) );
add_action( 'riode_sidebar_content_end', array( $this, 'sidebar_content_end' ) );
// Posts (archive + single) skeleton
add_action( 'riode_post_loop_before_item', array( $this, 'post_loop_before_item' ) );
add_action( 'riode_post_loop_after_item', array( $this, 'post_loop_after_item' ) );
// Archive products & categories skeleton
add_action( 'riode_product_loop_before_item', array( $this, 'product_loop_before_item' ) );
add_action( 'riode_product_loop_after_item', array( $this, 'product_loop_after_item' ) );
add_action( 'riode_product_loop_before_cat', array( $this, 'product_loop_before_cat' ) );
add_action( 'riode_product_loop_after_cat', array( $this, 'product_loop_after_cat' ) );
// Single product skeleton
add_action( 'riode_before_product_gallery', array( $this, 'before_product_gallery' ), 20 );
add_action( 'riode_after_product_gallery', array( $this, 'after_product_gallery' ), 20 );
add_action( 'riode_before_product_summary', array( $this, 'before_product_summary' ), 20 );
add_action( 'riode_after_product_summary', array( $this, 'after_product_summary' ), 20 );
add_action( 'riode_wc_product_before_tabs', array( $this, 'before_product_tabs' ), 20 );
3. Riode/inc/functions/woocommerce/product-loop.php
// Product Loop Details
add_action( 'riode_shop_loop_item_categories', 'riode_shop_loop_item_categories' );
// Product Loop Hide Details (for classic type)
add_action( 'riode_product_loop_hide_details', 'riode_product_loop_action' );
4. Riode/inc/functions/woocommerce/product-single.php
// Single Product - Breadcrumb
add_action( 'riode_before_main_content', 'riode_single_product_top_breadcrumb' );
// Single Product - Flash Sale
add_action( 'riode_before_wc_gallery_figure', 'woocommerce_show_product_sale_flash' );
// Single Product - the other types except gallery and sticky-both types
add_action( 'riode_after_product_summary_wrap', 'riode_single_product_wrap_general_end', 20 );
// Single Product - sticky-both type
add_action( 'riode_before_product_summary', 'riode_wc_show_product_images_sticky_both', 5 );
// Single Product - sticky-info type
add_action( 'riode_after_product_summary_wrap', 'riode_single_product_wrap_sticky_info_end', 15 );
// Single Product Media
add_action( 'riode_woocommerce_product_images', 'riode_single_product_images' );
// Single Product Data Tab
add_action( 'riode_after_product_summary_wrap', 'riode_wc_output_product_data_tabs_inner' );
// Product Listed Attributes (in archive loop and single)
add_action( 'riode_wc_product_listed_attributes', 'riode_wc_product_listed_attributes_html' );
5. Riode/inc/functions/woocommerce/woocommerce.php
// Woocommerce Breadcrumb
add_action( 'riode_action_print_breadcrumb', 'woocommerce_breadcrumb' );
// Woocommerce Notice Skin
add_action( 'riode_wc_before_notice', 'riode_wc_notice_action', 10, 2 );
add_action( 'riode_wc_after_notice', 'riode_wc_notice_close', 10, 2 );
// Woocommerce Cart Page
add_action( 'riode_wc_after_cart_form', 'woocommerce_cross_sell_display' );
Filters List
1. Riode/comments.php
apply_filters( 'riode_comments_title', $title );
apply_filters( 'riode_filter_comment_form_args', array() );
2. Riode/header.php
apply_filters( 'riode_main_class', 'main' );
3. Riode/inc/general_function.php
apply_filters( 'riode_get_template_part', $template, $slug, $name );
apply_filters( 'riode_filter_reponsive_cols', $result, $cols );
apply_filters( 'riode_get_col_class', $class );
apply_filters( 'riode_filter_trim_description', '<p>' . mb_substr( $content, 0, $limit ) . $affix . '</p>' );
apply_filters( 'riode_core_filter_doing_ajax', false );
apply_filters( 'riode_blog_cat_ptb_title', 'Our Blog' );
apply_filters( 'riode_blog_tag_ptb_title', 'Our Blog' );
apply_filters( 'riode_404_ptb_title', 'Error 404' );
apply_filters( 'riode_is_shop', false );
apply_filters( 'riode_is_product', false );
apply_filters( 'riode_page_wrapper_attrs', $atts );
4. Riode/inc/action_filter/calls.php
apply_filters( 'riode_main_content_class', 'main-content' );
5. Riode/inc/add-on/live-search/live-search.php
apply_filters( 'riode_live_search_query', sanitize_text_field( $_REQUEST['query'] ) );
apply_filters( 'riode_live_search_post_type', $post_type );
apply_filters( 'riode_live_search_products_query', sanitize_text_field( $_REQUEST['query'] ) );
apply_filters( 'riode_live_search_products_by_sku_query', sanitize_text_field( $_REQUEST['query'] ) );
apply_filters( 'riode_live_search_products_by_tag_query', sanitize_text_field( $_REQUEST['query'] ) );
apply_filters( 'riode_live_search_function', 'get_posts', $search_query, $args );
6. Riode/inc/add-on/product-custom-tab/product-custom-tab-admin.php
apply_filters( 'riode_product_custom_tab_content_editor_settings', $settings );
7. Riode/inc/add-on/sales-popup/sales-popup.php
apply_filters( 'riode_sales_popup_nobuy_time', esc_html__( 'A While Ago', 'riode' ) );
8. Riode/inc/admin/customizer/option/header/header-builder.php
apply_filters( 'riode_header_elements', $header_elements );
9. Riode/inc/functions/woocommerce/product-loop.php
apply_filters( 'riode_product_hover_image_html', $attachment_image ); 
apply_filters( 'riode_is_single_product_widget', false );
apply_filters( 'riode_check_product_variation_type', true, $attribute_name );
10. Riode/inc/functions/woocommerce/product-single.php
apply_filters( 'riode_doing_quickview', true );
apply_filters( 'riode_single_product_layout', $layout );
apply_filters( 'riode_wc_thumbnail_image_size', 'woocommerce_thumbnail' );
apply_filters( 'riode_wc_get_gallery_image_html', $image );
apply_filters( 'riode_single_product_nav_prev_icon', 'd-icon-arrow-left' );
apply_filters( 'riode_single_product_nav_next_icon', 'd-icon-arrow-right' );
apply_filters( 'riode_single_product_navigation', $html );
apply_filters( 'riode_filter_single_prev_next_product', $args );
apply_filters( 'riode_single_product_wrap_class', $wrap_class );
apply_filters( 'riode_single_product_sticky_cart_enabled', riode_get_option( 'single_product_cart_sticky' );
apply_filters( 'riode_single_product_gallery_type_class', ' row cols-1 cols-md-2 cols-lg-3' );
apply_filters( 'riode_single_product_divider', '<hr class="product-divider">' );
apply_filters( 'riode_is_single_product_widget', false );
apply_filters( 'riode_single_product_tab_inside', riode_get_option( 'single_product_tab_inside' );
11. Riode/inc/functions/woocommerce/woocommerce.php
apply_filters( 'riode_breadcrumb_args', $args );
12. Riode/inc/walker/walker-nav-menu.php
apply_filters( 'riode_menu_lazyload_content', $content );
13. Riode/template_parts/sidebar.php
apply_filters( 'riode_sidebar_classes', $sidebar_cls );
14. Riode/teplate_parts/header/elements/element-currency-switcher.php
Riode/teplate_parts/header/elements/element-language-switcher.php
apply_filters( 'riode_wcml_multi_currency_format', '%symbol% %code%' );
apply_filters( 'riode_icl_show_native_name', true, $l );
15. Riode/template_parts/posts/archive.php
apply_filters( 'riode_post_loop_wrapper_classes', $wrap_classes );
16. Riode/template_parts/posts/post.php
apply_filters( 'riode_archive_post_show_items', array() );
apply_filters( 'riode_related_post_show_items', array() );
apply_filters( 'riode_classic_post_show_items', array() );
apply_filters( 'riode_list_type_post_show_items', array() );
apply_filters( 'riode_mask_type_post_show_items', array() );
apply_filters( 'riode_post_loop_classes', $classes );
17. Riode/template_parts/posts/single.php
apply_filters( 'riode_post_single_class', array( 'post-single' ) );
18. Riode/template_parts/posts/elements/post-author.php
apply_filters( 'riode_filter_author_title', esc_html( 'AUTHOR', 'riode' ) );
19. Riode/template_parts/posts/elements/post-related.php
apply_filters( 'riode_filter_related_posts_args', $args );
20. Riode/woocommerce/content-single-product.php
apply_filters( 'riode_is_single_product_widget', false );
apply_filters( 'riode_single_product_classes', $classes );
apply_filters( 'riode_single_product_summary_class', 'summary entry-summary' );
21. Riode/woocommerce/loop/loop-start.php
apply_filters( 'riode_wc_product_count_row', riode_get_option( 'product_count_row' ) );
apply_filters( 'riode_wc_loadmore_type', wc_get_loop_prop( 'loadmore_type' ) );
apply_filters( 'riode_product_loop_wrapper_classes', $wrapper_class );
22. Riode/woocommerce/loop/rating.php
apply_filters( 'riode_single_product_rating_show_number', false );
apply_filters( 'riode_single_product_show_review', false );
23. Riode/woocommerce/loop/sale-flash.php
apply_filters( 'riode_product_label_group_class', '' );
24. Riode/woocommerce/notices/error.php
apply_filters( 'riode_wc_notice_class', '', $notice, 'error' );
25. Riode/woocommerce/single-product/product-image.php
apply_filters( 'riode_single_product_gallery_main_classes', array( 'woocommerce-product-gallery__wrapper' ) );
26. Riode/woocommerce/single-product/title.php
apply_filters( 'riode_single_product_title_tag', 'h1' );
apply_filters( 'riode_is_single_product_widget', false );
27. Riode/woocommerce/single-product/tabs/custom_tab.php
apply_filters( 'riode_product_tab_title', ( $tab_title ) );
28. Riode/woocomerce/single-product/tabs/tabs.php
apply_filters( 'riode_single_product_data_tab_type', 'tab' );
apply_filters( 'riode_single_product_data_tab_class', $wrapper_class );

Demos