Changeset 5475
- Timestamp:
- 05/04/2017 04:38:10 PM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli.php
r5474 r5475 219 219 $markdown = preg_replace( '/^#\swp\s(.+)/', '', $markdown ); 220 220 } 221 $markdown = trim( $markdown ); 222 223 // Steal the first sentence as the excerpt 224 $excerpt = ''; 225 if ( preg_match( '/^(.+)/', $markdown, $matches ) ) { 226 $excerpt = $matches[1]; 227 $markdown = preg_replace( '/^(.+)/', '', $markdown ); 228 } 221 229 222 230 // Transform to HTML and save the post … … 227 235 'ID' => $post_id, 228 236 'post_content' => wp_filter_post_kses( wp_slash( $html ) ), 237 'post_excerpt' => sanitize_text_field( wp_slash( $excerpt ) ), 229 238 ); 230 239 if ( ! is_null( $title ) ) {
Note: See TracChangeset
for help on using the changeset viewer.