[wp-trac] [WordPress Trac] #32065: Hide entire RSS widget when no items to display
WordPress Trac
noreply at wordpress.org
Wed Aug 14 17:00:47 UTC 2019
#32065: Hide entire RSS widget when no items to display
-------------------------+---------------------
Reporter: MadtownLems | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Widgets | Version: 4.2
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+---------------------
Comment (by SergeyBiryukov):
Replying to [comment:2 donmhico]:
> In my patch,
[https://core.trac.wordpress.org/attachment/ticket/32065/32065.diff
32065.diff], I added a new checkbox control in the widget which can be
toggled to hide or display the RSS Widget for **non-admin users** if the
RSS feed url has no items to display. By default, this is **checked**.
Thanks for the patch! I don't think a new checkbox is necessary here, per
[https://wordpress.org/about/philosophy/ Decisions, not Options
philosophy].
Just checking `current_user_can( 'edit_theme_options' )` and returning
early if there are no items seems enough.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32065#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list