Target specific tables by adding a unique class name
Using the uniqid function of PHP (http://www.php.net/manual/en/function.uniqid.php)
This commit is contained in:
@@ -93,13 +93,15 @@ if ( $show_title && false === $title && $id ):
|
||||
$title = get_the_title( $id );
|
||||
endif;
|
||||
$labels = array();
|
||||
//Create a unique identifier based on the current time in microseconds
|
||||
$identifier = uniqid('eventlist_');
|
||||
?>
|
||||
<div class="sp-template sp-template-event-list">
|
||||
<?php if ( $title ) { ?>
|
||||
<h4 class="sp-table-caption"><?php echo $title; ?></h4>
|
||||
<?php } ?>
|
||||
<div class="sp-table-wrapper">
|
||||
<table class="sp-event-list sp-event-list-format-<?php echo $title_format; ?> sp-data-table<?php if ( $paginated ) { ?> sp-paginated-table<?php } if ( $sortable ) { ?> sp-sortable-table<?php } if ( $responsive ) { ?> sp-responsive-table<?php } if ( $scrollable ) { ?> sp-scrollable-table<?php } ?>" data-sp-rows="<?php echo $rows; ?>">
|
||||
<table class="sp-event-list sp-event-list-format-<?php echo $title_format; ?> sp-data-table<?php if ( $paginated ) { ?> sp-paginated-table<?php } if ( $sortable ) { ?> sp-sortable-table<?php } if ( $responsive ) { echo ' sp-responsive-table '.$identifier; } if ( $scrollable ) { ?> sp-scrollable-table <?php } ?>" data-sp-rows="<?php echo $rows; ?>">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
@@ -451,7 +453,7 @@ $labels = array();
|
||||
//var_dump($labels);
|
||||
// If responsive tables are enabled then load the inline css code
|
||||
if ($responsive == true){
|
||||
sportspress_responsive_tables_css($labels);
|
||||
sportspress_responsive_tables_css($labels,$identifier);
|
||||
}
|
||||
if ( $id && $show_all_events_link )
|
||||
echo '<div class="sp-calendar-link sp-view-all-link"><a href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a></div>';
|
||||
|
||||
@@ -22,13 +22,15 @@ if ( ! isset( $lineups ) ) $lineups = array();
|
||||
if ( ! isset( $subs ) ) $subs = array();
|
||||
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
||||
$rlabels = array();
|
||||
//Create a unique identifier based on the current time in microseconds
|
||||
$identifier = uniqid('performance_');
|
||||
?>
|
||||
<div class="sp-template sp-template-event-performance sp-template-event-performance-<?php echo $mode; ?><?php if ( isset( $class ) ) { echo ' ' . $class; } ?>">
|
||||
<?php if ( $caption ): ?>
|
||||
<h4 class="sp-table-caption"><?php echo $caption; ?></h4>
|
||||
<?php endif; ?>
|
||||
<div class="sp-table-wrapper">
|
||||
<table class="sp-event-performance sp-data-table<?php if ( $mode == 'values' ) { ?><?php if ( $scrollable ) { ?> sp-scrollable-table<?php }if ( $responsive ) { ?> sp-responsive-table<?php } ?><?php if ( $sortable ) { ?> sp-sortable-table<?php } ?><?php } ?>">
|
||||
<table class="sp-event-performance sp-data-table<?php if ( $mode == 'values' ) { ?><?php if ( $scrollable ) { ?> sp-scrollable-table<?php }if ( $responsive ) { echo ' sp-responsive-table '.$identifier; } if ( $sortable ) { ?> sp-sortable-table<?php } ?><?php } ?>">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php if ( $mode == 'values' ): ?>
|
||||
@@ -266,5 +268,5 @@ $rlabels = array();
|
||||
<?php
|
||||
// If responsive tables are enabled then load the inline css code
|
||||
if ($responsive == true && $mode == 'values'){
|
||||
sportspress_responsive_tables_css($rlabels);
|
||||
sportspress_responsive_tables_css($rlabels,$identifier);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,9 @@ if ( $show_title && false === $title && $id ):
|
||||
$title = get_the_title( $id );
|
||||
endif;
|
||||
|
||||
//Create a unique identifier based on the current time in microseconds
|
||||
$identifier = uniqid('table_');
|
||||
|
||||
$output = '';
|
||||
|
||||
if ( $title )
|
||||
@@ -55,7 +58,7 @@ if ( $title )
|
||||
|
||||
$output .= '<div class="sp-table-wrapper">';
|
||||
|
||||
$output .= '<table class="sp-league-table sp-data-table' . ( $sortable ? ' sp-sortable-table' : '' ) . ( $responsive ? ' sp-responsive-table' : '' ). ( $scrollable ? ' sp-scrollable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
|
||||
$output .= '<table class="sp-league-table sp-data-table' . ( $sortable ? ' sp-sortable-table' : '' ) . ( $responsive ? ' sp-responsive-table '.$identifier : '' ). ( $scrollable ? ' sp-scrollable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
|
||||
|
||||
$data = $table->data();
|
||||
|
||||
@@ -63,7 +66,7 @@ $data = $table->data();
|
||||
$labels = $data[0];
|
||||
// If responsive tables are enabled then load the inline css code
|
||||
if ($responsive == true){
|
||||
sportspress_responsive_tables_css($labels);
|
||||
sportspress_responsive_tables_css($labels,$identifier);
|
||||
}
|
||||
// Remove the first row to leave us with the actual data
|
||||
unset( $data[0] );
|
||||
|
||||
@@ -56,9 +56,11 @@ $data = $list->data();
|
||||
|
||||
// The first row should be column labels
|
||||
$labels = $data[0];
|
||||
//Create a unique identifier based on the current time in microseconds
|
||||
$identifier = uniqid('playerlist_');
|
||||
// If responsive tables are enabled then load the inline css code
|
||||
if ($responsive == true){
|
||||
sportspress_responsive_tables_css($labels);
|
||||
sportspress_responsive_tables_css($labels,$identifier);
|
||||
}
|
||||
// Remove the first row to leave us with the actual data
|
||||
unset( $data[0] );
|
||||
@@ -211,7 +213,7 @@ foreach ( $groups as $group ):
|
||||
endif;
|
||||
|
||||
$output .= '<div class="sp-table-wrapper">' .
|
||||
'<table class="sp-player-list sp-data-table' . ( $sortable ? ' sp-sortable-table' : '' ). ( $responsive ? ' sp-responsive-table' : '' ) . ( $scrollable ? ' sp-scrollable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
|
||||
'<table class="sp-player-list sp-data-table' . ( $sortable ? ' sp-sortable-table' : '' ). ( $responsive ? ' sp-responsive-table '.$identifier : '' ) . ( $scrollable ? ' sp-scrollable-table' : '' ) . ( $paginated ? ' sp-paginated-table' : '' ) . '" data-sp-rows="' . $rows . '">' . '<thead>' . '<tr>';
|
||||
|
||||
if ( ! is_array( $labels ) || array_key_exists( 'number', $labels ) ):
|
||||
if ( in_array( $orderby, array( 'number', 'name' ) ) ):
|
||||
|
||||
Reference in New Issue
Block a user