We made the tabs filterable in GP 2.1, which is available for testing here: https://github.com/tomusborne/generatepress/issues/63
You can add a tab like this:
add_filter( 'generate_metabox_tabs', 'tu_add_metabox_tabs' );
function tu_add_metabox_tabs( $tabs ) {
$tabs['my_tab'] = array(
'title' => esc_html__( 'My Tab', 'generatepress' ),
'target' => '#my-target-div',
'class' => '',
);
}
Then you’d have to add your options div:
add_action( 'generate_layout_meta_box_content', 'tu_add_metabox_div' );
function tu_add_metabox_div( $stored_meta ) {
// $stored_meta is the meta values for the current post.
?>
<div id="my-target-div" style="display: none;">
Your options in here
</div>
<?php
}
Then you can hook into save_post
to save your values, or use this:
add_action( 'generate_layout_meta_box_save', 'tu_save_custom_metabox' );
function tu_save_custom_metabox( $post_id ) {
// Save your custom meta
}
Hope this helps!