WordPress.org

Ready to get started?Download WordPress

Forums

Widget Title Check (2 posts)

  1. newkind
    Member
    Posted 4 years ago #

    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!

  2. arpowers
    Member
    Posted 4 years ago #

    Did you ever solve this problem?

    I'm having the same issue.

Topic Closed

This topic has been closed to new replies.

About this Topic