Posts in Sidebar 4.7.1 bugfix release

Today I released a new version of Posts in Sidebar that fixes a couple of bugs. Many thanks to @mlang38 for reporting it on GitHub:

Hello,
in the commit 1c4dfef, the widget title has been wrapped with esc_html().
But I think (and I do it myself) that the widget_title filter is often used by themes for CSS styling purposes by wrapping the title with some targetable markup. If the HTML of the title is escaped, this usage is therefore broken. I think this behavior should be reverted.


By the way, the widget_title filter is called with the instance title only, but this filter accepts more arguments to better target the widgets to be customized.


Anyway, thank you for this very useful plugin

mlang38

He was right. The escaping bug was introduced when I made a huge checkup of all the files with PHPCS. Now, this specific bug is resolved, but others could currently exist. If you see something strange, please let me know by opening an issue on GitHub.

Regarding the second issue (“the widget_title filter is called with the instance title only”), this has been fixed too. Now you can customize the widget titles of this plugin in your themes/plugins. An example is the following:

function pis_change_widget_title( $title, $instance = array(), $id_base = '' ) {
	if ( 'pis_posts_in_sidebar' === $id_base ) {
		$title = 'Widget: ' . $title;
	}
	return $title;
}
add_filter( 'widget_title', 'pis_change_widget_title', 10, 3 );

This simple code will prepend the “Widget: ” string to all Posts in Sidebar widget titles. Obviously, this is only an example, since the filter lets you make more serious changes, like adding HTML markup to titles.

The last fixed bug is related to the plugin list page. Before this release, the plugin added a link to all plugins (except itself) for reviewing Posts in Sidebar! Sorry about this! :-)

Posts in Sidebar 4.7.0 released

After more than 80 commits, many hours of work and a lot of love, Posts in Sidebar 4.7.0 has landed in the WordPress repository! I hope you find useful the new additions and the rest of what has been done. Let’s see what’s new dissecting the changelog.

Continue reading “Posts in Sidebar 4.7.0 released”

Posts in Sidebar 4.5.1 bugfix release

Last Monday a bugfix version of Posts in Sidebar has been released. This release fixes the incorrect truncation of titles and WordPress-generated excerpts when UTF-8 character set is in use and the user truncates titles and/or excerpts using characters as measure unit.

For example, if you use Russian and you truncate titles or excerpts up to n characters, the last character could be a rhombus with a question mark in it.

Updating to 4.5.1 solves this issue.