Custom Tab Doesn’t Show Custom Content – Only displays products ?
-
Hi,
This code only shows a “new tab” but does not show the content set in the file store/wcfmmp-view-store-newtab.php
<?php echo "Hello World "; ?>
When clicking the Tab it shows products only ? Can you please help to provide the correct code to render the content in the php file store/wcfmmp-view-store-newtab.php
?add_filter( 'wcfmmp_store_tabs', 'custom_wcfmmp_store_tabs',90,2); function custom_wcfmmp_store_tabs($store_tabs, $vendor_id) { $store_tabs['newtab'] = __( 'NEW Tab', 'wc-multivendor-marketplace' ); return $store_tabs; } add_filter( 'wcfmp_store_default_query_vars', 'wcfm_store_events_default_query_var' ); function wcfm_store_events_default_query_var( $query_var ) { global $WCFM, $WCFMmp; if ( get_query_var( 'newtab' ) ) { $query_var = 'newtab'; } return $query_var; } add_filter( 'wcfmp_store_tabs_url', 'new_wcfmp_store_tabs_url',10,2); function new_wcfmp_store_tabs_url($store_tab_url, $tab) { switch( $tab ) { case 'newtab': $store_tab_url = $store_tab_url.'newtab'; break; } return $store_tab_url; } add_action( 'wcfmmp_rewrite_rules_loaded', 'new_register_rule', 8 ); function new_register_rule($wcfm_store_url) { global $WCFM, $WCFMmp; add_rewrite_rule( $wcfm_store_url.'/([^/]+)/'.$WCFMmp->wcfmmp_rewrite->store_endpoint('newtab').'?$', 'index.php?post_type=product&'.$wcfm_store_url.'=$matches[1]&'.$WCFMmp->wcfmmp_rewrite->store_endpoint('newtab').'=true', 'top' ); add_rewrite_rule( $wcfm_store_url.'/([^/]+)/'.$WCFMmp->wcfmmp_rewrite->store_endpoint('newtab').'/page/?([0-9]{1,})/?$', 'index.php?post_type=product&'.$wcfm_store_url.'=$matches[1]&paged=$matches[2]&'.$WCFMmp->wcfmmp_rewrite->store_endpoint('newtab').'=true', 'top' ); } function wcfm_vendor_profile_custom_endpoint() { global $WCFM, $WCFMmp,$WCFMu; $wcfm_store_url = get_option( 'wcfm_store_url', 'store' ); add_rewrite_endpoint( 'newtab', EP_ROOT | EP_PAGES ); } add_action( 'init', 'wcfm_vendor_profile_custom_endpoint',12 );
- The topic ‘Custom Tab Doesn’t Show Custom Content – Only displays products ?’ is closed to new replies.