Shortcodes

The following shortcodes for front end displays are described below.

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

[mstw-tr-roster-2 team=team-slug] or [mstw_tr_roster_2 team=team-slug]

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

Team Roster Table (original version)

The roster table shortcode incantation (call) 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_typefields(columns) displayed
high-schoolNumber, Name, Position, Height, Weight, Year
collegeNumber, Name, Position, Height, Weight, Year, Experience, Hometown(Last School)
proNumber, 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’]

Team Roster Table ( version 2)

The incantation for version 2 of the team roster table shortcode is:

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

Sample output for this table format is shown in the screenshots below. Unlike the original team roster, sort order can be changed using the dropdown menu at the table’s top right

The current version of this shortcode supports to a number of arguments including:

  • sort_order (numeric | alpha-first | alpha-last) This is the initial sort order, which the user can change via the dropdown menu.
  • show_title ( 0 | 1 ) The title [Team Name Roster] can be displayed above the table.
  • roster_type ( pro | college | etc … see list below) Affects the three fields in the shortcode output and the data fields in the player bios when a user clicks the >FULL BIO link.
roster_typefields(columns) displayed
high-school(long) year, height/weight, blank
baseball-high-school(long) year, height/weight, bats/throws
college
baseball-college
(long) year, hometown, last school
pro
baseball-pro
experience, last-school, country

The data in the shortcode output is further configurable by setting roster_type to custom and using the Settings screen, Roster Tables tab. The colors may be set using the Settings screen, Roster Table Colors tab. Teams specific colors may also be controlled via custom CSS rules as in the screenshots below.

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]