28 lines
818 B
PHP
28 lines
818 B
PHP
<?php
|
|
function sp_table_cpt_init() {
|
|
$name = __( 'Tables', 'sportspress' );
|
|
$singular_name = __( 'Table', 'sportspress' );
|
|
$labels = sp_get_cpt_labels( $name, $singular_name );
|
|
$args = array(
|
|
'label' => $name,
|
|
'labels' => $labels,
|
|
'public' => true,
|
|
'hierarchical' => false,
|
|
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes' ),
|
|
'rewrite' => array( 'slug' => 'table' )
|
|
);
|
|
register_post_type( 'sp_table', $args );
|
|
}
|
|
add_action( 'init', 'sp_table_cpt_init' );
|
|
|
|
function sp_table_edit_columns() {
|
|
$columns = array(
|
|
'cb' => '<input type="checkbox" />',
|
|
'title' => __( 'Title' ),
|
|
'sp_team' => __( 'Teams', 'sportspress' ),
|
|
'sp_league' => __( 'Leagues', 'sportspress' ),
|
|
);
|
|
return $columns;
|
|
}
|
|
add_filter( 'manage_edit-sp_table_columns', 'sp_table_edit_columns' );
|
|
?>
|