Card Suspension

Premium Version Only (since v0.13.7)

Can be used for Suspension Risk (shortcode) or automatic player suspension.

To create a new Card Suspension rule go to the "Competitions" >> "Card Suspension" and click the "Add New" button. On the next step select the competition and save it to continue. 

Create all required Yellow Card rules. The most common case is shown in the image below.

If you plan to automatically suspend players, activate the appropriate field and add a number of games to suspend after getting a red card ban.

How "Automatically Suspend Players" functionality works

Since v0.13.7 when you will manually save the game ("manually" means without API import), the plugin will check if a suspension rule exists for this competition (with automatic suspension).

If YES, the players which had got the yellow card (or any red card) and their number of cards are equal to any "Yellow Card" rule, will be added to the list of Missing Players in the next game. 

Does it also work with coaches?

If a player is suspended until a certain date is it possible to insert the date?

No, only for players.

If a player is suspended until a certain date is it possible to insert the date?

No, at this moment the plugin is able to insert missing players for the next games only.


--

Best Regards

Andrei S.

No, at this moment the plugin is able to insert missing players for the next games only.

Sorry I don't understand

In the italian amateur leagues players can be suspended until a specific date (e.g. until February 20, 2022).

Is it possible to insert the suspension in this way?

In the last game of a competition there have been several players booked. Those are cards that carry suspension as i marked at the beginning of the competition in the Card Suspensions rules.

But I get the following errors depending on the type of suspension:

If the suspension is for the second yellow card during the competition I get this error:

Warning: Undefined array key "missed_players" in C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php on line 517

Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php:517 Stack trace: #0 C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php(517): in_array(2496, NULL, true) #1 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(309): AnWPFL_Premium_Suspension->add_suspension_automatically(Array) #2 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #3 C:\xampp\htdocs\lifax\wp-includes\plugin.php(474): WP_Hook->do_action(Array) #4 C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro\includes\class-anwpfl-match.php(1276): do_action('anwpfl/match/on...', Array, Array) #5 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(309): AnWPFL_Match->save_metabox(2257, Object(WP_Post)) #6 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #7 C:\xampp\htdocs\lifax\wp-includes\plugin.php(474): WP_Hook->do_action(Array) #8 C:\xampp\htdocs\lifax\wp-includes\post.php(4687): do_action('save_post', 2257, Object(WP_Post), true) #9 C:\xampp\htdocs\lifax\wp-includes\post.php(4789): wp_insert_post(Array, false, true) #10 C:\xampp\htdocs\lifax\wp-admin\includes\post.php(426): wp_update_post(Array) #11 C:\xampp\htdocs\lifax\wp-admin\post.php(227): edit_post() #12 {main} thrown in C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php on line 517

If the suspension is due to a double yellow card in the same match (red card), the error is as follows:

Warning: Undefined array key "missed_players" in C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php on line 537

Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php:537 Stack trace: #0 C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php(537): in_array(2488, NULL, true) #1 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(309): AnWPFL_Premium_Suspension->add_suspension_automatically(Array) #2 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #3 C:\xampp\htdocs\lifax\wp-includes\plugin.php(474): WP_Hook->do_action(Array) #4 C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro\includes\class-anwpfl-match.php(1276): do_action('anwpfl/match/on...', Array, Array) #5 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(309): AnWPFL_Match->save_metabox(2257, Object(WP_Post)) #6 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #7 C:\xampp\htdocs\lifax\wp-includes\plugin.php(474): WP_Hook->do_action(Array) #8 C:\xampp\htdocs\lifax\wp-includes\post.php(4687): do_action('save_post', 2257, Object(WP_Post), true) #9 C:\xampp\htdocs\lifax\wp-includes\post.php(4789): wp_insert_post(Array, false, true) #10 C:\xampp\htdocs\lifax\wp-admin\includes\post.php(426): wp_update_post(Array) #11 C:\xampp\htdocs\lifax\wp-admin\post.php(227): edit_post() #12 {main} thrown in C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php on line 537


If the suspension is due to a direct red card in the match, the error is as follows:

Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php:537 Stack trace: #0 C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php(537): in_array(2487, NULL, true) #1 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(309): AnWPFL_Premium_Suspension->add_suspension_automatically(Array) #2 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #3 C:\xampp\htdocs\lifax\wp-includes\plugin.php(474): WP_Hook->do_action(Array) #4 C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro\includes\class-anwpfl-match.php(1276): do_action('anwpfl/match/on...', Array, Array) #5 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(309): AnWPFL_Match->save_metabox(2257, Object(WP_Post)) #6 C:\xampp\htdocs\lifax\wp-includes\class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #7 C:\xampp\htdocs\lifax\wp-includes\plugin.php(474): WP_Hook->do_action(Array) #8 C:\xampp\htdocs\lifax\wp-includes\post.php(4687): do_action('save_post', 2257, Object(WP_Post), true) #9 C:\xampp\htdocs\lifax\wp-includes\post.php(4789): wp_insert_post(Array, false, true) #10 C:\xampp\htdocs\lifax\wp-admin\includes\post.php(426): wp_update_post(Array) #11 C:\xampp\htdocs\lifax\wp-admin\post.php(227): edit_post() #12 {main} thrown in C:\xampp\htdocs\lifax\wp-content\plugins\football-leagues-by-anwppro-premium-premium\includes\class-anwpfl-premium-suspension.php on line 537

Throughout the competition I have not had any errors in any of the cards, and several have led to suspension, which have been correctly reflected in the header of the following match. That's why I think the error occurs as it is the last game of the season.

Please can you hepl me? Don´t know if i´m doing something wrong...

Thanks!!

Hello

Please create a support ticket and attach screenshots of your game events (from the game edit page) and a screenshot of your suspension rules.

https://anwppro.userecho.com/en/knowledge-bases/2/articles/486-how-to-get-support

--

Best Regards

Andrei S.