Support » Plugin: Simple Image Widget » Filter or another way to change the title of the widget in admin

  • Resolved suzt808

    (@suzt808)


    Hello
    I’d like to change the name “Image” that is shown in the admin widget area.
    This change is to make it more obvious for the client’s usecase.
    Is there a filter available to change that ? Or is there another recommended method that will allow for updates ?

    Thanks

    http://wordpress.org/plugins/simple-image-widget/

Viewing 1 replies (of 1 total)
  • Plugin Author Brady Vercher

    (@bradyvercher)

    Hi there. A filter doesn’t exist for changing the widget title, but you can easily create your own custom widget by extending this widget. Something like this might work (untested):

    <?php
    if ( class_exists( 'Simple_Image_Widget' ) ) {
    	function myprefix_widgets_init() {
    			// Register the widget.
    			register_widget( 'My_Image_Widget' );
    	}
    	add_action( 'widgets_init', 'myprefix_widgets_init' );
    
    	class My_Image_Widget extends Simple_Image_Widget {
    		function __construct() {
    			$widget_options = array( 'classname' => 'widget_my_image', 'description' => 'Not yours.' );
    			parent::__construct( 'my-image', 'My Image Widget', $widget_options );
    		}
    	}
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Filter or another way to change the title of the widget in admin’ is closed to new replies.