Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional actions for tab content #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ Actions & Filters
* `wpsf_do_settings_sections_[option_group]` - Settings form fields HTMLoutput (inside the `<form>`)
* `wpsf_before_tab_links_[option_group]` - Before tabs HTML is output
* `wpsf_after_tab_links_[option_group]` - After tabs HTML is output
* `wpsf_before_tab_content_[option_group]_[tab_id]` - Before the tab content is output (inside the tab)
* `wpsf_after_tab_content_[option_group]_[tab_id]` - After the tab content in output (inside the tab)

Credits
-------
Expand Down
16 changes: 16 additions & 0 deletions wp-settings-framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -1416,9 +1416,25 @@ public function do_tabbed_settings_sections() {
}
?>
">
<?php
/**
* Hook: execute callback before the tab content for a given tab.
*
* @hook wpsf_before_tab_content_<option_group>_<tab_id>
*/
do_action( 'wpsf_before_tab_content_' . sprintf( '%s_%s', $this->option_group, $tab_data['id'] ) );
?>
<div class="postbox">
<?php do_settings_sections( sprintf( '%s_%s', $this->option_group, $tab_data['id'] ) ); ?>
</div>
<?php
/**
* Hook: execute callback after the tab content for a given tab.
*
* @hook wpsf_after_tab_content_<option_group>_<tab_id>
*/
do_action( 'wpsf_after_tab_content_' . sprintf( '%s_%s', $this->option_group, $tab_data['id'] ) );
?>
</div>
<?php
$i ++;
Expand Down