Snippets

LearnDash LearnDash - Elementor Pro does not recognize post type fix - LEARNDASH-2709

Created by Paul Menard
/**
 * LearnDash - Enable 'show_in_nav_menus' option when registering custom post types. 
 * Elementor Pro uses this to show the post types selector. They should be checking 'public'.
 */
add_filter( 'learndash_post_args', function( $post_args = array() ) { 

	$post_args['sfwd-courses']['cpt_options']['show_in_nav_menus'] = true;
	$post_args['sfwd-lessons']['cpt_options']['show_in_nav_menus'] = true;
	$post_args['sfwd-topic']['cpt_options']['show_in_nav_menus'] = true;
	$post_args['sfwd-quiz']['cpt_options']['show_in_nav_menus'] = true;
	$post_args['sfwd-question']['cpt_options']['show_in_nav_menus'] = true;


	// always return the $post_args array
	return $post_args;
}, 10, 1 );

Comments (0)