View difference between Paste ID: dkYUuY1s and xK55kmHh
SHOW: | | - or go back to the newest paste.
1-
if( is_wc_endpoint('my-endpoint-1') ) {
1+
if( is_wc_endpoint('my-endpoint-1') ) {
2-
    echo "My Endpoint #1";
2+
    echo "My Endpoint #1";
3-
}
3+
4-
if( is_wc_endpoint('my-endpoint-2') ) {
4+
if( is_wc_endpoint('my-endpoint-2') ) {
5-
    echo "My Endpoint #2";
5+
    echo "My Endpoint #2";
6
}
7
	
8-
$endpoint = WC()->query->get_current_endpoint();
8+
$endpoint = WC()->query->get_current_endpoint();
9-
if( 'my-endpoint-1' === $endpoint ) ) {
9+
if( 'my-endpoint-1' === $endpoint ) ) {
10-
    echo "My Endpoint #1";
10+
    echo "My Endpoint #1";
11-
}
11+
12-
if( 'my-endpoint-2' === $endpoint ) ) {
12+
if( 'my-endpoint-2' === $endpoint ) ) {
13-
    echo "My Endpoint #2";
13+
    echo "My Endpoint #2";
14
}
15
	
16-
function add_my_account_endpoints() {
16+
function add_my_account_endpoints() {
17-
    add_rewrite_endpoint( 'properties', EP_ROOT | EP_PAGES );
17+
    add_rewrite_endpoint( 'properties', EP_ROOT | EP_PAGES );
18-
    add_rewrite_endpoint( 'inbox', EP_ROOT | EP_PAGES );
18+
    add_rewrite_endpoint( 'inbox', EP_ROOT | EP_PAGES );
19-
    add_rewrite_endpoint( 'help', EP_ROOT | EP_PAGES );
19+
    add_rewrite_endpoint( 'help', EP_ROOT | EP_PAGES );
20-
    add_rewrite_endpoint( 'submit-ticket', EP_ROOT | EP_PAGES );
20+
    add_rewrite_endpoint( 'submit-ticket', EP_ROOT | EP_PAGES );
21-
}
21+
22
add_action( 'init', 'add_my_account_endpoints' );