PluginProbe
Gutenberg / 4.2.0
Gutenberg v4.2.0
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / lib / plugin-compat.php

plugin-compat.php in Gutenberg 4.2.0, at lib/plugin-compat.php

35 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This file includes a set of temporary fixes for known compatibility
4 * issues with third-party plugins. These fixes likely should not to be
5 * included with core merge.
6 *
7 * @package gutenberg
8 * @since 1.3.0
9 *
10 * The goal is to provide a fix so
11 * 1. users of the plugin can continue to use and test Gutenberg,
12 * 2. provide a reference for developers of the plugin to work with, and
13 * 3. provide reference for other plugin developers on how they might work
14 * with Gutenberg.
15 */
16
17 /**
18 * WPCOM markdown support causes issues when saving a Gutenberg post by
19 * stripping out the <p> tags. This adds a filter prior to saving the post via
20 * REST API to disable markdown support. Disables markdown support provided by
21 * plugins Jetpack, JP-Markdown, and WP Editor.MD
22 *
23 * @since 1.3.0
24 *
25 * @param array $post Post object which contains content to check for block.
26 * @return array $post Post object.
27 */
28 function gutenberg_remove_wpcom_markdown_support( $post ) {
29 if ( class_exists( 'WPCom_Markdown' ) && has_blocks( $post['post_content'] ) ) {
30 WPCom_Markdown::get_instance()->unload_markdown_for_posts();
31 }
32 return $post;
33 }
34 add_filter( 'wp_insert_post_data', 'gutenberg_remove_wpcom_markdown_support', 9 );
35