[wp-trac] [WordPress Trac] #52224: RSS Widget: allow removing the feed icon link

WordPress Trac noreply at wordpress.org
Sat Oct 2 23:02:43 UTC 2021


#52224: RSS Widget: allow removing the feed icon link
-------------------------------------------------+-------------------------
 Reporter:  sabernhardt                          |       Owner:
                                                 |  sabernhardt
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.9
Component:  Widgets                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing has-         |     Focuses:
  testing-info                                   |  accessibility
-------------------------------------------------+-------------------------
Changes (by sabernhardt):

 * keywords:  has-patch needs-testing => has-patch needs-testing has-
     testing-info


Comment:

 The patch for Twenty Twenty-One is separate, on ticket:52880 (if using the
 filter, the change here needs to be committed first). And to experience
 that bug, you need to navigate around the page with the Tab key and/or use
 a screen reader.

 To make sure that the proposed checkbox option and/or filter do not cause
 new problems, you could follow the steps below.

 == Testing this patch

 === Create a legacy RSS widget ''before'' applying patch

 1. Install and activate the Classic Widgets plugin.
 2. Go to Appearance > Widgets (or Customize > Widgets) and add at least
 one RSS widget, with any combination of settings, to the most prominent
 sidebar area.
 3. Visit the site (front end), view source code, and record the current
 markup for the widget title (h2 heading).

 === Apply the patch

 1. Apply the latest patch. Clear any browser cache ''or'' open a different
 browser to compare both side-by-side.
 2. Visit the site and verify there are no errors on the front end. If the
 theme showed the feed icon before, the entire widget should appear the
 same now.
 3. View source code and record the updated markup for the widget title (h2
 heading). It should have an `rss-widget-feed` class added to the first
 link and `rss-widget-title` on the second link. In some languages, the
 `alt` text could be something other than "RSS" now. If lazy loading is
 enabled, the `loading="lazy"` attribute should be included in the image
 markup.
 4. Also check the widget editor for error messages. (To see errors, you
 may need `WP_DEBUG` to be true in wp-config.php.)
 5. Verify that the existing RSS widget's settings include a new "Display
 feed icon?" option and that this option is checked by default.

 === Create another legacy widget

 1. Add a new RSS widget after applying the patch, still with Classic
 Widgets activated.
 2. Verify that the "Display feed icon?" option is available and checked by
 default.
 3. Visit the site to verify that the feed icon shows in this new widget.
 4. Uncheck either widget's feed icon checkbox and click Save.
 5. Verify that the feed link is removed on the front end. The text link
 should appear the same as it was before removing the icon.

 === Test user settings in ''block'' widget editor

 1. While the Classic Widgets plugin is still active, uncheck the "Display
 feed icon?" option in one widget (if you have not done so yet).
 2. Create a new widget also and leave the default option(s) checked.
 3. Deactivate the Classic Widgets plugin.
 4. Visit the site to verify there are no errors and that the feed icon
 shows in this new widget.
 5. Go back to Appearance > Widgets.
 6. Verify that the newly-added RSS widget's settings include a new
 "Display feed icon?" option and that this option is checked by default.
 The other widget, with that option previously unchecked, should still have
 it unchecked.
 7. Uncheck the new feed icon checkbox and verify that the feed link is
 removed on the front end. The text link should appear the same as it was
 before removing the icon.

 === Verify site appearance does not change when removing an icon link

 1. Activate the Twenty Seventeen theme.
 2. Go to Appearance > Widgets to make sure an RSS widget is in the desired
 sidebar area.
 3. View the site and refresh the browser (clearing cache).
 4. Verify that the widget title ''text'' link is exactly the same, both
 with and without the icon link displayed. ''Note:'' regardless of
 language, the icon link floats to the right when it shows. We could
 correct the RTL stylesheet to make it float left, but the patch does not.
 5. Activate the Twenty Twenty theme.
 6. Go to Appearance > Widgets to make sure an RSS widget is in the desired
 sidebar area.
 7. View the site and refresh the browser (clearing cache).
 8. Verify that the widget title text link displays, either with or without
 the icon link checkbox checked. Even when the checkbox is checked, the
 icon is hidden with CSS.
 9. Continue checking other themes, as desired.

 === Test the filter

 1. Activate Twenty Twenty-One theme.
 2. Apply [https://core.trac.wordpress.org/raw-
 attachment/ticket/52880/52880.filter.patch 52880.filter.patch]. (Do not
 revert the other patch.)
 3. Go to Appearance > Widgets to make sure an RSS widget is in the desired
 sidebar area.
 4. Verify that the "Display feed icon?" option is **not** available.
 5. Visit the site, and view source code to verify that the feed link is
 not included in the widget heading. The text link should have the `rss-
 widget-title` class.
 6. Activate another theme.
 7. Use the same filter in a custom plugin (or child theme): \\ {{{
 add_filter( 'rss_widget_feed_link', '__return_false' ); }}}
 8. Again, check that the widget is in the desired sidebar area, verify
 that the option is not available, and check that the icon link is removed
 from the source code.
 9. If you would like, try creating a custom filter to ''change'' the
 output instead of removing it entirely. I'll upload a child theme with two
 custom filter functions that I tested, but the main purpose of the
 `rss_widget_feed_link` filter is to remove the link.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52224#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list