Advertisement
Guest User

Untitled

a guest
Oct 8th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. if( is_wc_endpoint('my-endpoint-1') ) {
  2. echo "My Endpoint #1";
  3. }
  4. if( is_wc_endpoint('my-endpoint-2') ) {
  5. echo "My Endpoint #2";
  6. }
  7.  
  8. $endpoint = WC()->query->get_current_endpoint();
  9. if( 'my-endpoint-1' === $endpoint ) ) {
  10. echo "My Endpoint #1";
  11. }
  12. if( 'my-endpoint-2' === $endpoint ) ) {
  13. echo "My Endpoint #2";
  14. }
  15.  
  16. function add_my_account_endpoints() {
  17. add_rewrite_endpoint( 'properties', EP_ROOT | EP_PAGES );
  18. add_rewrite_endpoint( 'inbox', EP_ROOT | EP_PAGES );
  19. add_rewrite_endpoint( 'help', EP_ROOT | EP_PAGES );
  20. add_rewrite_endpoint( 'submit-ticket', EP_ROOT | EP_PAGES );
  21. }
  22. add_action( 'init', 'add_my_account_endpoints' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement