Make WordPress Core

Opened 2 months ago

Last modified 2 months ago

#60519 new defect (bug)

Link widget always displays rating

Reported by: xurxodiz's profile xurxodiz Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 6.4.3
Component: Widgets Keywords:
Focuses: Cc:

Description

Using the latest WP version, when you add links through the Link Manager and use a Widget to display them in e.g. a sidebar, the links always show the rating regardless of the widget setting "Show rating" being unchecked.

You can test it simply by creating a link, adding it to a link widget and placing it in a widget area.

I've traced the problem to a gap in logic in the 'update' function of /wp-includes/widgets/class-wp-widget-links.php

'rating' setting is not taken care of when updating the instance settings, so it is always set to 1 as default during $instance array update. It can be fixed by adding the following line after line 114:

$instance['rating']   = ! empty( $new_instance['rating'] ) ? (int) $new_instance['rating'] : 0;

Same as it is done in line 114 for 'limit' setting.

Thanks.

Change History (1)

#1 @poena
2 months ago

  • Keywords has-patch removed
Note: See TracTickets for help on using tickets.