Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Woocommerce Changing the Entry Title of the Custom Endpoint

<?php
/*
 * Change the entry title of the endpoints that appear in My Account Page - WooCommerce 2.6
 * Using the_title filter
 */

function wpb_woo_endpoint_title( $title, $id ) {

	if ( is_wc_endpoint_url( 'downloads' ) && in_the_loop() ) { // add your endpoint urls
		$title = "Download MP3s"; // change your entry-title
	}

	elseif ( is_wc_endpoint_url( 'orders' ) && in_the_loop() ) {
		$title = "My Orders";
	}

	elseif ( is_wc_endpoint_url( 'edit-account' ) && in_the_loop() ) {
		$title = "Change My Details";
	}
	return $title;
}

add_filter( 'the_title', 'wpb_woo_endpoint_title', 10, 2 );
Source by wpbeaches.com #
 
PREVIOUS NEXT
Tagged: #Woocommerce #Changing #Entry #Title #Custom #Endpoint
ADD COMMENT
Topic
Name
6+2 =