Yes, I’m about to add some more fields to the custom post type so I can display each fund as a page with a featured image, and display that image as a thumbnail when a fund is selected, plus the post_excerpt. BTW for possible use by others, here is my code so far. It allows the post ID of the fund to be passed as a GET parameter so the form opens with the fund already selected:
add_filter( 'seamless_donations_form_donation_section', function( $donation_section ){
...
$fund = intval( filter_input(INPUT_GET, 'fund', FILTER_SANITIZE_NUMBER_INT ) );
if( $fund ) $donation_section = set_designated_fund( $donation_section, $fund );
...
function set_designated_fund( $donation_section, $fund ){
$funds = $donation_section['funds_section']['elements']['_dgx_donate_designated_fund']['options'];
foreach( $funds as $post_id => $title ) {
if( $post_id === $fund ) {
$donation_section['elements']['_dgx_donate_designated']['select'] = 1;
unset( $donation_section['funds_section']['elements']['designated_fund_label']['cloak'] );
unset( $donation_section['funds_section']['elements']['_dgx_donate_designated_fund']['cloak'] );
$donation_section['funds_section']['elements']['_dgx_donate_designated_fund']['value'] = $fund;
unset( $donation_section['repeating_section'] );
unset( $donation_section['elements']['regular_intro'] );
}
}
return $donation_section;
}
Note that I’ve removed the repeating donations when a fund is preselected. That makes sense for our use-case but if I leave the repeating donations enabled their heading is misplaced, it places above the funds section while the checkbox for repeating donations is placed below the funds section. This relates to a different bug you have on your list. What is puzzling me is that that heading: “Optional — regular giving:” doesn’t appear in function seamless_donations_get_donation_section
which makes it impossible to force it to appear in the right place.