WordPress.org

Making WordPress.org

Changeset 8784


Ignore:
Timestamp:
05/13/2019 05:31:52 PM (3 years ago)
Author:
coffee2code
Message:

Markdown Importer: Rename variable to better reflect what it represents.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-markdown/inc/class-importer.php

    r8783 r8784  
    373373        );
    374374
    375         $markdown_entry = get_post_meta( $post_id, $this->manifest_entry_meta_key, true );
    376 
    377         if ( ! empty( $markdown_entry['order'] ) ) {
    378             $post_data['menu_order'] = $markdown_entry['order'];
     375        $manifest_entry = get_post_meta( $post_id, $this->manifest_entry_meta_key, true );
     376
     377        if ( ! empty( $manifest_entry['order'] ) ) {
     378            $post_data['menu_order'] = $manifest_entry['order'];
    379379        }
    380380
    381381        // If no title was extracted from markdown doc, use the value defined in manifest.
    382382        if ( is_null( $title ) ) {
    383             if ( ! empty( $markdown_entry['title'] ) ) {
    384                 $post_data['post_title'] = sanitize_text_field( wp_slash( $markdown_entry['title'] ) );
     383            if ( ! empty( $manifest_entry['title'] ) ) {
     384                $post_data['post_title'] = sanitize_text_field( wp_slash( $manifest_entry['title'] ) );
    385385            }
    386386        } else {
     
    390390        $parent_id = wp_get_post_parent_id( $post_id );
    391391
    392         if ( ! $markdown_entry ) {
     392        if ( ! $manifest_entry ) {
    393393            // Do nothing with regards to possibly changing post parent as we know
    394394            // nothing about previous import.
     
    398398            $parent = $parent_id ? get_post( $parent_id ) : null;
    399399            // ...but no parent is now defined, unset parent.
    400             if ( empty( $markdown_entry['parent'] ) ) {
     400            if ( empty( $manifest_entry['parent'] ) ) {
    401401                $post_data['post_parent'] = '';
    402402            }
    403403            // ...and it appears to differ from parent now defined, find new parent.
    404             elseif ( $markdown_entry['parent'] !== $parent->post_name ) {
    405                 $find_parent = get_page_by_path( $markdown_entry['parent'], OBJECT, $this->get_post_type() );
     404            elseif ( $manifest_entry['parent'] !== $parent->post_name ) {
     405                $find_parent = get_page_by_path( $manifest_entry['parent'], OBJECT, $this->get_post_type() );
    406406                if ( $find_parent ) {
    407407                    $post_data['post_parent'] = $find_parent->ID;
     
    410410        }
    411411        // Does this parentless post now have one newly defined?
    412         elseif ( ! empty( $markdown_entry['parent'] ) ) {
    413             $find_parent = get_page_by_path( $markdown_entry['parent'], OBJECT, $this->get_post_type() );
     412        elseif ( ! empty( $manifest_entry['parent'] ) ) {
     413            $find_parent = get_page_by_path( $manifest_entry['parent'], OBJECT, $this->get_post_type() );
    414414            if ( $find_parent ) {
    415415                $post_data['post_parent'] = $find_parent->ID;
Note: See TracChangeset for help on using the changeset viewer.