Php Woocommerce-如何在我的帐户区域的我自己的自定义页面上保留我自己的自定义表单?
我发现很多教程解释了如何在MyAccount区域创建自定义选项卡。使用它,我在我的帐户中创建了我的自定义页面 但是,在互联网上研究了几个小时后,我没有找到一个解决方案来对这个定制页面进行CRUD 对不起,我是一个设计师,想做一些编码。(但正在努力!) 你能救我吗 “我的自定义”选项卡(第页)的代码为:Php Woocommerce-如何在我的帐户区域的我自己的自定义页面上保留我自己的自定义表单?,php,woocommerce,crud,Php,Woocommerce,Crud,我发现很多教程解释了如何在MyAccount区域创建自定义选项卡。使用它,我在我的帐户中创建了我的自定义页面 但是,在互联网上研究了几个小时后,我没有找到一个解决方案来对这个定制页面进行CRUD 对不起,我是一个设计师,想做一些编码。(但正在努力!) 你能救我吗 “我的自定义”选项卡(第页)的代码为: add_action( 'init', 'my_account_new_endpoints' ); function my_account_new_endpoints() { add_rew
add_action( 'init', 'my_account_new_endpoints' );
function my_account_new_endpoints() {
add_rewrite_endpoint( 'fit', EP_ROOT | EP_PAGES );
add_rewrite_endpoint( 'services', EP_ROOT | EP_PAGES );
}
add_action( 'woocommerce_account_fit_endpoint', 'fit_endpoint_content' );
function fit_endpoint_content() {
// Into this page I have my own form
get_template_part('page-templates/my-account-fit');
}
add_action( 'woocommerce_account_services_endpoint', 'services_endpoint_content' );
function services_endpoint_content(){
get_template_part('page-templates/my-account-services');
}
add_filter ( 'woocommerce_account_menu_items', 'my_account_menu_order' );
function my_account_menu_order(){
$menuOrder = array(
'dashboard' => __( 'Dashboard', 'woocommerce' ),
'orders' => __( 'Orders', 'woocommerce' ),
'fit' => __( 'Fit', 'woocommerce' ),
'services' => __( 'Services', 'woocommerce' ),
'edit-address' => __( 'Addresses', 'woocommerce' ),
'edit-account' => __( 'Details', 'woocommerce' ),
'support' => __( 'Support', 'woocommerce' ),
'customer-logout' => __( 'Exit', 'woocommerce' ),
);
return $menuOrder;
}
add_filter("woocommerce_get_query_vars", function ($vars) {
foreach (["support", "services", "fit"] as $e) {
$vars[$e] = $e;
}
return $vars;
});