admin管理员组文章数量:1420197
I have a custom plugin that is integrated with woocommerce. I want to display listing records in the user's profile and have successfully done so. Creating the end points. refreshing the permalinks. Yet, the call back to drawing the content within the endpoint tab does not appear. Only the dashboard.
function mylistings_account_menu_items( $items )
{
$items['mylistings'] = __( 'Active Listings', 'mylistings' );
return $items;
}
add_filter( 'woocommerce_account_menu_items', 'mylistings_account_menu_items', 10, 1 );
function mylisting_add_my_account_endpoint()
{
add_rewrite_endpoint( 'mylistings', EP_PAGES );
}
add_action( 'init', 'mylisting_add_my_account_endpoint' );
// THIS DOES NOT APPEAR TO BE WORKING WHY?
function mylistings_information_endpoint_content()
{
echo 'THIS IS A TEST OF THE CONTENT';
}
add_action( 'woocommerce_account_information_endpoint', 'mylistings_information_endpoint_content' );
What am I missing?
I have a custom plugin that is integrated with woocommerce. I want to display listing records in the user's profile and have successfully done so. Creating the end points. refreshing the permalinks. Yet, the call back to drawing the content within the endpoint tab does not appear. Only the dashboard.
function mylistings_account_menu_items( $items )
{
$items['mylistings'] = __( 'Active Listings', 'mylistings' );
return $items;
}
add_filter( 'woocommerce_account_menu_items', 'mylistings_account_menu_items', 10, 1 );
function mylisting_add_my_account_endpoint()
{
add_rewrite_endpoint( 'mylistings', EP_PAGES );
}
add_action( 'init', 'mylisting_add_my_account_endpoint' );
// THIS DOES NOT APPEAR TO BE WORKING WHY?
function mylistings_information_endpoint_content()
{
echo 'THIS IS A TEST OF THE CONTENT';
}
add_action( 'woocommerce_account_information_endpoint', 'mylistings_information_endpoint_content' );
What am I missing?
Share Improve this question edited Jul 13, 2019 at 9:34 nmr 4,5672 gold badges17 silver badges25 bronze badges asked Jul 13, 2019 at 2:19 Debbie KurthDebbie Kurth 4323 silver badges14 bronze badges1 Answer
Reset to default 2Dang it...must be blind....FOUND IT. The solution is, that since this is a custom hook, and most likely using JQuery, you place the end point action within the call.
Instead of this:
function mylistings_information_endpoint_content()
{
echo 'THIS IS A TEST OF THE CONTENT';
}
add_action( 'woocommerce_account_information_endpoint', 'mylistings_information_endpoint_content' );
It is this:
function **mylistings**_information_endpoint_content()
{
echo 'THIS IS A TEST OF THE CONTENT';
}
add_action( 'woocommerce_account_**mylistings**_endpoint', 'mylistings_information_endpoint_content' );
本文标签: plugin developmentWooCommerce Endpoints content
版权声明:本文标题:plugin development - WooCommerce Endpoints content 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745325122a2653554.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论