• Hi,

    Since WordPress handles only before_widget, after_widget, before_title, and after_title widget args, i need to write a function that will check if the title of widget is empty and if yes to execute a code. I’ve tried with something like this :

    add_action('widgets_init', 'test');
    
    function test() {
    	add_filter('widget_title', empty($instance['title']) ? __('Archives') : $instance['title']);
    }

    Anyone has idea how to write a function that will work with all widgets, check if title is empty and if yes -> execute code ?

    Thanks!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Widget Title Check’ is closed to new replies.