Advertisement
wpgenie

custom woocommerce my account endpoint with WSA shortcode

May 28th, 2018
747
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. /*
  2. After adding code to functions.php go to Settings -> Permalinks and save permalinks
  3. */
  4. function wsawoo_myauctionsend_endpoint() {
  5.     add_rewrite_endpoint( 'myauctionsend', EP_ROOT | EP_PAGES );
  6.   }
  7.    
  8. add_action( 'init', 'wsawoo_myauctionsend_endpoint' );
  9. add_filter( 'woocommerce_account_menu_items', 'wsawoo_new_menu_items' );
  10.  
  11. function wsawoo_new_menu_items( $items ) {
  12.     $items[ 'myauctionsend' ] = __( 'My Auctions', 'wsawoo' );
  13.     return $items;
  14. }
  15.  
  16. add_action( 'woocommerce_account_myauctionsend_endpoint', 'wsawoo_endpoint_content' );
  17.  
  18. function wsawoo_endpoint_content() {
  19.     //content goes here
  20.     echo do_shortcode ('[woocommerce_simple_auctions_my_auctions]');
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement