diff --git a/wp-admin/includes/class-wp-press-this.php b/wp-admin/includes/class-wp-press-this.php index f65df283c0..0ccb9d7799 100644 --- a/wp-admin/includes/class-wp-press-this.php +++ b/wp-admin/includes/class-wp-press-this.php @@ -91,7 +91,7 @@ class WP_Press_This { } } - // Edxpected slashed + // Expected slashed return wp_slash( $content ); } @@ -133,6 +133,17 @@ class WP_Press_This { $post['post_content'] = $this->side_load_images( $post_id, $post['post_content'] ); + /** + * Filter the post_content of a Press This post before saving/updating, after + * side_load_images action had run. + * + * @since 4.5.0 + * + * @param string $content Content after side_load_images process. + * @param int $post_id Post ID. + */ + $post['post_content'] = apply_filters( 'press_this_save_post_content', $post['post_content'], $post_id ); + $updated = wp_update_post( $post, true ); if ( is_wp_error( $updated ) ) { @@ -293,6 +304,15 @@ class WP_Press_This { ) ); + /** + * Filter 'useful' HTML elements list for fetch source step. + * + * @since 4.5.0 + * + * @param array $elements Default list of useful elements. + */ + $useful_html_elements = apply_filter( 'press_this_useful_html_elements', $useful_html_elements ); + $source_content = wp_remote_retrieve_body( $remote_url ); $source_content = wp_kses( $source_content, $useful_html_elements ); @@ -1193,6 +1213,15 @@ class WP_Press_This { } } + /** + * Filter the assembled HTML for the Press This editor. + * + * @since 4.5.0 + * + * @param string $content Assembled end output of suggested content for the Press This editor. + */ + $content = apply_filters( 'press_this_suggested_content', $content ); + return $content; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 707e537cf0..6fa23c75c9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36671'; +$wp_version = '4.5-alpha-36672'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.