Making WordPress.org

Changeset 6951


Ignore:
Timestamp:
03/28/2018 04:10:20 AM (9 years ago)
Author:
pento
Message:

Gutenberg Handbook: Only import the post_title from the manifest, ignore the title in the markdown.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/gutenberg/inc/docs-importer.php

    r6304 r6951  
    271271                $markdown = preg_replace( '#^---(.+)---#Us', '', $markdown );
    272272
    273                 $title = null;
     273                // Remove any level 1 headings at the start of the markdown
    274274                if ( preg_match( '/^#\s(.+)/', $markdown, $matches ) ) {
    275                         $title = $matches[1];
    276275                        $markdown = preg_replace( '/^#\s(.+)/', '', $markdown );
    277276                }
    … …  
    293292                        'post_content' => wp_filter_post_kses( wp_slash( $html ) ),
    294293                );
    295                 if ( ! is_null( $title ) ) {
    296                         $post_data['post_title'] = sanitize_text_field( wp_slash( $title ) );
    297                 }
     294
    298295                wp_update_post( $post_data );
    299296                return true;
Note: See TracChangeset for help on using the changeset viewer.