mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
_a(), _ea(), _xa(), attr() are now esc_attr__(), esc_attr_e(), esc_attr_x(), esc_attr() -- still short, but less cryptic. see #9650
git-svn-id: https://develop.svn.wordpress.org/trunk@11204 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -61,8 +61,8 @@ class WP_Widget_Pages extends WP_Widget {
|
||||
function form( $instance ) {
|
||||
//Defaults
|
||||
$instance = wp_parse_args( (array) $instance, array( 'sortby' => 'post_title', 'title' => '', 'exclude' => '') );
|
||||
$title = attr( $instance['title'] );
|
||||
$exclude = attr( $instance['exclude'] );
|
||||
$title = esc_attr( $instance['title'] );
|
||||
$exclude = esc_attr( $instance['exclude'] );
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
|
||||
<p>
|
||||
@@ -212,7 +212,7 @@ class WP_Widget_Archives extends WP_Widget {
|
||||
|
||||
if ( $d ) {
|
||||
?>
|
||||
<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attr(__('Select Month')); ?></option> <?php wp_get_archives("type=monthly&format=option&show_post_count=$c"); ?> </select>
|
||||
<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo esc_attr(__('Select Month')); ?></option> <?php wp_get_archives("type=monthly&format=option&show_post_count=$c"); ?> </select>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
@@ -241,7 +241,7 @@ class WP_Widget_Archives extends WP_Widget {
|
||||
$count = $instance['count'] ? 'checked="checked"' : '';
|
||||
$dropdown = $instance['dropdown'] ? 'checked="checked"' : '';
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attr($title); ?>" /></label></p>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('count'); ?>"><input class="checkbox" type="checkbox" <?php echo $count; ?> id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" /> <?php _e('Show post counts'); ?></label>
|
||||
<br />
|
||||
@@ -276,9 +276,9 @@ class WP_Widget_Meta extends WP_Widget {
|
||||
<ul>
|
||||
<?php wp_register(); ?>
|
||||
<li><?php wp_loginout(); ?></li>
|
||||
<li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php echo attr(__('Syndicate this site using RSS 2.0')); ?>"><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
|
||||
<li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php echo attr(__('The latest comments to all posts in RSS')); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
|
||||
<li><a href="http://wordpress.org/" title="<?php echo attr(__('Powered by WordPress, state-of-the-art semantic personal publishing platform.')); ?>">WordPress.org</a></li>
|
||||
<li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php echo esc_attr(__('Syndicate this site using RSS 2.0')); ?>"><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
|
||||
<li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php echo esc_attr(__('The latest comments to all posts in RSS')); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
|
||||
<li><a href="http://wordpress.org/" title="<?php echo esc_attr(__('Powered by WordPress, state-of-the-art semantic personal publishing platform.')); ?>">WordPress.org</a></li>
|
||||
<?php wp_meta(); ?>
|
||||
</ul>
|
||||
<?php
|
||||
@@ -296,7 +296,7 @@ class WP_Widget_Meta extends WP_Widget {
|
||||
$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
|
||||
$title = strip_tags($instance['title']);
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attr($title); ?>" /></label></p>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -338,7 +338,7 @@ class WP_Widget_Calendar extends WP_Widget {
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>">
|
||||
<?php _e('Title:'); ?>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attr($title); ?>" />
|
||||
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" />
|
||||
</label></p>
|
||||
<?php
|
||||
}
|
||||
@@ -386,7 +386,7 @@ class WP_Widget_Text extends WP_Widget {
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>">
|
||||
<?php _e('Title:'); ?>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attr($title); ?>" />
|
||||
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" />
|
||||
</label></p>
|
||||
|
||||
<textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>
|
||||
@@ -469,7 +469,7 @@ class WP_Widget_Categories extends WP_Widget {
|
||||
function form( $instance ) {
|
||||
//Defaults
|
||||
$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
|
||||
$title = attr( $instance['title'] );
|
||||
$title = esc_attr( $instance['title'] );
|
||||
$count = (bool) $instance['count'];
|
||||
$hierarchical = (bool) $instance['hierarchical'];
|
||||
$dropdown = (bool) $instance['dropdown'];
|
||||
@@ -572,7 +572,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$title = attr($instance['title']);
|
||||
$title = esc_attr($instance['title']);
|
||||
if ( !$number = (int) $instance['number'] )
|
||||
$number = 5;
|
||||
?>
|
||||
@@ -659,7 +659,7 @@ class WP_Widget_Recent_Comments extends WP_Widget {
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
$title = attr($instance['title']);
|
||||
$title = esc_attr($instance['title']);
|
||||
if ( !$number = (int) $instance['number'] )
|
||||
$number = 5;
|
||||
?>
|
||||
@@ -708,7 +708,7 @@ class WP_Widget_RSS extends WP_Widget {
|
||||
$link = '';
|
||||
|
||||
if ( ! is_wp_error($rss) ) {
|
||||
$desc = attr(strip_tags(@html_entity_decode($rss->get_description(), ENT_QUOTES, get_option('blog_charset'))));
|
||||
$desc = esc_attr(strip_tags(@html_entity_decode($rss->get_description(), ENT_QUOTES, get_option('blog_charset'))));
|
||||
if ( empty($title) )
|
||||
$title = htmlentities(strip_tags($rss->get_title()));
|
||||
$link = clean_url(strip_tags($rss->get_permalink()));
|
||||
@@ -723,7 +723,7 @@ class WP_Widget_RSS extends WP_Widget {
|
||||
$url = clean_url(strip_tags($url));
|
||||
$icon = includes_url('images/rss.png');
|
||||
if ( $title )
|
||||
$title = "<a class='rsswidget' href='$url' title='" . attr(__('Syndicate this content')) ."'><img style='background:orange;color:white;border:none;' width='14' height='14' src='$icon' alt='RSS' /></a> <a class='rsswidget' href='$link' title='$desc'>$title</a>";
|
||||
$title = "<a class='rsswidget' href='$url' title='" . esc_attr(__('Syndicate this content')) ."'><img style='background:orange;color:white;border:none;' width='14' height='14' src='$icon' alt='RSS' /></a> <a class='rsswidget' href='$link' title='$desc'>$title</a>";
|
||||
|
||||
echo $before_widget;
|
||||
if ( $title )
|
||||
@@ -795,11 +795,11 @@ function wp_widget_rss_output( $rss, $args = array() ) {
|
||||
while ( stristr($link, 'http') != $link )
|
||||
$link = substr($link, 1);
|
||||
$link = clean_url(strip_tags($link));
|
||||
$title = attr(strip_tags($item->get_title()));
|
||||
$title = esc_attr(strip_tags($item->get_title()));
|
||||
if ( empty($title) )
|
||||
$title = __('Untitled');
|
||||
|
||||
$desc = str_replace(array("\n", "\r"), ' ', attr(strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset')))));
|
||||
$desc = str_replace(array("\n", "\r"), ' ', esc_attr(strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset')))));
|
||||
$desc = wp_html_excerpt( $desc, 360 ) . ' […]';
|
||||
$desc = wp_specialchars( $desc );
|
||||
|
||||
@@ -858,8 +858,8 @@ function wp_widget_rss_form( $args, $inputs = null ) {
|
||||
extract( $args );
|
||||
extract( $inputs, EXTR_SKIP);
|
||||
|
||||
$number = attr( $number );
|
||||
$title = attr( $title );
|
||||
$number = esc_attr( $number );
|
||||
$title = esc_attr( $title );
|
||||
$url = clean_url( $url );
|
||||
$items = (int) $items;
|
||||
if ( $items < 1 || 20 < $items )
|
||||
@@ -995,7 +995,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
||||
?>
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>">
|
||||
<?php _e('Title:') ?>
|
||||
<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo attr( $instance['title'] ); ?>" />
|
||||
<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
|
||||
</label></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user