Change the donate text in Charitable

Change the donate text in Charitable on child sites.

Snippet Type

Execute on Child Sites

Snippet

function charitable_text_switcher( $translations, $text, $domain ) {
    // Changes the "Donate" text in multiple places
    if ( 0 === strpos( $domain, 'charitable' ) && $text == 'Donate' ) {
        return __( 'YOUR TEXT HERE', 'charitable' );
    }

    return $translations;
}

add_filter( 'gettext', 'charitable_text_switcher', 10, 3 );