Ich habe den Titel allen Seiten des Kontos mit dem folgenden Code hinzugefügt:
add_filter( 'the_title', 'wc_page_endpoint_title' );
the_title( '<h2>', '</h2>' );
Weg: plugins/woocommerce/templates/myaccount/my-account.php
<?php
/**
* My Account page
*
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/my-account.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce\Templates
* @version 3.5.0
*/
defined( 'ABSPATH' ) || exit;
/**
* My Account navigation.
*
* @since 2.6.0
*/
do_action( 'woocommerce_account_navigation' ); ?>
<div class="woocommerce-MyAccount-content">
<?php
add_filter( 'the_title', 'wc_page_endpoint_title' );
the_title( '<h2>', '</h2>' );
?>
<?php
/**
* My Account content.
*
* @since 2.6.0
*/
do_action( 'woocommerce_account_content' );
?>
</div>
Ich habe auch die URL der Bestellseite mit der folgenden URL geändert:
Ändern Sie die URL/den Endpunkt „view-order/order-id“ in WooCommerce Mein Konto – Bestellungen in „orders/order-id“
-
Titel Vor die Änderungs-URL-Bestellseite: Bestellnummer (Bestell-ID)
-
Titel nach die Änderungs-URL-Bestellseite: Bestellungen
Ich möchte, dass es genauso ist wie Vor
Der folgende Code funktioniert auch nicht:
function filter_woocommerce_endpoint_view_order_title( $title, $endpoint, $action ) {
$title = __( 'test', 'woocommerce' );
return $title;
}
add_filter( 'woocommerce_endpoint_view-order_title', 'filter_woocommerce_endpoint_view_order_title', 10, 3 );