Dev Resources

  • Home
  • Reference
  • BuddyX Theme
  • Functions
  • Hooks
  • Classes
Filter by type:
Search
Browse: Home / Reference / Functions / wc_edit_address_i18n()

wc_edit_address_i18n( string $id, bool $flip = false )

Get the edit address slug translation.

Contents

  • Description
    • Parameters
    • Return
    • Source
  • Related
    • Used By
  • User Contributed Notes

Description #Description


Parameters #Parameters

$id

(Required) Address ID.

$flip

(Optional) Flip the array to make it possible to retrieve the values ​​from both sides.

Default value: false


Top ↑

Return #Return

(string) Address slug i18n.


Top ↑

Source #Source

File: includes/wc-account-functions.php

function wc_edit_address_i18n( $id, $flip = false ) {
	$slugs = apply_filters(
		'woocommerce_edit_address_slugs',
		array(
			'billing'  => sanitize_title( _x( 'billing', 'edit-address-slug', 'woocommerce' ) ),
			'shipping' => sanitize_title( _x( 'shipping', 'edit-address-slug', 'woocommerce' ) ),
		)
	);

	if ( $flip ) {
		$slugs = array_flip( $slugs );
	}

	if ( ! isset( $slugs[ $id ] ) ) {
		return $id;
	}

	return $slugs[ $id ];
}

Expand full source code Collapse full source code


Top ↑

Related #Related

Top ↑

Used By #Used By

Used By
Used By Description
includes/wc-template-functions.php: woocommerce_account_edit_address()

My Account > Edit address template.

includes/class-wc-form-handler.php: WC_Form_Handler::save_address()

Save and and update a billing or shipping address if the form was submitted through the user account page.

includes/wc-page-functions.php: wc_get_endpoint_url()

Get endpoint URL.


Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

Proudly powered by WordPress