$name, 'labels' => $labels, 'public' => true, 'hierarchical' => false, 'supports' => array( 'title', 'author' ), 'register_meta_box_cb' => 'sp_list_meta_init', 'rewrite' => array( 'slug' => 'list' ), 'show_in_menu' => 'edit.php?post_type=sp_player' ); register_post_type( 'sp_list', $args ); } add_action( 'init', 'sp_list_cpt_init' ); function sp_list_edit_columns() { $columns = array( 'cb' => '', 'title' => __( 'Title' ), 'sp_player' => __( 'Players', 'sportspress' ), 'sp_team' => __( 'Teams', 'sportspress' ), 'sp_league' => __( 'Leagues', 'sportspress' ) ); return $columns; } add_filter( 'manage_edit-sp_list_columns', 'sp_list_edit_columns' ); function sp_list_meta_init() { add_meta_box( 'sp_playerdiv', __( 'Players', 'sportspress' ), 'sp_list_player_meta', 'sp_list', 'side', 'high' ); add_meta_box( 'sp_statsdiv', __( 'Player List', 'sportspress' ), 'sp_list_stats_meta', 'sp_list', 'normal', 'high' ); } function sp_list_player_meta( $post ) { $league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 ); $team_id = get_post_meta( $post->ID, 'sp_team', true ); ?>
sprintf( __( 'All %s', 'sportspress' ), __( 'Leagues', 'sportspress' ) ), 'taxonomy' => 'sp_league', 'name' => 'sp_league', 'selected' => $league_id ); sp_dropdown_taxonomies( $args ); ?>
sprintf( __( 'All %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ), 'option_none_value' => '0', 'post_type' => 'sp_team', 'name' => 'sp_team', 'selected' => $team_id ); wp_dropdown_pages( $args ); ?>
ID, 'sp_player', 'block', 'sp_team' ); sp_post_adder( 'sp_player' ); ?>