Thread Starter
Boris
(@boris-paing)
Never mind ; I found how to do that by editing files contained in:
/wp-content/plugins/learnpress/inc/custom-post-types
and using the following tutorials:
- FR : https://capitainewp.io/formations/wordpress-creer-blocs-gutenberg/gutenberg-custom-post-type/
- EN : https://www.youtube.com/watch?v=nS4sNBOkFvw
@boris-paing Wow!!! It’s wonderful Menu!!
-
This reply was modified 7 years, 6 months ago by
Electra.
Thread Starter
Boris
(@boris-paing)
@electra > Uhm?
Further notes : add this in your child theme’s functions.php file :
add_filter('register_post_type_args', 'learnpress_cpt_add_gutenberg_support', 10, 2);
function learnpress_cpt_add_gutenberg_support ($args, $post_type)
{
if (in_array($post_type, array('courses', 'lessons'))
{
$args['show_in_rest'] = true;
}
return $args;
}
Thread Starter
Boris
(@boris-paing)
EDIT :
add_filter('register_post_type_args', 'learnpress_cpt_add_gutenberg_support', 10, 2);
function learnpress_cpt_add_gutenberg_support ($args, $post_type)
{
if (in_array($post_type, array(
// 'lp_course',
'lp_lesson',
))){
$args['show_in_rest'] = true;
}
return $args;
}
-
This reply was modified 7 years, 6 months ago by
Boris.
Would be great if this was added in the update for LearnPress. Gutenberg is such a great editing experience.