Opened 13 years ago
Closed 10 years ago
#22010 closed enhancement (fixed)
RSS Widget with hardcoded icon and style
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 2.8 |
Component: | Widgets | Keywords: | ui-feedback has-patch needs-refresh |
Focuses: | Cc: |
Description
Standard RSS Widget outputs hardcoded icon and oldschool inline style="border:0" e.g.
<img style="border:0" width="14" height="14" src="http://zdrojak.lamp.wikidi.net/wp-includes/images/rss.png" alt="RSS">
this makes it hard to style (even more that the parent anchor has the same css class as following title, so you can't even hide it without some css3 only magic (:first)
IMO this part of WP_INC/default-widgets.php row 766-777
$icon = includes_url('images/rss.png'); if ( $title ) $title = "<a class='rsswidget' href='$url' title='" . esc_attr__( 'Syndicate this content' ) ."'><img style='border:0' width='14' height='14' src='$icon' alt='RSS' /></a> <a class='rsswidget' href='$link' title='$desc'>$title</a>";
+ line 764
should be replaced by standard way e.g.
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'RSS' ) : $instance['title'], $instance, $this->id_base );
so when someone wants to output there an icon, he could simply with the widget_title filter
Attachments (1)
Change History (10)
#1
@
12 years ago
- Keywords needs-patch ui-feedback added
- Type changed from defect (bug) to enhancement
- Version set to 2.8
#4
@
10 years ago
As noted in comment:1, defaulting to no icon is not the right approach.
this makes it hard to style (even more that the parent anchor has the same css class as following title, so you can't even hide it without some css3 only magic (:first)
This works for me:
.widget-title .rsswidget > img { display: none; }
We could probably add a specific class for easier targeting. Otherwise, this seems like a wontfix.
This ticket was mentioned in Slack in #core by drew. View the logs.
10 years ago
#7
@
10 years ago
- Keywords needs-refresh added
- Milestone changed from 4.2 to Future Release
Hi @prateek312: Thanks for the patch. At this point and time, it looks like it needs to be refreshed because of other code changes in that file, and it should be generated from the WordPress root.
Too late for this in 4.2.
I don't think defaulting to no icon is the right approach (current widget users display will change) but I also agree about the inline styles. If we remove them it would require CSS which themes would have to support. Is there anyway the output can be the same but still allow it to be overridden with CSS and a CSS background image to replace the existing icon?