Skip to content

Instantly share code, notes, and snippets.

@Asikur22
Created February 6, 2024 19:29
Show Gist options
  • Save Asikur22/bd54e956a8508f1cd852c2597f5d1c35 to your computer and use it in GitHub Desktop.
Save Asikur22/bd54e956a8508f1cd852c2597f5d1c35 to your computer and use it in GitHub Desktop.
WooCommerce Change My Account Endpoint Document Title
/**
* Filters document title.
*
* @param array $title The document title parts.
*
* @return array
*/
function wp98_endpoint_document_title( $title ) {
if ( is_wc_endpoint_url( 'orders' ) ) {
$title['title'] = __( 'My Order Custom Document Title', 'woocommerce' );
}
return $title;
}
add_filter( 'document_title_parts', 'wp98_endpoint_document_title' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment