Clean up spaces, tabs, indentation, and bracket formatting

This commit is contained in:
Brian Miyaji
2021-11-10 15:41:40 +09:00
parent e58beb1201
commit 3dff686a00
285 changed files with 29638 additions and 24147 deletions

View File

@@ -10,20 +10,20 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<tbody>
<?php
$args = array(
'post_type' => 'sp_outcome',
'numberposts' => -1,
'post_type' => 'sp_outcome',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
'orderby' => 'menu_order',
'order' => 'ASC',
);
$data = get_posts( $args );
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php _e( 'Event Outcomes', 'sportspress' ) ?>
<?php _e( 'Event Outcomes', 'sportspress' ); ?>
<p class="description"><?php _e( 'Used for events.', 'sportspress' ); ?></p>
</th>
<td class="forminp">
<td class="forminp">
<table class="widefat sp-admin-config-table">
<thead>
<tr>
@@ -35,8 +35,16 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<th scope="col" class="edit"></th>
</tr>
</thead>
<?php if ( $data ): $i = 0; foreach ( $data as $row ): ?>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<?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_html( $row->post_name ); ?></code></td>
<td><?php echo esc_html( sp_get_post_abbreviation( $row->ID ) ); ?></td>
@@ -44,7 +52,10 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<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>
<?php $i++; endforeach; else: ?>
<?php
$i++;
endforeach; else :
?>
<tr class="alternate">
<td colspan="6"><?php _e( 'No results found.', 'sportspress' ); ?></td>
</tr>
@@ -65,21 +76,21 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
$selection = get_option( 'sportspress_primary_result', 0 );
$args = array(
'post_type' => 'sp_result',
'numberposts' => -1,
'post_type' => 'sp_result',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
'orderby' => 'menu_order',
'order' => 'ASC',
);
$data = get_posts( $args );
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php _e( 'Event Results', 'sportspress' ) ?>
<?php _e( 'Event Results', 'sportspress' ); ?>
<p class="description"><?php _e( 'Used for events.', 'sportspress' ); ?></p>
</th>
<td class="forminp">
<legend class="screen-reader-text"><span><?php _e( 'Event Results', 'sportspress' ) ?></span></legend>
<td class="forminp">
<legend class="screen-reader-text"><span><?php _e( 'Event Results', 'sportspress' ); ?></span></legend>
<form>
<?php wp_nonce_field( 'sp-save-primary-result', 'sp-primary-result-nonce', false ); ?>
<table class="widefat sp-admin-config-table">
@@ -99,19 +110,27 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<th class="radio"><input type="radio" class="sp-primary-result-option" id="sportspress_primary_result_0" name="sportspress_primary_result" value="0" <?php checked( $selection, 0 ); ?>></th>
<th colspan="6"><label for="sportspress_primary_result_0">
<?php
if ( sizeof( $data ) > 0 ):
if ( sizeof( $data ) > 0 ) :
$default = end( $data );
reset( $data );
printf( __( 'Default (%s)', 'sportspress' ), $default->post_title );
else:
else :
_e( 'Default', 'sportspress' );
endif;
?>
</label></th>
</tr>
</tfoot>
<?php if ( $data ): $i = 0; foreach ( $data as $row ): ?>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<?php
if ( $data ) :
$i = 0; foreach ( $data as $row ) :
?>
<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_html( $row->post_name ); ?>for</code>, <code><?php echo esc_html( $row->post_name ); ?>against</code></td>
@@ -120,7 +139,10 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<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>
<?php $i++; endforeach; else: ?>
<?php
$i++;
endforeach; else :
?>
<tr class="alternate">
<td colspan="7"><?php _e( 'No results found.', 'sportspress' ); ?></td>
</tr>
@@ -140,26 +162,28 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<tbody>
<?php
$selection = get_option( 'sportspress_primary_performance', 0 );
$colspan = 8;
$colspan = 8;
if ( 'auto' === $columns ) $colspan ++;
if ( 'auto' === $columns ) {
$colspan ++;
}
$args = array(
'post_type' => 'sp_performance',
'numberposts' => -1,
'post_type' => 'sp_performance',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
'orderby' => 'menu_order',
'order' => 'ASC',
);
$data = get_posts( $args );
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php _e( 'Player Performance', 'sportspress' ) ?>
<?php _e( 'Player Performance', 'sportspress' ); ?>
<p class="description"><?php _e( 'Used for events.', 'sportspress' ); ?></p>
</th>
<td class="forminp">
<legend class="screen-reader-text"><span><?php _e( 'Player Performance', 'sportspress' ) ?></span></legend>
<td class="forminp">
<legend class="screen-reader-text"><span><?php _e( 'Player Performance', 'sportspress' ); ?></span></legend>
<form>
<?php wp_nonce_field( 'sp-save-primary-performance', 'sp-primary-performance-nonce', false ); ?>
<table class="widefat sp-admin-config-table">
@@ -187,29 +211,40 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<th class="icon">&nbsp;</td>
<th colspan="<?php echo $colspan - 1; ?>"><label for="sportspress_primary_performance_0">
<?php
if ( sizeof( $data ) > 0 ):
if ( sizeof( $data ) > 0 ) :
$default = reset( $data );
printf( __( 'Default (%s)', 'sportspress' ), $default->post_title );
else:
else :
_e( 'Default', 'sportspress' );
endif;
?>
</label></th>
</tr>
</tfoot>
<?php if ( $data ): $i = 0; foreach ( $data as $row ): ?>
<?php
$visible = get_post_meta( $row->ID, 'sp_visible', true );
if ( '' === $visible ) $visible = 1;
?>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<?php
if ( $data ) :
$i = 0; foreach ( $data as $row ) :
?>
<?php
$visible = get_post_meta( $row->ID, 'sp_visible', true );
if ( '' === $visible ) {
$visible = 1;
}
?>
<tr
<?php
if ( $i % 2 == 0 ) {
echo ' class="alternate"';}
?>
>
<td class="radio"><input type="radio" class="sp-primary-performance-option" id="sportspress_primary_performance_<?php echo esc_attr( $row->post_name ); ?>" name="sportspress_primary_performance" value="<?php echo esc_attr( $row->post_name ); ?>" <?php checked( $selection, $row->post_name ); ?>></td>
<td class="icon">
<?php
if ( has_post_thumbnail( $row->ID ) )
if ( has_post_thumbnail( $row->ID ) ) {
$icon = get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' );
else
} else {
$icon = '&nbsp;';
}
echo apply_filters( 'sportspress_performance_icon', $icon, $row->ID );
?>
@@ -218,15 +253,25 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<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 ) { ?>
<?php if ( 'auto' === $columns ) { ?>
<td>
<?php if ( $visible ) { ?><i class="dashicons dashicons-yes"></i><?php } else { ?>&nbsp;<?php } ?>
<?php
if ( $visible ) {
?>
<i class="dashicons dashicons-yes"></i>
<?php
} else {
?>
&nbsp;<?php } ?>
</td>
<?php } ?>
<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>
<?php $i++; endforeach; else: ?>
<?php
$i++;
endforeach; else :
?>
<tr class="alternate">
<td colspan="<?php echo $colspan; ?>"><?php _e( 'No results found.', 'sportspress' ); ?></td>
</tr>
@@ -246,20 +291,20 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<tbody>
<?php
$args = array(
'post_type' => 'sp_column',
'numberposts' => -1,
'post_type' => 'sp_column',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
'orderby' => 'menu_order',
'order' => 'ASC',
);
$data = get_posts( $args );
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php _e( 'Table Columns', 'sportspress' ) ?>
<?php _e( 'Table Columns', 'sportspress' ); ?>
<p class="description"><?php _e( 'Used for league tables.', 'sportspress' ); ?></p>
</th>
<td class="forminp">
<td class="forminp">
<table class="widefat sp-admin-config-table">
<thead>
<tr>
@@ -271,8 +316,16 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<th scope="col" class="edit"></th>
</tr>
</thead>
<?php if ( $data ): $i = 0; foreach ( $data as $row ): ?>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<?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><?php echo wp_kses_post( sp_get_post_equation( $row->ID ) ); ?></td>
<td><?php echo esc_html( sp_get_post_precision( $row->ID ) ); ?></td>
@@ -280,7 +333,10 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<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>
<?php $i++; endforeach; else: ?>
<?php
$i++;
endforeach; else :
?>
<tr class="alternate">
<td colspan="7"><?php _e( 'No results found.', 'sportspress' ); ?></td>
</tr>
@@ -300,20 +356,20 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<tbody>
<?php
$args = array(
'post_type' => 'sp_metric',
'numberposts' => -1,
'post_type' => 'sp_metric',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
'orderby' => 'menu_order',
'order' => 'ASC',
);
$data = get_posts( $args );
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php _e( 'Player Metrics', 'sportspress' ) ?>
<?php _e( 'Player Metrics', 'sportspress' ); ?>
<p class="description"><?php _e( 'Used for player lists.', 'sportspress' ); ?></p>
</th>
<td class="forminp">
<td class="forminp">
<table class="widefat sp-admin-config-table">
<thead>
<tr>
@@ -323,14 +379,25 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<th scope="col" class="edit"></th>
</tr>
</thead>
<?php if ( $data ): $i = 0; foreach ( $data as $row ): ?>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<?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_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>
<?php $i++; endforeach; else: ?>
<?php
$i++;
endforeach; else :
?>
<tr class="alternate">
<td colspan="4"><?php _e( 'No results found.', 'sportspress' ); ?></td>
</tr>
@@ -349,24 +416,26 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<tbody>
<?php
$args = array(
'post_type' => 'sp_statistic',
'numberposts' => -1,
'post_type' => 'sp_statistic',
'numberposts' => -1,
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
'orderby' => 'menu_order',
'order' => 'ASC',
);
$data = get_posts( $args );
$colspan = 6;
if ( 'auto' === $columns ) $colspan ++;
if ( 'auto' === $columns ) {
$colspan ++;
}
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php _e( 'Player Statistics', 'sportspress' ) ?>
<?php _e( 'Player Statistics', 'sportspress' ); ?>
<p class="description"><?php _e( 'Used for player lists.', 'sportspress' ); ?></p>
</th>
<td class="forminp">
<td class="forminp">
<table class="widefat sp-admin-config-table">
<thead>
<tr>
@@ -385,19 +454,30 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<th scope="col" class="edit"></th>
</tr>
</thead>
<?php if ( $data ): $i = 0; foreach ( $data as $row ): ?>
<?php
$visible = get_post_meta( $row->ID, 'sp_visible', true );
if ( '' === $visible ) $visible = 1;
?>
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
<?php
if ( $data ) :
$i = 0; foreach ( $data as $row ) :
?>
<?php
$visible = get_post_meta( $row->ID, 'sp_visible', true );
if ( '' === $visible ) {
$visible = 1;
}
?>
<tr
<?php
if ( $i % 2 == 0 ) {
echo ' class="alternate"';}
?>
>
<td class="row-title"><?php echo esc_html( $row->post_title ); ?></td>
<td class="icon">
<?php
if ( has_post_thumbnail( $row->ID ) )
if ( has_post_thumbnail( $row->ID ) ) {
$icon = get_the_post_thumbnail( $row->ID, 'sportspress-fit-mini' );
else
} else {
$icon = '&nbsp;';
}
echo apply_filters( 'sportspress_performance_icon', $icon, $row->ID );
?>
@@ -405,15 +485,25 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
<td><?php echo wp_kses_post( sp_get_post_equation( $row->ID ) ); ?></td>
<td><?php echo esc_html( sp_get_post_precision( $row->ID ) ); ?></td>
<td><?php echo esc_html( sp_get_post_section( $row->ID ) ); ?></td>
<?php if ( 'auto' === $columns ) { ?>
<?php if ( 'auto' === $columns ) { ?>
<td>
<?php if ( $visible ) { ?><i class="dashicons dashicons-yes"></i><?php } else { ?>&nbsp;<?php } ?>
<?php
if ( $visible ) {
?>
<i class="dashicons dashicons-yes"></i>
<?php
} else {
?>
&nbsp;<?php } ?>
</td>
<?php } ?>
<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>
<?php $i++; endforeach; else: ?>
<?php
$i++;
endforeach; else :
?>
<tr class="alternate">
<td colspan="<?php echo $colspan; ?>"><?php _e( 'No results found.', 'sportspress' ); ?></td>
</tr>
@@ -429,4 +519,4 @@ $columns = get_option( 'sportspress_player_columns', 'auto' );
</tbody>
</table>
<?php do_action( 'sportspress_config_page' ); ?>
</div>
</div>