Last active
June 3, 2021 19:12
-
-
Save rickalday/eb988fbb9fb65e7ba055d65f3fd09592 to your computer and use it in GitHub Desktop.
GiveWP donation confirmation, donation history, and failed donation pages based on language - Polylang version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function give_get_success_page_uri_with_language() { | |
$give_options = give_get_settings(); | |
$page_id = $give_options['success_page']; | |
if (function_exists('pll_get_post')): | |
$page_id = pll_get_post($page_id); | |
endif; | |
$success_page = isset( $page_id ) ? get_permalink( absint( $page_id ) ) : get_bloginfo( 'url' ); | |
return $success_page; | |
} | |
add_filter('give_get_success_page_uri', 'give_get_success_page_uri_with_language', 10, 1); | |
function give_get_failed_page_uri_with_language() { | |
$give_options = give_get_settings(); | |
$page_id = $give_options['failure_page']; | |
if (function_exists('pll_get_post')): | |
$page_id = pll_get_post($page_id); | |
endif; | |
$success_page = isset( $page_id ) ? get_permalink( absint( $page_id ) ) : get_bloginfo( 'url' ); | |
return $success_page; | |
} | |
add_filter('give_get_failed_transaction_uri', 'give_get_failed_page_uri_with_language', 10, 1); | |
function give_get_donation_history_page_uri_with_language() { | |
$give_options = give_get_settings(); | |
$page_id = $give_options['history_page']; | |
if (function_exists('pll_get_post')): | |
$page_id = pll_get_post($page_id); | |
endif; | |
$success_page = isset( $page_id ) ? get_permalink( absint( $page_id ) ) : get_bloginfo( 'url' ); | |
return $success_page; | |
} | |
add_filter('give_get_history_page_uri', 'give_get_donation_history_page_uri_with_language', 10, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment