Aurangajeb

Add additional post form on the wpuf account page

Apr 16th, 2020 (edited)
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. /* Insert this snippet in your wp-content/theme/child-themes/functions.php file. to allow additional post form in the account page*/
  2.  
  3. add_filter( 'wpuf_account_sections', 'add_new_post_form_in_my_account' );
  4.  
  5. function add_new_post_form_in_my_account( $sections ) {
  6.  
  7. $sections = array_merge( $sections, array( array( 'slug' => 'add-product-form', 'label' => 'Add Product' ) ) );
  8.  
  9. return $sections;
  10. }
  11.  
  12.  
  13. add_action( 'wpuf_account_content_add-product-form', 'wpuf_product_page_section', 10, 3 );
  14.  
  15. function wpuf_product_page_section( $sections, $current_section ) {
  16.  
  17.  echo do_shortcode('[wpuf_form id="2564"]'); /* Use your (http://prntscr.com/10jx9tc) post form's shortcode which you want to render on the My Account page*/
  18.  
  19. }
Add Comment
Please, Sign In to add comment