Escape outputs

This commit is contained in:
Brian Miyaji
2021-11-13 20:42:08 +09:00
parent 051d3e3055
commit 23ba2446b1
190 changed files with 2837 additions and 2837 deletions

View File

@@ -4,9 +4,9 @@ class SP_Widget_Team_Gallery extends WP_Widget {
function __construct() {
$widget_ops = array(
'classname' => 'widget_sportspress widget_team_gallery widget_sp_team_gallery',
'description' => __( 'Display a gallery of teams.', 'sportspress' ),
'description' => esc_attr__( 'Display a gallery of teams.', 'sportspress' ),
);
parent::__construct( 'sportspress-team-gallery', __( 'Team Gallery', 'sportspress' ), $widget_ops );
parent::__construct( 'sportspress-team-gallery', esc_attr__( 'Team Gallery', 'sportspress' ), $widget_ops );
}
function widget( $args, $instance ) {
@@ -33,10 +33,10 @@ class SP_Widget_Team_Gallery extends WP_Widget {
$show_all_teams_link = empty( $instance['show_all_teams_link'] ) ? false : $instance['show_all_teams_link'];
do_action( 'sportspress_before_widget', $args, $instance, 'team-gallery' );
echo $before_widget;
echo wp_kses_post( $before_widget );
if ( $title ) {
echo $before_title . $title . $after_title;
echo wp_kses_post( $before_title . $title . $after_title );
}
// Action to hook into
@@ -58,7 +58,7 @@ class SP_Widget_Team_Gallery extends WP_Widget {
// Action to hook into
do_action( 'sportspress_after_widget_template', $args, $instance, 'team-gallery' );
echo $after_widget;
echo wp_kses_post( $after_widget );
do_action( 'sportspress_after_widget', $args, $instance, 'team-gallery' );
}
@@ -102,13 +102,13 @@ class SP_Widget_Team_Gallery extends WP_Widget {
// Action to hook into
do_action( 'sportspress_before_widget_template_form', $this, $instance, 'team-gallery' );
?>
<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
<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 ); ?>" /></p>
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_attr_e( 'Title:', 'sportspress' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
<p><label for="<?php echo $this->get_field_id( 'caption' ); ?>"><?php _e( 'Heading:', 'sportspress' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'caption' ); ?>" name="<?php echo $this->get_field_name( 'caption' ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
<p><label for="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>"><?php esc_attr_e( 'Heading:', 'sportspress' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'caption' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'caption' ) ); ?>" type="text" value="<?php echo esc_attr( $caption ); ?>" /></p>
<p><label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'League Table', 'sportspress' ) ); ?></label>
<p><label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php printf( esc_attr__( 'Select %s:', 'sportspress' ), esc_attr__( 'League Table', 'sportspress' ) ); ?></label>
<?php
$args = array(
'post_type' => 'sp_table',
@@ -119,26 +119,26 @@ class SP_Widget_Team_Gallery extends WP_Widget {
'class' => 'widefat',
);
if ( ! sp_dropdown_pages( $args ) ) :
sp_post_adder( 'sp_table', __( 'Add New', 'sportspress' ) );
sp_post_adder( 'sp_table', esc_attr__( 'Add New', 'sportspress' ) );
endif;
?>
</p>
<p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of teams to show:', 'sportspress' ); ?></label>
<input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
<p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php esc_attr_e( 'Number of teams to show:', 'sportspress' ); ?></label>
<input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3"></p>
<p><label for="<?php echo $this->get_field_id( 'columns' ); ?>"><?php _e( 'Columns:', 'sportspress' ); ?></label>
<input id="<?php echo $this->get_field_id( 'columns' ); ?>" name="<?php echo $this->get_field_name( 'columns' ); ?>" type="text" value="<?php echo esc_attr( $columns ); ?>" size="3"></p>
<p><label for="<?php echo esc_attr( $this->get_field_id( 'columns' ) ); ?>"><?php esc_attr_e( 'Columns:', 'sportspress' ); ?></label>
<input id="<?php echo esc_attr( $this->get_field_id( 'columns' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'columns' ) ); ?>" type="text" value="<?php echo esc_attr( $columns ); ?>" size="3"></p>
<p><label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Sort by:', 'sportspress' ); ?></label>
<select id="<?php echo $this->get_field_id( 'orderby' ); ?>" name="<?php echo $this->get_field_name( 'orderby' ); ?>">
<option value="default" <?php selected( 'default', $orderby ); ?>><?php _e( 'Rank', 'sportspress' ); ?></option>
<option value="name" <?php selected( 'name', $orderby ); ?>><?php _e( 'Alphabetical', 'sportspress' ); ?></option>
<option value="rand" <?php selected( 'rand', $orderby ); ?>><?php _e( 'Random', 'sportspress' ); ?></option>
<p><label for="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>"><?php esc_attr_e( 'Sort by:', 'sportspress' ); ?></label>
<select id="<?php echo esc_attr( $this->get_field_id( 'orderby' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'orderby' ) ); ?>">
<option value="default" <?php selected( 'default', $orderby ); ?>><?php esc_attr_e( 'Rank', 'sportspress' ); ?></option>
<option value="name" <?php selected( 'name', $orderby ); ?>><?php esc_attr_e( 'Alphabetical', 'sportspress' ); ?></option>
<option value="rand" <?php selected( 'rand', $orderby ); ?>><?php esc_attr_e( 'Random', 'sportspress' ); ?></option>
</select></p>
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id( 'show_all_teams_link' ); ?>" name="<?php echo $this->get_field_name( 'show_all_teams_link' ); ?>" value="1" <?php checked( $show_all_teams_link, 1 ); ?>>
<label for="<?php echo $this->get_field_id( 'show_all_teams_link' ); ?>"><?php _e( 'Display link to view all teams', 'sportspress' ); ?></label></p>
<p><input class="checkbox" type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_all_teams_link' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_all_teams_link' ) ); ?>" value="1" <?php checked( $show_all_teams_link, 1 ); ?>>
<label for="<?php echo esc_attr( $this->get_field_id( 'show_all_teams_link' ) ); ?>"><?php esc_attr_e( 'Display link to view all teams', 'sportspress' ); ?></label></p>
<?php
// Action to hook into