Viewing 1 replies (of 1 total)
  • Plugin Contributor Ben Meredith

    (@benmeredithgmailcom)

    Hi @rizwan14321,

    That snippet actually matured to become our Donor Wall shortcode/block which is included in GiveWP by default now:

    ?For the shortcode/classic editor implementation: https://givewp.com/documentation/core/shortcodes/give_donor_wall/
    ?
    ?For the new block-based editor implementation: https://givewp.com/documentation/core/blocks/donor-wall-block/
    ?
    So my first recommendation would be to check that out. Using it, you could display donations without the name at all, and also display donations where the donor chooses to remain anonymous as “Anonymous” in the list.

    It would also be possible with some additional custom code to hide all letters after the first one, Using something like this in the foreach loop on this line: https://github.com/impress-org/givewp-snippet-library/blob/d1e626b0537515cd7d7cca6c5efeaeb20c0b6a70/useful-queries/better-donor-list-shortcode.php#L99

    
    foreach ( $payments as $payment ) :
    				/* @var $payment \Give_Payment */
    				$parts = $payment->get_meta( '_give_donor_billing_first_name', true );
    				$first_name = substr($parts, 0, min(1, strlen($parts))) . str_repeat('*', max(1, strlen($parts)));
    				$last_name = $payment->get_meta( '_give_donor_billing_last_name', true );
    
    				$total  = give_donation_amount( $payment->ID, array( 'currency' => true ) );
    				$avatar = get_avatar( $payment->email, 64 );
    				?>
                    <li>
                        <div class="my-give-donorwall-donor">
                            <span class="my-give-donorwall-avatar"><?php echo $avatar; ?></span>
                            <span class="my-give-donorwall-name"><?php echo esc_html( $first_name . ' ' . $last_name ); ?></span> <span
                                    class="my-give-donorwall-total"><?php echo $total;
    							?></span>
                        </div>
                    </li>
    			<?php endforeach; ?>
    

    I have NOT tested that code, but it should be something like that.

Viewing 1 replies (of 1 total)
  • The topic ‘Need Donor List with *** in there names’ is closed to new replies.