Skip to content

Commit

Permalink
feat: add filter to the lists in the reg block (#2611)
Browse files Browse the repository at this point in the history
* feat: add filter to the lists in the reg block

* Update includes/reader-activation/class-reader-activation.php

Co-authored-by: Miguel Peixe <[email protected]>

---------

Co-authored-by: Miguel Peixe <[email protected]>
  • Loading branch information
leogermani and miguelpeixe authored Aug 21, 2023
1 parent 9ac1c33 commit d960541
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions includes/reader-activation/class-reader-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,13 @@ public static function render_subscription_lists_inputs( $lists = [], $checked =
$lists = \Newspack_Newsletters_Subscription::get_lists_config();
}

/**
* Filter the available newsletter subscription lists in the Registration form.
*
* @param array[] $lists List config keyed by their ID.
*/
$lists = apply_filters( 'newspack_auth_form_newsletters_lists', $lists );

if ( empty( $lists ) || is_wp_error( $lists ) ) {
return;
}
Expand Down

0 comments on commit d960541

Please sign in to comment.