Aurangajeb

Add new Post Type (Product & Event) on WPUF Account page

Nov 5th, 2019
612
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1. //Add new menu on WPUF Account page
  2.  
  3. //Add a new post type (Event) on the WPUF Account page start
  4.  
  5. add_filter( 'wpuf_account_sections', 'wpuf_my_event_page' );
  6.  
  7. function wpuf_my_event_page( $sections ) {
  8. $sections = array_merge( $sections, array( array( 'slug' => 'event', 'label' => 'Events' ) ) );
  9.  
  10. return $sections;
  11. }
  12.  
  13. add_action( 'wpuf_account_content_event', 'wpuf_my_event_page_section', 10, 2 );
  14.  
  15. function wpuf_my_event_page_section( $sections, $current_section ) {
  16.  
  17.  echo do_shortcode('[wpuf_dashboard post_type="tribe_events"]');
  18.  
  19. }
  20. //Add a new post type (Event) on the WPUF Account page End
  21.  
  22. //Add a new post type (Product) on the WPUF Account page start
  23.  
  24. add_filter( 'wpuf_account_sections', 'wpuf_my_product_page' );
  25.  
  26. function wpuf_my_product_page( $sections ) {
  27. $sections = array_merge( $sections, array( array( 'slug' => 'product', 'label' => 'Products' ) ) );
  28.  
  29. return $sections;
  30. }
  31.  
  32. add_action( 'wpuf_account_content_product', 'wpuf_my_product_section', 10, 3 );
  33.  
  34. function wpuf_my_product_section( $sections, $current_section ) {
  35.  
  36.  echo do_shortcode('[wpuf_dashboard post_type="product"]');
  37.  
  38. }
  39. //Add a new post type (Product) on the WPUF Account page End
Advertisement
Add Comment
Please, Sign In to add comment