Skip to content

Instantly share code, notes, and snippets.

@zabidxoothemes
Created April 29, 2019 12:12
Show Gist options
  • Save zabidxoothemes/41fb62f3901fedfe7db87fc834e6a812 to your computer and use it in GitHub Desktop.
Save zabidxoothemes/41fb62f3901fedfe7db87fc834e6a812 to your computer and use it in GitHub Desktop.
/**
* Adding custom tab
*/
add_filter( 'learn-press/course-tabs', 'reptro_add_custom_tab' );
function reptro_add_custom_tab( $tabs ){
$tabs['programm_tab'] = array(
'title' => __( 'Programma', 'reptro-child-theme' ),
'priority' => 5,
'callback' => 'reptro_programma_custom_tab_content'
);
unset($tabs['curriculum']);
unset($tabs['instructor']);
return $tabs;
}
if( !function_exists('reptro_programma_custom_tab_content') ){
function reptro_programma_custom_tab_content(){
if( get_the_id() == 4498 ) {
echo 'This content will show only in the Programma tab which ID is 4498.';
}
if( get_the_id() == 4265 ) {
echo 'This content will show only in the Programma tab which ID is 4265.';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment