-
-
Save wpmarmite/c49d65884d0832d276c32f5608edb574 to your computer and use it in GitHub Desktop.
Activer Gutenberg pour un CPT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('register_post_type_args', 'ajout_gut_cpt', 10, 2); | |
function ajout_gut_cpt($args, $post_type){ | |
if ($post_type == 'mon_cpt'){ | |
// Reprendre la liste des éléments et ajouter editor | |
$args['show_in_rest'] = true; | |
// Reprendre la liste des éléments et ajouter editor | |
$args['supports'] = array('title', 'thumbnail', 'editor'); | |
} | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
merci pour l' info