wc_page_endpoint_title()WC 1.0

Replace a page title with the endpoint title.

Хуков нет.

Возвращает

Строку.

Использование

wc_page_endpoint_title( $title );
$title(строка) (обязательный)
Post title.

Код wc_page_endpoint_title() WC 8.7.0

function wc_page_endpoint_title( $title ) {
	global $wp_query;

	if ( ! is_null( $wp_query ) && ! is_admin() && is_main_query() && in_the_loop() && is_page() && is_wc_endpoint_url() ) {
		$endpoint       = WC()->query->get_current_endpoint();
		$action         = isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : '';
		$endpoint_title = WC()->query->get_endpoint_title( $endpoint, $action );
		$title          = $endpoint_title ? $endpoint_title : $title;

		remove_filter( 'the_title', 'wc_page_endpoint_title' );
	}

	return $title;
}