Hello all,
I would like to ask help.
I tried so many solutions but nothing work.
I created a custom tab for WooCommerce (My Profile) name as “Üzleteim”, with CodeSnippets.
Here is the code:
add_action( 'init', 'register_uzleteim_endpoint');
/**
* Register New Endpoint.
*
* @return void.
*/
function register_uzleteim_endpoint() {
add_rewrite_endpoint( 'uzleteim', EP_ROOT | EP_PAGES );
}
add_filter( 'query_vars', 'uzleteim_query_vars' );
/**
* Add new query var.
*
* @param array $vars vars.
*
* @return array An array of items.
*/
function uzleteim_query_vars( $vars ) {
$vars[] = 'uzleteim';
return $vars;
}
add_filter( 'woocommerce_account_menu_items', 'add_uzleteim_tab' );
/**
* Add New tab in my account page.
*
* @param array $items myaccount Items.
*
* @return array Items including New tab.
*/
function add_uzleteim_tab( $items ) {
$items['uzleteim'] = 'Üzleteim';
return $items;
}
add_action( 'woocommerce_account_uzleteim_endpoint', 'add_uzleteim_content' );
/**
* Add content to the new tab.
*
* @return string.
*/
function add_uzleteim_content() {
}
I would like to show here at
function add_uzleteim_content() {
}
some information from user profile. I already added to user profile the information fields.
But I can not display the data on frontend.
The “Kapcsolattartó neve” is “kapcsolattarto_neve”. I tried shortcodes but did not work, and edit in CodeSnippet but there were some error always.
Thank you,
R
Sorry, the picture not work. Here is the link.
Okay. After more than 20 hours I already did it…
😀
Here is the code:
$user_ID = get_current_user_id();
the_field('kapcsolattarto_neve', 'user_'. $user_ID);