diff --git a/includes/admin/post-types/class-sp-admin-meta-boxes.php b/includes/admin/post-types/class-sp-admin-meta-boxes.php index a796e73c..6cce6da2 100644 --- a/includes/admin/post-types/class-sp-admin-meta-boxes.php +++ b/includes/admin/post-types/class-sp-admin-meta-boxes.php @@ -165,6 +165,13 @@ class SP_Admin_Meta_Boxes { 'context' => 'normal', 'priority' => 'low', ), + 'staff' => array( + 'title' => __( 'Staff', 'sportspress' ), + 'save' => 'SP_Meta_Box_Team_Staff::save', + 'output' => 'SP_Meta_Box_Team_Staff::output', + 'context' => 'normal', + 'priority' => 'high', + ), ), 'sp_player' => array( 'shortcode' => array( diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php new file mode 100644 index 00000000..0f42b999 --- /dev/null +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-team-staff.php @@ -0,0 +1,116 @@ +staff( true ); + self::table( $data, $checked ); + + else: + + printf( __( 'No results found.', 'sportspress' ) ); + + endif; + } + + /** + * Save meta box data + */ + public static function save( $post_id, $post ) { + sp_update_post_meta_recursive( $post_id, 'sp_staff', sp_array_value( $_POST, 'sp_staff', array() ) ); + } + + /** + * Admin edit table + */ + public static function table( $data = array(), $checked = array() ) { + ?> +
| + | + + | ++ + | ++ + | ++ + | +
|---|---|---|---|---|
| + ID, $checked ) ); ?>> + | ++ + post_title; ?> + + | +ID, 'sp_role' ) ? the_terms( $staff->ID, 'sp_role' ) : '—'; ?> | +ID, 'sp_league' ) ? the_terms( $staff->ID, 'sp_league' ) : '—'; ?> | +ID, 'sp_season' ) ? the_terms( $staff->ID, 'sp_season' ) : '—'; ?> | +
| + + | +||||
| + + | +||||