Last active
October 13, 2016 07:24
-
-
Save svenl77/b84f3bd8ef4b890cc8bb083557347bca to your computer and use it in GitHub Desktop.
source: http://docs.buddyforms.com/article/309-create-custom-general-settings-tab-for-your-extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// Add the Tab Content | |
// | |
add_action( 'buddyforms_settings_page_tab', 'my_buddyforms_settings_page_tab' ); | |
function my_buddyforms_settings_page_tab(){ | |
?> | |
<div class="metabox-holder"> | |
<div class="postbox"> | |
<h3><span><?php _e( 'LABEL', 'buddyforms' ); ?></span></h3> | |
<div class="inside"> | |
<p><?php _e( 'DESCRIPTION' ); ?></p> | |
<form method="post" enctype="multipart/form-data"> | |
<p> | |
// Form Fields | |
</p> | |
<p> | |
<?php wp_nonce_field( 'buddyforms_INPUT_nonce', 'buddyforms_INPUT_nonce' ); ?> | |
<?php submit_button( __( 'Submit' ), 'secondary', 'submit', false ); ?> | |
</p> | |
</form> | |
</div><!-- .inside --> | |
</div><!-- .postbox --> | |
</div><!-- .metabox-holder --> | |
<?php | |
} | |
// | |
// Add the Tab Navigation Item | |
// | |
add_filter( 'buddyforms_admin_tabs', 'my_buddyforms_admin_tabs' ); | |
function my_buddyforms_admin_tabs($tabs){ | |
$tabs['TAB SLUG'] = 'TAB LABEL'; | |
return $tabs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment