Replace settings outputs with suitable escape functions

This commit is contained in:
Brian Miyaji
2021-11-06 20:04:07 +09:00
parent fa8e3fdd73
commit bb597b2658
10 changed files with 18 additions and 18 deletions

View File

@@ -37,8 +37,8 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
</thead>
<?php if ( $data ): $i = 0; foreach ( $data as $row ): ?>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo esc_attr( $row->post_title ); ?></td>
<td><code><?php echo esc_attr( $row->post_name ); ?></code></td>
<td class="row-title"><?php echo esc_html( $row->post_title ); ?></td>
<td><code><?php echo esc_html( $row->post_name ); ?></code></td>
<td><?php echo esc_html( sp_get_post_abbreviation( $row->ID ) ); ?></td>
<td><?php echo esc_html( sp_get_post_condition( $row->ID ) ); ?></td>
<td><p class="description"><?php echo wp_kses_post( $row->post_excerpt ); ?></p></td>
@@ -114,7 +114,7 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="radio"><input type="radio" class="sp-primary-result-option" id="sportspress_primary_result_<?php echo esc_attr( $row->post_name ); ?>" name="sportspress_primary_result" value="<?php echo esc_attr( $row->post_name ); ?>" <?php checked( $selection, $row->post_name ); ?>></td>
<td class="row-title"><label for="sportspress_primary_result_<?php echo esc_attr( $row->post_name ); ?>"><?php echo esc_html( $row->post_title ); ?></label></td>
<td><code><?php echo esc_attr( $row->post_name ); ?>for</code>, <code><?php echo esc_attr( $row->post_name ); ?>against</code></td>
<td><code><?php echo esc_html( $row->post_name ); ?>for</code>, <code><?php echo esc_html( $row->post_name ); ?>against</code></td>
<td><?php echo esc_html( sp_get_post_equation( $row->ID ) ); ?></td>
<td><?php echo esc_html( sp_get_post_precision( $row->ID ) ); ?></td>
<td><p class="description"><?php echo wp_kses_post( $row->post_excerpt ); ?></p></td>
@@ -215,7 +215,7 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
?>
</td>
<td class="row-title"><?php echo esc_html( $row->post_title ); ?></td>
<td><code><?php echo esc_attr( $row->post_name ); ?></code></td>
<td><code><?php echo esc_html( $row->post_name ); ?></code></td>
<td><?php echo esc_html( sp_get_post_section( $row->ID ) ); ?></td>
<td><?php echo esc_html( sp_get_post_format( $row->ID ) ); ?></td>
<?php if ( 'auto' === $columns ) { ?>
@@ -326,7 +326,7 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<?php if ( $data ): $i = 0; foreach ( $data as $row ): ?>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<td class="row-title"><?php echo esc_html( $row->post_title ); ?></td>
<td><code><?php echo esc_attr( $row->post_name ); ?></code></td>
<td><code><?php echo esc_html( $row->post_name ); ?></code></td>
<td><p class="description"><?php echo wp_kses_post( $row->post_excerpt ); ?></p></td>
<td class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td>
</tr>

View File

@@ -349,7 +349,7 @@
<td>
<?php
$object = get_post_type_object( $post_type );
echo esc_attr( $object->labels->name );
echo esc_html( $object->labels->name );
?>:
</td>
<td>
@@ -401,7 +401,7 @@
<tr>
<td><?php _e( 'Theme Name', 'sportspress' ); ?>:</td>
<td><?php
echo esc_attr( $active_theme->Name );
echo esc_html( $active_theme->Name );
?></td>
</tr>
<tr>

View File

@@ -2,7 +2,7 @@
<h2><?php echo apply_filters( 'sportspress_logo', '<img src="' . plugin_dir_url( SP_PLUGIN_FILE ) . 'assets/images/modules/sportspress' . ( class_exists( 'SportsPress_Pro' ) ? '-pro' : '' ) . '.png" alt="' . __( 'SportsPress', 'sportspress' ) . '" class="sp-settings-logo">' ); ?></h2>
<form method="post" id="mainform" action="" enctype="multipart/form-data">
<h2 class="nav-tab-wrapper sp-nav-tab-wrapper">
<?php foreach ( $tabs as $name => $label ): ?><a href="<?php echo admin_url( 'admin.php?page=sportspress&tab=' . $name ); ?>" class="nav-tab <?php echo ( $current_tab == $name ? 'nav-tab-active' : '' ); ?>"><?php echo esc_attr( $label ); ?></a><?php endforeach; ?>
<?php foreach ( $tabs as $name => $label ): ?><a href="<?php echo admin_url( 'admin.php?page=sportspress&tab=' . $name ); ?>" class="nav-tab <?php echo ( $current_tab == $name ? 'nav-tab-active' : '' ); ?>"><?php echo esc_html( $label ); ?></a><?php endforeach; ?>
<?php do_action( 'sportspress_settings_tabs' ); ?>
</h2>
<?php