Option to display photos in player list close #28

This commit is contained in:
Brian Miyaji
2014-08-14 23:03:30 +10:00
parent c3776b4838
commit 5bcd97a5d2
4 changed files with 42 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 1.0.2
* @version 1.3
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -37,6 +37,7 @@ class SP_Meta_Box_List_Data {
* Admin edit table
*/
public static function table( $columns = array(), $data = array(), $placeholders = array(), $adjustments = array() ) {
$show_player_photo = get_option( 'sportspress_list_show_photos', 'no' ) == 'yes' ? true : false;
?>
<ul class="subsubsub sp-table-bar">
<li><a href="#sp-table-values" class="current"><?php _e( 'Values', 'sportspress' ); ?></a></li> |
@@ -77,6 +78,7 @@ class SP_Meta_Box_List_Data {
<tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>">
<td><?php echo ( $number ? $number : '&nbsp;' ); ?></td>
<td>
<?php if ( $show_player_photo ) echo get_the_post_thumbnail( $player_id, 'sportspress-fit-mini' ); ?>
<span class="sp-default-value">
<span class="sp-default-value-input"><?php echo $default_name; ?></span>
<a class="dashicons dashicons-edit sp-edit" title="<?php _e( 'Edit', 'sportspress' ); ?>"></a>

View File

@@ -58,6 +58,14 @@ class SP_Settings_Players extends SP_Settings_Page {
array( 'title' => __( 'Player Lists', 'sportspress' ), 'type' => 'title', 'id' => 'list_options' ),
array(
'title' => __( 'Players', 'sportspress' ),
'desc' => __( 'Display photos', 'sportspress' ),
'id' => 'sportspress_list_show_photos',
'default' => 'no',
'type' => 'checkbox',
),
array(
'title' => __( 'Pagination', 'sportspress' ),
'desc' => __( 'Paginate', 'sportspress' ),