Last active
January 26, 2023 21:05
-
-
Save vishalck/f88a51b6f0c967b71b0343545dbfc159 to your computer and use it in GitHub Desktop.
Change Title of WooCommerce Thank You page
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
<?php | |
add_filter( 'the_title', 'woo_title_order_received', 10, 2 ); | |
function woo_title_order_received( $title, $id ) { | |
if ( function_exists( 'is_order_received_page' ) && | |
is_order_received_page() && get_the_ID() === $id ) { | |
$title = "Thank you for your order! :)"; | |
} | |
return $title; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I pasted the same code and no changes in the order received page. Do we need to change anything in the function? All I did was copy and paste in functions.php. I realized that the id is not fetching and when I removed that condition it is showing multiple times in the page