Skip to content

Commit

Permalink
switch order for phpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
pkevan committed Dec 18, 2024
1 parent 2997c2d commit 6fa76e6
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions public_html/wp-content/plugins/camptix/inc/class-camptix-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,21 @@ public function menu_tools_tabs() {
*/
public function menu_tools_summarize() {
$summarize_by = isset( $_POST['tix_summarize_by'] ) ? $_POST['tix_summarize_by'] : 'ticket';
if ( isset( $_POST['tix_summarize_submit'] ) && wp_verify_nonce( $_POST['_wp_nonce'], 'tix_summarize' ) && array_key_exists( $summarize_by, $this->get_available_summary_fields() ) ) :
$fields = $this->get_available_summary_fields();
$summary = $this->get_summary( $summarize_by );
$summary_title = $fields[ $summarize_by ];
$alt = '';

$rows = array();
foreach ( $summary as $entry ) {
$rows[] = array(
esc_html( $summary_title ) => esc_html( $entry['label'] ),
esc_html__( 'Count', 'wordcamporg' ) => esc_html( $entry['count'] ),
);
}
// Render the widefat table.
$this->table( $rows, 'widefat tix-summarize' );
?>
<form method="post" action="<?php echo esc_url( add_query_arg( 'tix_summarize', 1 ) ); ?>">
<table class="form-table">
Expand Down Expand Up @@ -233,26 +248,6 @@ public function menu_tools_summarize() {
<input type="submit" name="tix_export_summary" value="<?php esc_attr_e( 'Export Summary to CSV', 'wordcamporg' ); ?>" class="button" />
</p>
</form>

<?php if ( isset( $_POST['tix_summarize_submit'] ) && wp_verify_nonce( $_POST['_wp_nonce'], 'tix_summarize' ) && array_key_exists( $summarize_by, $this->get_available_summary_fields() ) ) : ?>
<?php
$fields = $this->get_available_summary_fields();
$summary = $this->get_summary( $summarize_by );
$summary_title = $fields[ $summarize_by ];
$alt = '';

$rows = array();
foreach ( $summary as $entry ) {
$rows[] = array(
esc_html( $summary_title ) => esc_html( $entry['label'] ),
esc_html__( 'Count', 'wordcamporg' ) => esc_html( $entry['count'] ),
);
}
// Render the widefat table.
$this->table( $rows, 'widefat tix-summarize' );
?>

<?php endif; // summarize_submit. ?>
<?php
}

Expand Down

0 comments on commit 6fa76e6

Please sign in to comment.