Skip to content

Instantly share code, notes, and snippets.

@doekenorg
Created December 16, 2019 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doekenorg/d8561e2c9a4fb3c4a90cd6987d2c4cca to your computer and use it in GitHub Desktop.
Save doekenorg/d8561e2c9a4fb3c4a90cd6987d2c4cca to your computer and use it in GitHub Desktop.
wp-pay-extension unselect choices filter
<?php
//...
$unselect_choices = gf_apply_filters(
[
'pronamic_pay_unselect_choices',
$form_id,
$this->id
],
!$page || ('form_editor' !== $page && false === strpos($page, 'form_settings')),
$page
);
if ($unselect_choices) {
$choices = array_filter($choices, array($this, 'filter_choice_is_selected'));
$choices = array_map(array($this, 'unselect_choice'), $choices);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment