2 mgsolipa May 08, 2017 00:58

This is all unclear to me.
@achillis Can you post a screenshot of what you see and annotate it with what you would like to see?
We'll see what we can do. We are working on big changes regarding the widget management...
@See /inc/widgets/_widget.class.php //line 189
/**
* Get a clean description to display in the widget list.
* @return string
*/
function get_desc_for_list()
{
$name = $this->get_name();
if( $this->type == 'plugin' )
{
return '<strong>'.$name.'</strong> ('.T_('Plugin').')';
}
$short_desc = $this->get_short_desc();
if( $name == $short_desc || empty($short_desc) )
{
return '<strong>'.$name.'</strong>';
}
return '<strong>'.$short_desc.'</strong> ('.$name.')';
}
@achillis so, it would be something like this:
/inc/widgets/_widget.class.php //line 193
function get_desc_for_list()
{
$name = $this->get_name();
if( $this->type == 'plugin' )
{
if ( isset($this->disp_params['title']) && ! empty($this->disp_params['title']) ) {
return '<strong>'.$this->disp_params['title'].'</strong> ('.$name. ' - ' .T_('Plugin').')';
}
return '<strong>'.$name.'</strong> ('.T_('Plugin').')';
}
$short_desc = $this->get_short_desc();
if( $name == $short_desc || empty($short_desc) )
{
return '<strong>'.$name.'</strong>';
}
return '<strong>'.$short_desc.'</strong> ('.$name.')';
}
It would look like as in the screenshot below.
@mgsolipa that is just perfect! Thanks!
@achillis it will be included in the beta branch indeed, I'm still not sure if it will be released in version 6.9.2 or later.
@achillis it's a bit difficult to make both, core and plugin widgets, behave exactly the same because they extend from different classes.
Maybe we can make plugin widgets to display something like: Short description (Plugin's name - [Plugin]), instead of: Plugin's name (Plugin), as it's done right now. So, short_desc is defined in the code of the plugin.
However, making plugin widgets to dynamically display the Block title value in the list is more complicated, I guess.