New Account tab with shortcode
-
Hi,
I’ve created a new tab in the account page and I want to display content of a shortcode. The shortcode has a form and should publish a post after submit.
The form is displayed correctly, but when I submit, I get an error message.
How can I solve this?/* add new tab called "mytab" */ add_filter('um_account_page_default_tabs_hook', 'my_custom_tab_in_um', 100 ); function my_custom_tab_in_um( $tabs ) { $tabs[800]['mytab']['icon'] = 'um-faicon-pencil'; $tabs[800]['mytab']['title'] = 'My Custom Tab'; $tabs[800]['mytab']['custom'] = true; $tabs[800]['mytab']['show_button'] = false; return $tabs; } /* make our new tab hookable */ add_action('um_account_tab__mytab', 'um_account_tab__mytab'); function um_account_tab__mytab( $info ) { global $ultimatemember; extract( $info ); $output = $ultimatemember->account->get_tab_output('mytab'); if ( $output ) { echo $output; } } /* Finally we add some content in the tab */ add_filter('um_account_content_hook_mytab', 'um_account_content_hook_mytab'); function um_account_content_hook_mytab( $output ){ ob_start(); ?> <div class="um-field"> <!-- Here goes your custom content --> <h1>Hi</h1> <?php echo do_shortcode( '[wpuf_form id="184"]' ); ?> </div> <?php $output .= ob_get_contents(); ob_end_clean(); return $output; }
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
The topic ‘New Account tab with shortcode’ is closed to new replies.