Skip to content

Conversation

@vovafeldman
Copy link

We added the following code to the functions.php of our theme to only add the editor for docs CPT:

    function update_supported_markdown_posts() {
        add_post_type_support( 'docs', WPCom_Markdown::POST_TYPE_SUPPORT );

        remove_post_type_support( 'post', WPCom_Markdown::POST_TYPE_SUPPORT );
        remove_post_type_support( 'page', WPCom_Markdown::POST_TYPE_SUPPORT );
    }

    add_action( 'init', 'update_supported_markdown_posts', 9999 );

Without the code modifications, the editor is triggered in all posts and pages.

…nly in the supported post types. The relevant use case is that we are using markdown only for our documentation section ('docs' CPT), and we want to keep the rich editor for our pages/posts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant