Shortcodes

The following shortcodes for front end displays are described below.

Roster Tables
[mstw-tr-roster team=team-slug]

Roster Galleries
[mstw-tr-gallery team=team-slug]

Roster Tables

The Team Rosters roster table shortcode is:

[mstw-tr-roster team=team-slug]

The team argument is REQUIRED. Nothing will display without it. Many other arguments are available to control the table as discussed below.

The Team Rosters Table layout is controlled by three factors in the following order:

  1. the [mstw-tr-roster] shortcode format argument, or if not specified,
  2. the remaining [mstw-tr-roster] shortcode arguments, or if not specified,
  3. the global default settings in the plugin’s Display Settings admin screen – Data Fields & Columns and Roster Tables tabs..

The default settings for all roster tables on a site may be set on the plugin’s Settings screen . This approach works well for single team and single sport sites. The [shortcode] arguments for individual tables override the plugin’s default Display Settings. So each roster table can have a unique format.

Note that shortcode’s roster_type argument also overrides the display settings AND the other [shortcode] arguments. If you wish to use a custom roster format, you must omit the format argument or set it to ‘custom’.

The available roster types are described below:

roster_type fields(columns) displayed
high-school Number, Name, Position, Height, Weight, Year
college Number, Name, Position, Height, Weight, Year, Experience, Hometown(Last School)
pro Number, Name, Position, Height, Weight, Age, Experience, Last School(Country)
baseball-pro
baseball-college
baseball-high-school
Baseball formats add a Bats/Throws column after the Position column

The arguments are available for use with the [mstw-tr-roster] shortcode and their defaults are listed below. In all the ‘show’ arguments, 1 means show the data field or column and 0 means hide it. Remember that the data columns are very flexible, so the descriptions only indicate the intent for the field or column. For example, one could use the “Height” field to show the Salary of each player simply by relabeling it appropriately and entering each player’s salary in the Height field. Several sample rosters and their arguments are shown at the end of this page.

// 'show_' arguments are always 0=hide | 1=show
// always show the player name

'show_number'			=> 1,
'number_label'			=> __( 'Nbr', 'team-rosters' ),
'name_label'			=> __( 'Name', 'team-rosters' ),
'show_photos'			=> 0,
'photo_label'			=>  __( 'Photo', 'team-rosters' ),
'show_position'			=> 1,
'position_label'		=> __( 'Pos', 'team-rosters' ),
'show_height'			=> 1,
'height_label'			=> __( 'Ht', 'team-rosters' ),
'show_weight'			=> 1,
'weight_label'			=> __( 'Wt', 'team-rosters' ),
'show_year'				=> 0,
'year_label'			=> __( 'Year', 'team-rosters' ),
'show_experience'		=> 0,
'experience_label'		=> __( 'Exp', 'team-rosters' ),
'show_age'				=> 0,
'age_label'				=> __( 'Age', 'team-rosters' ),
'show_home_town'		=> 0,
'home_town_label'		=> __( 'Home Town', 'team-rosters' ),
'show_last_school'		=> 0,
'last_school_label'		=> __( 'Last School', 'team-rosters' ),
'show_country'			=> 0,
'country_label'			=> __( 'Country', 'team-rosters' ),
'show_bats_throws'		=> 0,
'bats_throws_label'		=> __( 'Bat/Thw', 'team-rosters' ),
'show_other_info'		=> 0,
'other_info_label'		=> __( 'Other', 'team-rosters' ),	
'show_title'			=> 0, 

'roster_type'			=> 'custom',
// custom | high-school | college | pro
// baseball-high-school | baseball-college | baseball-pro
'links_to_profiles'		=> 1,
// 0|1 (omit|add)
'sort_order'			=> 'alpha', //sorts by last name
// alpha|numeric 
'sort_asc_desc'			=> 'asc',  //ascending order
// asc|desc
'name_format'			=> 'last-first',
// last-first | first-last | first-only | last-only
'table_photo_width'		=> '',
'table_photo_height'	=> '',

the following screenshots provide examples of use of the shortcode arguments:

SF Giants Roster Table

[mstw-tr-roster team=’sf-giants’ roster_type=’baseball-pro’ show_title=0 name_format=’first-last’ sort_order=‘alpha’]

Cal Roster Table

[mstw-tr-roster team=’cal-bears’ roster_type=’college’ show_photos=1 show_title=0 name_format=’last-first’ sort_order=‘numeric’]

Roster Galleries

The Team Rosters Player Gallery shortcode is:

[mstw-tr-gallery team=team-slug]

The team argument is REQUIRED. Nothing will display without it. The roster_type and the other arguments described above for Roster Tables apply to Roster Galleries as well. In addition, the following arguments are available:

	
// in addition to the arguments shown for tables above,
// player profiles and galleries have these additional arguments
//
'sp_content_title'		=> __( 'Player Bio', 'team-rosters' ),

'sp_image_width'		=> 150,
'sp_image_height'		=> 150,

SF Giants Gallery
[mstw-tr-gallery team=sf-giants roster_type=baseball-pro name_format=’first-last’ sort_order=alpha show_title=0]

Cal Bears Gallery
[mstw-tr-gallery team=cal-bears roster_type=college name_format=’last-first’ sort_order=numeric show_title=0]