Escapes based on phpcs #10

This commit is contained in:
Savvas Hadjigeorgiou
2021-11-12 08:32:21 +02:00
parent bec7a43b42
commit c2ec328798
3 changed files with 39 additions and 39 deletions

View File

@@ -76,7 +76,7 @@ class SP_Admin_Taxonomies {
<?php if ( function_exists( 'get_term_meta' ) ) { ?>
<?php $order = get_term_meta( $t_id, 'sp_order', true ); ?>
<tr class="form-field">
<th scope="row" valign="top"><label for="sp_order"><?php _e( 'Order', 'sportspress' ); ?></label></th>
<th scope="row" valign="top"><label for="sp_order"><?php esc_html_e( 'Order', 'sportspress' ); ?></label></th>
<td><input name="sp_order" class="sp-number-input" type="text" step="1" size="4" id="sp_order" value="<?php echo (int) $order; ?>"></td>
</tr>
<?php } ?>
@@ -115,18 +115,18 @@ class SP_Admin_Taxonomies {
?>
<div class="form-field">
<div id="sp-location-picker" class="sp-location-picker" style="width: 95%; height: 320px"></div>
<p><?php _e( "Drag the marker to the venue's location.", 'sportspress' ); ?></p>
<p><?php esc_html_e( "Drag the marker to the venue's location.", 'sportspress' ); ?></p>
</div>
<div class="form-field">
<label for="term_meta[sp_address]"><?php _e( 'Address', 'sportspress' ); ?></label>
<label for="term_meta[sp_address]"><?php esc_html_e( 'Address', 'sportspress' ); ?></label>
<input type="text" class="sp-address" name="term_meta[sp_address]" id="term_meta[sp_address]" value="<?php echo esc_attr( $address ); ?>">
</div>
<div class="form-field">
<label for="term_meta[sp_latitude]"><?php _e( 'Latitude', 'sportspress' ); ?></label>
<label for="term_meta[sp_latitude]"><?php esc_html_e( 'Latitude', 'sportspress' ); ?></label>
<input type="text" class="sp-latitude" name="term_meta[sp_latitude]" id="term_meta[sp_latitude]" value="<?php echo esc_attr( $latitude ); ?>">
</div>
<div class="form-field">
<label for="term_meta[sp_longitude]"><?php _e( 'Longitude', 'sportspress' ); ?></label>
<label for="term_meta[sp_longitude]"><?php esc_html_e( 'Longitude', 'sportspress' ); ?></label>
<input type="text" class="sp-longitude" name="term_meta[sp_longitude]" id="term_meta[sp_longitude]" value="<?php echo esc_attr( $longitude ); ?>">
</div>
<?php
@@ -149,23 +149,23 @@ class SP_Admin_Taxonomies {
<tr class="form-field">
<td colspan="2">
<p><div id="sp-location-picker" class="sp-location-picker" style="width: 95%; height: 320px"></div></p>
<p class="description"><?php _e( "Drag the marker to the venue's location.", 'sportspress' ); ?></p>
<p class="description"><?php esc_html_e( "Drag the marker to the venue's location.", 'sportspress' ); ?></p>
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="term_meta[sp_address]"><?php _e( 'Address', 'sportspress' ); ?></label></th>
<th scope="row" valign="top"><label for="term_meta[sp_address]"><?php esc_html_e( 'Address', 'sportspress' ); ?></label></th>
<td>
<input type="text" class="sp-address" name="term_meta[sp_address]" id="term_meta[sp_address]" value="<?php echo esc_attr( $address ); ?>">
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="term_meta[sp_latitude]"><?php _e( 'Latitude', 'sportspress' ); ?></label></th>
<th scope="row" valign="top"><label for="term_meta[sp_latitude]"><?php esc_html_e( 'Latitude', 'sportspress' ); ?></label></th>
<td>
<input type="text" class="sp-latitude" name="term_meta[sp_latitude]" id="term_meta[sp_latitude]" value="<?php echo esc_attr( $latitude ); ?>">
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="term_meta[sp_longitude]"><?php _e( 'Longitude', 'sportspress' ); ?></label></th>
<th scope="row" valign="top"><label for="term_meta[sp_longitude]"><?php esc_html_e( 'Longitude', 'sportspress' ); ?></label></th>
<td>
<input type="text" class="sp-longitude" name="term_meta[sp_longitude]" id="term_meta[sp_longitude]" value="<?php echo esc_attr( $longitude ); ?>">
</td>
@@ -183,7 +183,7 @@ class SP_Admin_Taxonomies {
public function add_position_fields() {
?>
<div class="form-field">
<label><?php _e( 'Statistics', 'sportspress' ); ?></label>
<label><?php esc_html_e( 'Statistics', 'sportspress' ); ?></label>
<select name="term_meta[sp_sections][]" id="term_meta[sp_sections][]" class="widefat chosen-select
<?php
if ( is_rtl() ) :
@@ -201,7 +201,7 @@ class SP_Admin_Taxonomies {
)
);
foreach ( $options as $key => $value ) :
printf( '<option value="%s" %s>%s</option>', $key, selected( true ), $value );
printf( '<option value="%s" %s>%s</option>', esc_attr( $key ), selected( true ), esc_html( $value ) );
endforeach;
?>
</select>
@@ -220,7 +220,7 @@ class SP_Admin_Taxonomies {
$sections = sp_get_term_sections( $t_id );
?>
<tr class="form-field">
<th scope="row" valign="top"><label for="term_meta[sp_sections]"><?php _e( 'Statistics', 'sportspress' ); ?></label></th>
<th scope="row" valign="top"><label for="term_meta[sp_sections]"><?php esc_html_e( 'Statistics', 'sportspress' ); ?></label></th>
<input type="hidden" name="term_meta[sp_sections]" value="">
<td>
<select name="term_meta[sp_sections][]" id="term_meta[sp_sections][]" class="widefat chosen-select
@@ -240,7 +240,7 @@ class SP_Admin_Taxonomies {
)
);
foreach ( $options as $key => $value ) :
printf( '<option value="%s" %s>%s</option>', $key, selected( in_array( $key, $sections ), true, false ), $value );
printf( '<option value="%s" %s>%s</option>', esc_attr( $key ), selected( in_array( $key, $sections ), true, false ), esc_html( $value ) );
endforeach;
?>
</select>
@@ -249,7 +249,7 @@ class SP_Admin_Taxonomies {
<?php if ( function_exists( 'get_term_meta' ) ) { ?>
<?php $order = get_term_meta( $t_id, 'sp_order', true ); ?>
<tr class="form-field">
<th scope="row" valign="top"><label for="sp_order"><?php _e( 'Order', 'sportspress' ); ?></label></th>
<th scope="row" valign="top"><label for="sp_order"><?php esc_html_e( 'Order', 'sportspress' ); ?></label></th>
<td><input name="sp_order" class="sp-number-input" type="text" step="1" size="4" id="sp_order" value="<?php echo (int) $order; ?>"></td>
</tr>
<?php } ?>