Begin SportsPress
Add basic helpers, post types and taxonomies.
This commit is contained in:
17
league.php
Normal file
17
league.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
function sp_league_tax_init() {
|
||||
$name = __( 'Leagues', 'sportspress' );
|
||||
$singular_name = __( 'League', 'sportspress' );
|
||||
$object_type = array( 'sp_team', 'sp_event', 'sp_player', 'sp_staff', 'sp_table', 'sp_calendar' );
|
||||
$labels = sp_get_tax_labels( $name, $singular_name );
|
||||
$args = array(
|
||||
'label' => $name,
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'hierarchical' => true,
|
||||
'rewrite' => array( 'slug' => 'league' ),
|
||||
);
|
||||
register_taxonomy( 'sp_league', $object_type, $args );
|
||||
}
|
||||
add_action( 'init', 'sp_league_tax_init' );
|
||||
?>
|
||||
Reference in New Issue
Block a user