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] or [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 rolex day date 41mm pour des hommes m228235 0005 automatique 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.

$defaults = array(	
	'show_number'	    => 1,
	'number_label'	    => __( 'Nbr', 'team-rosters' ),
	'order_number'      => 3,

	//the name will always be shown, show_name=0 does nothing
	'show_name'         => 1,
	'name_label'	    => __( 'Name', 'team-rosters' ),
	'order_name'        => 2,

	'show_photos'	    => 0,
	'photo_label'	    =>  __( 'Photo', 'team-rosters' ),
	'order_photo'       => 1,

	'show_position'	    => 1,
	'position_label'    => __( 'Pos', 'team-rosters' ),
	'order_position'    => 4,

	'show_height'	    => 1,
	'height_label'	    => __( 'Ht', 'team-rosters' ),
	'order_height'      => 5,

	'show_weight'	    => 1,
	'weight_label'	    => __( 'Wt', 'team-rosters' ),
	'order_weight'      => 6,

	'show_year'	    => 0,
	'year_label'	    => __( 'Year', 'team-rosters' ),
	'order_year'        => 7,

	'show_experience'   => 0,
	'experience_label'  => __( 'Exp', 'team-rosters' ),
	'order_experience'  => 8,

	'show_age'	    => 0,
	'age_label'	    => __( 'Age', 'team-rosters' ),
	'order_age'         => 9,

	'show_home_town'    => 0,
	'home_town_label'   => __( 'Home Town', 'team-rosters' ),
	'order_home_town'   => 10,

	'show_last_school'  => 0,
	'last_school_label' => __( 'Last School', 'team-rosters' ),
	'order_last_school' => 11,

	'show_country'	    => 0,
	'country_label'	    => __( 'Country', 'team-rosters' ),
	'order_country'     => 12,

	'show_bats_throws'  => 0,
	'bats_throws_label' => __( 'Bat/Thw', 'team-rosters' ),
	'order_bats_throws' => 13,

	'show_other_info'   => 0,
	'other_info_label'  => __( 'Other', 'team-rosters' ),
	'order_other_info'  => 14,
);

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.

The defaults for version 2 of the roster tables are shown below:

$defaults = array(	
		'show_title_2'	=> 0, 
		// 0|1 (hide|show)
		'roster_type_2'	=> 'custom',
		// custom | high-school | college | pro
		// baseball-high-school | baseball-college | baseball-pro
		'sort_order_2'	=> 'numeric', //sorts by last name
		// alpha|numeric 
		'sort_asc_desc_2' => 'asc',  //sort order
		// asc|desc
		'name_format_2'	=> 'last-first',
		// last-first | first-last | first-only | last-only
		
		'data_field_1'  => 'year-long',
		'data_field_2'  => 'home-town',
		'data_field_3'  => 'last-school',
		);

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:

	
$defaults = array(
	        'sp_show_title'	        => 1,
		'sp_content_title'      => __( 'Player Bio', 'team-rosters' ),
		
		'sp_use_team_colors'	=> 0,
		
		'sp_image_width'	=> 150,
		'sp_image_height'	=> 150,

		);

Note: Please do not use the image width and height options. They will likely be removed in a future release.

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]