Filter name:
wecodeart/filter/header/bar/modules
Location: wecodeart/inc/core/class-header.php
This filter is used to add additional modules to header bar.
It takes an array as argument and contains a list will all header bar modules:
- Branding (Logo/Title/Headline)
- Menu (Primary Menu)
- Search Field
How to use:
Each array item must have an unique key. Each item must have a label
(string) and a callback
(function).
function add_to_header_modules( $args ) {
$args['button'] = [
'label' => __( 'My Button', 'domain' ),
'callback => 'function_name' // returns the module html
];
return $args;
}
add_filter( 'wecodeart/filter/header/bar/modules', 'add_to_header_modules' );