Skip to content

Commit

Permalink
Sync/2may2017 markdown (#7107)
Browse files Browse the repository at this point in the history
* Easy Markdown: saving post_content_filtered even for autosaves

There is an issue with autosaves as they can't be properly restored as the post_content_filtered is not being populated for them.

If someone attempts to restore an autosave, they would get an empty texteditor, as the content is being read from post_content_filtered.

Populating and storing the post_content_filtered even for autosaves addresses this issue.

/z 50817

Merges r134728-wpcom.

* Markdown Bug Fixes and Updates. Also, Jetpack_Options plan sync.

This should bring four files into sync with Jetpack's versions. Hurrah!

@see https://[private link]

Merges r148841-wpcom.

* Markdown: add docblock to new filter.

@see #7107
  • Loading branch information
George Stephanis authored and jeherve committed May 24, 2017
1 parent 28ea039 commit edddd6b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/markdown/easy-markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ public function wp_insert_post_data( $post_data, $postarr ) {
$post_data['post_content'] = apply_filters( 'content_save_pre', $post_data['post_content'] );
} elseif ( 0 === strpos( $post_data['post_name'], $post_data['post_parent'] . '-autosave' ) ) {
// autosaves for previews are weird
/** This filter is already documented in modules/markdown/easy-markdown.php */
$post_data['post_content_filtered'] = apply_filters( 'wpcom_untransformed_content', $post_data['post_content'] );
$post_data['post_content'] = $this->transform( $post_data['post_content'], array( 'id' => $post_data['post_parent'] ) );
/** This filter is already documented in core/wp-includes/default-filters.php */
$post_data['post_content'] = apply_filters( 'content_save_pre', $post_data['post_content'] );
Expand Down

0 comments on commit edddd6b

Please sign in to comment.