Fix styles and functions to align with theme
This commit is contained in:
@@ -23,6 +23,9 @@ function sportspress_admin_menu( $position ) {
|
||||
if ( $position ):
|
||||
$menu[ $position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' );
|
||||
endif;
|
||||
|
||||
// Remove "Positions" link from Media submenu
|
||||
unset( $submenu['upload.php'][17] );
|
||||
|
||||
// Remove "Leagues" link from Players submenu
|
||||
unset( $submenu['edit.php?post_type=sp_player'][15] );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
function sportspress_manage_posts_custom_column( $column, $post_id ) {
|
||||
global $post;
|
||||
switch ( $column ):
|
||||
case 'sp_logo':
|
||||
case 'sp_icon':
|
||||
edit_post_link( get_the_post_thumbnail( $post_id, 'sportspress-icon' ), '', '', $post_id );
|
||||
break;
|
||||
case 'sp_position':
|
||||
|
||||
@@ -5,7 +5,7 @@ function sportspress_sanitize_title( $title ) {
|
||||
|
||||
return $title;
|
||||
|
||||
elseif ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic' ) ) ):
|
||||
elseif ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic', 'sp_metric' ) ) ):
|
||||
|
||||
$key = $_POST['sp_key'];
|
||||
|
||||
|
||||
@@ -82,6 +82,25 @@ function sportspress_save_post( $post_id ) {
|
||||
|
||||
break;
|
||||
|
||||
case ( 'sp_metric' ):
|
||||
|
||||
// Update format as string
|
||||
update_post_meta( $post_id, 'sp_format', sportspress_array_value( $_POST, 'sp_format', 'integer' ) );
|
||||
|
||||
// Update precision as integer
|
||||
update_post_meta( $post_id, 'sp_precision', (int) sportspress_array_value( $_POST, 'sp_precision', 1 ) );
|
||||
|
||||
// Update equation as string
|
||||
update_post_meta( $post_id, 'sp_equation', implode( ' ', sportspress_array_value( $_POST, 'sp_equation', array() ) ) );
|
||||
|
||||
// Update sort order as string
|
||||
update_post_meta( $post_id, 'sp_priority', sportspress_array_value( $_POST, 'sp_priority', '0' ) );
|
||||
|
||||
// Update sort order as string
|
||||
update_post_meta( $post_id, 'sp_order', sportspress_array_value( $_POST, 'sp_order', 'DESC' ) );
|
||||
|
||||
break;
|
||||
|
||||
case ( 'sp_result' ):
|
||||
|
||||
// Update format as string
|
||||
@@ -100,6 +119,9 @@ function sportspress_save_post( $post_id ) {
|
||||
// Update player number
|
||||
update_post_meta( $post_id, 'sp_number', sportspress_array_value( $_POST, 'sp_number', '' ) );
|
||||
|
||||
// Update current team
|
||||
update_post_meta( $post_id, 'sp_current_team', sportspress_array_value( $_POST, 'sp_current_team', '' ) );
|
||||
|
||||
// Update nationality
|
||||
update_post_meta( $post_id, 'sp_nationality', sportspress_array_value( $_POST, 'sp_nationality', '' ) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user