Fix: Warnings about "Undefined variable: count" and "Trying to get property 'publish' of non-object"

This commit is contained in:
savvasha
2019-04-11 13:56:43 +03:00
parent 732fe4a777
commit 81b4f0143b

View File

@@ -65,9 +65,7 @@ class SP_Meta_Box_Outcome_Details extends SP_Meta_Box_Config {
'=' => sprintf( __( 'Equal %s', 'sportspress' ), $label ),
'else' => sprintf( __( 'Default', 'sportspress' ), $label ),
);
for( $i = 1; $i <= $count->publish; $i++ ):
$options[ $i ] = $i;
endfor;
foreach ( $options as $key => $value ):
printf( '<option value="%s" %s>%s</option>', $key, selected( true, $key == $condition, false ), $value );
endforeach;