开发者 |
tsunoa
rubengc |
---|---|
更新时间 | 2017年6月2日 00:21 |
捐献地址: | 去捐款 |
PHP版本: | 4.0 及以上 |
WordPress版本: | 4.8 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
wp-content/plugins/
folder locallywp-admin/plugins.php
on your site (your WP Admin plugin page)First of all you need add a filter to changes how tabs are rendered, and at this point you could add, change or move tabs.
This is the structure for a tab:
$tab = array( 'tab-identifier' => array( 'label' => 'My tab', 'selectors' => array( '#my-element', '.group-of-elements', ) ) );
This is an example of tab customization:
`function custom_checkout_tabs( $tabs ) {
// Adding a meta box to general tab
$tabs['overview']['selectors'][] = '#my-element';
// Moving a tab
$temp_tab = $tabs['address'];
unset($tabs['address']);
$tabs['address'] = $temp_tab;
// Removing a tab
unset($tabs['account']);
return $tabs;
}
add_filter( 'edd_checkout_wizard_checkout_tabs', 'custom_checkout_tabs');`
Note: Elements that are not in a tab will be kept always visible