Logo
Tips And Tricks

Hooks and Filters

1. Hooks

1.1 - before_body_content

add_action('uicore_before_body_content', 'uicore_child_before_body_content_hook');
function uicore_child_before_body_content_hook() { 
    echo 'my super content';
}

1.2 - uicore_before_page_content

add_action('uicore_before_page_content', 'uicore_child__before_page_content__hook');
function uicore_child__before_page_content__hook() { 
    echo 'my super content';
}

1.3 - uicore_page

add_action('uicore_page', 'uicore_child__page__hook');
function uicore_child__page__hook() {
    echo 'my super content';
}

1.4 - uicore_before_content

add_action('uicore_before_content', 'uicore_child__before_content__hook');
function uicore_child__before_content__hook() {
    echo 'my super content';
}

1.5 - uicore_content_end

add_action('uicore_content_end', 'uicore_child__content_end__hook');
function uicore_child__content_end__hook() {
    echo 'my super content';
}

1.6 - uicore_body_end

add_action('uicore_body_end', 'uicore_child__body_end__hook');
function uicore_child__body_end__hook() {
    echo 'my super content';
}

1.7 - uicore_after_portfolio_single

add_action('uicore_after_portfolio_single', 'uicore_child__after_portfolio_single__hook');
function uicore_child__after_portfolio_single__hook() {
    echo 'my super content';
}

2. Filters

2.1 - uicore_logo_link

add_filter( 'uicore_logo_link', function(){
    return 'https://my-new-url';
});

2.2 - uicore-menu-cache (default value is true)

add_filter('uicore-menu-cache','__return_false');

2.3 - uicore-footer-cache (default value is true)

add_filter('uicore-footer-cache','__return_false');

2.4 - uicore-logo (default logo)

add_filter( 'uicore-logo', function(){
    return 'Site Title';
});

2.5 - uicore-mobile-menu-logo (logo displayed on mobile menu)

add_filter( 'uicore-mobile-menu-logo', function(){
    return 'Site Title';
});

2.6 - uicore-desktop-menu-logo (fullscreen hamburger menu)

add_filter( 'uicore-desktop-menu-logo', function(){
    return 'Site Title';
});

2.7 uicore_portfolio_slug

add_filter( 'uicore_portfolio_slug', function(){
    return 'work';
});

2.8 uicore_portfolio_category_slug

add_filter( 'uicore_portfolio_slug', function(){
    return 'work-category-slug';
});

2.9 uicore-socials-markup

add_filter( 'uicore-socials-markup', function($markup){
    //Do something with $makrup return $markup;
});

2.10 uicore_mobile_menu

add_filter( 'uicore_mobile_menu', function($menu){
    return 10; //menu id
});

2.11 uicore_cta_class

add_filter( 'uicore_cta_class', function(){
    return ' my-css-class';
});

2.12 uicore_cta_attributes

function uicore_cta_cutom_attr($attributes){
	return [
        'title' => 'Get Started',
        'data-test' => 'test',
        'onClick' => 'alert("Hello World")',
    ];
}
add_filter( 'uicore_cta_attributes', 'uicore_cta_cutom_attr' );

2.13 uicore-mobile-menu-content

add_filter( 'uicore-mobile-menu-content', function() {
    $elementor_instance = \Elementor\Plugin::instance();
    return $elementor_instance->frontend->get_builder_content_for_display( 1275, true );
});

2.14 uicore-default-blog-img-size

add_filter( 'uicore-default-blog-img-size', function(){
    return 'large';
});

2.15 uicore-show-home-in-breadcrumb

add_filter('uicore-show-home-in-breadcrumb', '__return_false');

2.16 uicore_portfolio_img_size

add_filter( 'uicore_portfolio_img_size', function(){
    return 'large';
});

2.17 uicore_versions_output

add_filter( 'uicore_versions_output', '__return_false' );

Last updated on 8/30/2023, 10:54:52 AM
Was this page useful?