Skip to content

Commit

Permalink
Compatibility conditional for Markdown disable
Browse files Browse the repository at this point in the history
  • Loading branch information
nuzzio committed May 14, 2018
1 parent 6bd626a commit 22709a5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/plugin-compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
*/
function gutenberg_remove_wpcom_markdown_support( $post ) {
if ( class_exists( 'WPCom_Markdown' ) && gutenberg_content_has_blocks( $post['post_content'] ) ) {
WPCom_Markdown::get_instance()->unload_markdown_for_posts();
if(
! isset(WPCom_Markdown::$is_gutenberg_compatible) ||
WPCom_Markdown::$is_gutenberg_compatible !== true
) {
WPCom_Markdown::get_instance()->unload_markdown_for_posts();
}
}
return $post;
}
// add_filter( 'wp_insert_post_data', 'gutenberg_remove_wpcom_markdown_support', 9 ); tmp fix.
add_filter( 'wp_insert_post_data', 'gutenberg_remove_wpcom_markdown_support', 9 );

0 comments on commit 22709a5

Please sign in to comment.