Opened 3 years ago
Last modified 3 years ago
#60519 new defect (bug)
Link widget always displays rating
| Reported by: | xurxodiz | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Widgets | Version: | 6.4.3 |
| Severity: | minor | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)