Simple Membership Plugin › Forums › Simple Membership Plugin › Updating failed when save [swpm_show_member_info column=”expiry_date”]
- This topic has 2 replies, 2 voices, and was last updated 2 years, 9 months ago by
moyer.
-
AuthorPosts
-
November 11, 2023 at 11:32 am #27383
moyer
ParticipantHi,
Function: [swpm_show_member_info column=”expiry_date”]
Issue: “Updating failed” in header with red bar when click update button. But it works well in frontend page.
Same message occurs in shortcode block, classic editor block, code block.
Question: what is wrong?November 12, 2023 at 11:31 pm #27384The Assurer
ModeratorWhat exactly do you mean by “on the backend” as opposed to the frontend? Can you provide any screenshots, of how you are using the shortcode and the resulting error; or lack of?
November 13, 2023 at 2:56 am #27388moyer
ParticipantHi,
Thank you for quick reply. I cleared the issue with ‘WebTask With Hassan’ youtube channel as well as chatGPT’s hands.1. remove the profile page including the shortcode
2. create custom tab in my account of woocommerce.
3. insert the profile info shortcodesHere is the code from GPT:
// 1. Register new endpoint (URL) for My Account page
// Note: Re-save Permalinks or it will give 404 error
function wtwh_add_custom_tab_endpoint() {
add_rewrite_endpoint( ‘membership’, EP_ROOT | EP_PAGES );
}add_action( ‘init’, ‘wtwh_add_custom_tab_endpoint’ );
// 2. Add new query var
function wtwh_add_custom_tab_query_vars( $vars ) {
$vars[] = ‘membership’;
return $vars;
}add_filter( ‘query_vars’, ‘wtwh_add_custom_tab_query_vars’, 0 );
// 3. Insert the new endpoint into the My Account menu
function wtwh_add_custom_tab_link_my_account( $items ) {
$items[‘membership’] = ‘멤버십’; // 한글 타이틀
return $items;
}add_filter( ‘woocommerce_account_menu_items’, ‘wtwh_add_custom_tab_link_my_account’ );
// 4. Add content to the new tab
function wtwh_add_custom_tab_content() {
echo ‘<h3>멤버십</h3>’;
echo ‘<p>사용자명: ‘ . do_shortcode(‘[swpm_show_member_info column=”user_name”]’) . ‘</p>’;
echo ‘<p>성: ‘ . do_shortcode(‘[swpm_show_member_info column=”last_name”]’) . ‘</p>’;
echo ‘<p>이름: ‘ . do_shortcode(‘[swpm_show_member_info column=”first_name”]’) . ‘</p>’;
echo ‘<p>이메일주소: ‘ . do_shortcode(‘[swpm_show_member_info column=”email”]’) . ‘</p>’;
echo ‘<p>멤버십 그룹명: ‘ . do_shortcode(‘[swpm_show_member_info column=”membership_level_name”]’) . ‘</p>’;
echo ‘<p>멤버십 현황: ‘ . do_shortcode(‘[swpm_show_member_info column=”account_state”]’) . ‘</p>’;
echo ‘<p>멤버십 시작일: ‘ . do_shortcode(‘[swpm_show_member_info column=”member_since”]’) . ‘</p>’;
echo ‘<p>멤버십 종료일: ‘ . do_shortcode(‘[swpm_show_member_info column=”expiry_date”]’) . ‘</p>’;
}add_action( ‘woocommerce_account_membership_endpoint’, ‘wtwh_add_custom_tab_content’ );
-
AuthorPosts
- You must be logged in to reply to this topic.