Support » Plugin: SportsPress - Sports Club & League Manager » Player stats don’t show when displaying Offense->Defense

  • Player stats entered into events won’t show up if:

    1) You separate stats into offensive stats (like Goals / Assists) and defensive stats (like Shots Against / Goals Against).
    2) Players are configured to group stats by Offense -> Defense.
    3) Events are configured to group stats by Combined.

    When players are configured to group stats by Offense -> Defense, this code runs:

    if ( -1 !== $section ):
    	$args['meta_query'][] = array(
    		'key' => ( 1 === $section ? 'sp_defense' : 'sp_offense' ),
    		'value' => $this->ID
    	);
    endif;

    However, because events are configured to group stats by Combined, there are no metadata entries for “sp_offense” or “sp_defense”. This means everything is filtered out, and stats entered into games simply won’t display for your player. Stats entered manually into the player still display properly.

    Ideally I would also display events by Offense -> Defense, but I’m running into other bugs that make that difficult (and that’s a separate post anyway).

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.