Custom endpoint has no navigation
-
Hey there,
we′ve inserted some new ednpoints to the my account section of woocommerce. For some reason, a few of them have no navigation. We used this lines of code to insert them:
function meine_kleinanzeigen_endpoint() {
add_rewrite_endpoint( ‘meine_kleinanzeigen’, EP_ROOT | EP_PAGES );
}
add_action( ‘init’, ‘meine_kleinanzeigen_endpoint’ );
// ——————
// 2. Add new query var
function meine_kleinanzeigen_query_vars( $vars ) {
$vars[] = ‘meine_kleinanzeigen’;
return $vars;
}
add_filter( ‘query_vars’, ‘meine_kleinanzeigen_query_vars’, 0 );
// ——————
// 3. Insert the new endpoint into the My Account menu
function meine_kleinanzeigen_link_my_account( $items ) {
$items[‘meine_kleinanzeigen’] = ‘Meine Kleinanzeigen’;
return $items;
}
add_filter( ‘woocommerce_account_menu_items’, ‘meine_kleinanzeigen_link_my_account’ );
// ——————
// 4. Add content to the new endpoint
function meine_kleinanzeigen_content() {
//echo ‘<h3>Premium WooCommerce Support</h3><p>Welcome to the WooCommerce support area. As a premium customer, you can submit a ticket should you have any WooCommerce issues with your website, snippets or customization. <i>Please contact your theme/plugin developer for theme/plugin-related support.</i></p>’;
echo do_shortcode( ‘ [adverts_manage] ‘ );
}
add_action( ‘woocommerce_account_meine_kleinanzeigen_endpoint’, ‘meine_kleinanzeigen_content’ );
and re-sort the them via this:
function wpb_woo_my_account_order() {
$myorder = array(
‘dashboard’ => __( ‘Dashboard’, ‘woocommerce’ ),
‘orders’ => __( ‘Bestellungen’, ‘woocommerce’ ),
‘mein_stellenangebot’ => __( ‘Meine Stellenangebote’, ‘woocommerce’ ),
‘meine_stellengesuche’ => __( ‘Meine Stellengesuche’, ‘woocommerce’ ),
‘meine_bewerbung’ => __( ‘Bewerbungen’, ‘woocommerce’ ),
‘favoriten’ => __( ‘Favoriten’, ‘woocommerce’ ),
‘stellenalarm’ => __( ‘Stellenalarm’, ‘woocommerce’ ),
‘statistik’ => __( ‘Statistik’, ‘woocommerce’ ),
‘meine_praxisanzeigen’ => __( ‘Meine Praxisanzeigen’, ‘woocommerce’ ),
‘meine_kleinanzeigen’ => __( ‘Meine Kleinanzeigen’, ‘woocommerce’ ),
‘edit-account’ => __( ‘Kontodetails’, ‘woocommerce’ ),
‘customer-logout’ => __( ‘Abmelden’, ‘woocommerce’ ),
);
return $myorder;
}
add_filter ( ‘woocommerce_account_menu_items’, ‘wpb_woo_my_account_order’ );The Endpoints are working, but as I mentioned above, some of them have no no navigation.
Can anyone help`?
- The topic ‘Custom endpoint has no navigation’ is closed to new replies.