Ticket #34455: 34455.1.patch
File 34455.1.patch, 2.0 KB (added by , 9 years ago) |
---|
-
src/wp-admin/includes/class-wp-press-this.php
134 134 $post['post_content'] = $this->side_load_images( $post_id, $post['post_content'] ); 135 135 136 136 /** 137 * Filter the post _contentof a Press This post before saving/updating, after137 * Filter the post data of a Press This post before saving/updating, after 138 138 * side_load_images action had run. 139 139 * 140 140 * @since 4.5.0 141 141 * 142 * @param string $content Content after side_load_images process. 143 * @param int $post_id Post ID. 142 * @param array $post Post data. 144 143 */ 145 $post ['post_content'] = apply_filters( 'press_this_save_post_content', $post['post_content'], $post_id);144 $post = apply_filters( 'press_this_save_post', $post ); 146 145 147 146 $updated = wp_update_post( $post, true ); 148 147 … … 283 282 return $remote_url; 284 283 } 285 284 286 $ useful_html_elements = array(285 $allowed_elements = array( 287 286 'img' => array( 288 287 'src' => true, 289 288 'width' => true, … … 304 303 ) 305 304 ); 306 305 307 /**308 * Filter 'useful' HTML elements list for fetch source step.309 *310 * @since 4.5.0311 *312 * @param array $useful_html_elements Default list of useful elements.313 */314 $useful_html_elements = apply_filter( 'press_this_useful_html_elements', $useful_html_elements );315 316 306 $source_content = wp_remote_retrieve_body( $remote_url ); 317 $source_content = wp_kses( $source_content, $ useful_html_elements );307 $source_content = wp_kses( $source_content, $allowed_elements ); 318 308 319 309 return $source_content; 320 310 } … … 1213 1203 } 1214 1204 } 1215 1205 1216 /**1217 * Filter the assembled HTML for the Press This editor.1218 *1219 * @since 4.5.01220 *1221 * @param string $content Assembled end output of suggested content for the Press This editor.1222 */1223 $content = apply_filters( 'press_this_suggested_content', $content );1224 1225 1206 return $content; 1226 1207 } 1227 1208