summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury German <blueknight@gentoo.org>2016-02-12 22:22:00 -0500
committerYury German <blueknight@gentoo.org>2016-02-12 22:22:00 -0500
commit657cafe0e955cf88033597f131aa50835140c617 (patch)
treecf21a30d319cb2a238a6cfb8b4eb3b20b1b5dcff /plugins/jetpack/modules/widgets/rsslinks-widget.php
parentAdding New Mantra version 2.4.1.1 - Bug 574468 (diff)
downloadblogs-gentoo-657cafe0e955cf88033597f131aa50835140c617.tar.gz
blogs-gentoo-657cafe0e955cf88033597f131aa50835140c617.tar.bz2
blogs-gentoo-657cafe0e955cf88033597f131aa50835140c617.zip
Updating plugins easy-table, jetpack, openid, public-post preview, talbe-of-contents-plus, wordress-mobile-pack - Bug 574468
Diffstat (limited to 'plugins/jetpack/modules/widgets/rsslinks-widget.php')
-rw-r--r--plugins/jetpack/modules/widgets/rsslinks-widget.php52
1 files changed, 41 insertions, 11 deletions
diff --git a/plugins/jetpack/modules/widgets/rsslinks-widget.php b/plugins/jetpack/modules/widgets/rsslinks-widget.php
index 04545bc9..c1ed416e 100644
--- a/plugins/jetpack/modules/widgets/rsslinks-widget.php
+++ b/plugins/jetpack/modules/widgets/rsslinks-widget.php
@@ -8,9 +8,17 @@
class Jetpack_RSS_Links_Widget extends WP_Widget {
- function Jetpack_RSS_Links_Widget() {
- $widget_ops = array( 'classname' => 'widget_rss_links', 'description' => __( "Links to your blog's RSS feeds", 'jetpack' ) );
- $this->WP_Widget( 'rss_links', __( 'RSS Links (Jetpack)', 'jetpack' ), $widget_ops );
+ function __construct() {
+ $widget_ops = array(
+ 'classname' => 'widget_rss_links',
+ 'description' => __( "Links to your blog's RSS feeds", 'jetpack' )
+ );
+ parent::__construct(
+ 'rss_links',
+ /** This filter is documented in modules/widgets/facebook-likebox.php */
+ apply_filters( 'jetpack_widget_name', __( 'RSS Links', 'jetpack' ) ),
+ $widget_ops
+ );
}
function widget( $args, $instance ) {
@@ -18,6 +26,7 @@ class Jetpack_RSS_Links_Widget extends WP_Widget {
extract( $args );
+ /** This filter is documented in core/src/wp-includes/default-widgets.php */
$title = apply_filters( 'widget_title', $instance['title'] );
echo $before_widget;
@@ -157,19 +166,41 @@ class Jetpack_RSS_Links_Widget extends WP_Widget {
$link_item = '';
$format = $args['format'];
-
+
+ /**
+ * Filters the target link attribute for the RSS link in the RSS widget.
+ *
+ * @module widgets
+ *
+ * @since 3.4.0
+ *
+ * @param bool false Control whether the link should open in a new tab. Default to false.
+ */
if ( apply_filters( 'jetpack_rsslinks_widget_target_blank', false ) ) {
$link_target = '_blank';
} else {
$link_target = '_self';
}
-
- if ( 'image' == $format || 'text-image' == $format )
- $link_item = '<a target="' . $link_target . '" href="' . get_bloginfo( $rss_type ) . '" title="' . esc_attr( $subscribe_to ) . '"><img src="' . esc_url( plugins_url( 'images/rss/' . $args['imagecolor'] . '-' . $args['imagesize'] . '.png', dirname( dirname( __FILE__ ) ) ) ) . '" alt="RSS Feed" /></a>';
- if ( 'text-image' == $format )
+
+ if ( 'image' == $format || 'text-image' == $format ) {
+ /**
+ * Filters the image used as RSS icon in the RSS widget.
+ *
+ * @module widgets
+ *
+ * @since 3.6.0
+ *
+ * @param string $var URL of RSS Widget icon.
+ */
+ $link_image = apply_filters( 'jetpack_rss_widget_icon', plugins_url( 'images/rss/' . $args['imagecolor'] . '-' . $args['imagesize'] . '.png', dirname( dirname( __FILE__ ) ) ) );
+ $link_item = '<a target="' . $link_target . '" href="' . get_bloginfo( $rss_type ) . '" title="' . esc_attr( $subscribe_to ) . '"><img src="' . esc_url( $link_image ) . '" alt="RSS Feed" /></a>';
+ }
+ if ( 'text-image' == $format ) {
$link_item .= '&nbsp;<a target="' . $link_target . '" href="' . get_bloginfo( $rss_type ) . '" title="' . esc_attr( $subscribe_to ) . '">' . esc_html__( 'RSS - ' . $type_text, 'jetpack' ). '</a>';
- if ( 'text' == $format )
+ }
+ if ( 'text' == $format ) {
$link_item = '<a target="' . $link_target . '" href="' . get_bloginfo( $rss_type ) . '" title="' . esc_attr( $subscribe_to ) . '">' . esc_html__( 'RSS - ' . $type_text, 'jetpack' ). '</a>';
+ }
if ( 'text' == $format )
echo '<li>';
@@ -182,10 +213,9 @@ class Jetpack_RSS_Links_Widget extends WP_Widget {
echo '</p>';
}
-} //Class Jetpack_RSS_Links_Widget
+} // Class Jetpack_RSS_Links_Widget
function jetpack_rss_links_widget_init() {
register_widget( 'Jetpack_RSS_Links_Widget' );
}
add_action( 'widgets_init', 'jetpack_rss_links_widget_init' );
-?>