php - Woocommerce Shortcode for edit and add Shipping Address

I am trying to render a portion of the Woocommerce - My Account section. Specifically the form for editing or adding a Shipping Address (myaccount/form-edit-address.php). By default the Shortcode I created shows the Billing Address. I can't figure out how to pass a variable or specify that I want the Shipping Address part of the code.
This is the Shortcode for the Billing Address:
add_shortcode('edit_address', 'display_myaccount_edit_address');
function display_myaccount_edit_address()
{
return WC_Shortcode_My_Account::edit_address();
}
And I am trying to achieve it doing this (it doesn't work obviously)
add_shortcode('edit_address_shipping', 'display_myaccount_edit_address_shipping');
function display_myaccount_edit_address_shipping()
{
return WC_Shortcode_My_Account::edit_address_shipping($load_address = 'Shipping address');
}
Any idea how to do it? Any help would be pretty much appreciated!
Answer
Solution:
According to the documentation, the key to pass is 'shipping': So the function for shortcode will look like this:
function display_myaccount_edit_address_shipping()
{
return WC_Shortcode_My_Account::edit_address_shipping('shipping');
}
add_shortcode('edit_address_shipping', 'display_myaccount_edit_address_shipping');
https://woocommerce.wp-a2z.org/oik_api/wc_shortcode_my_accountedit_address/
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: script cache:clear returned with error code 255
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.