Making WordPress.org

Changeset 8847


Ignore:
Timestamp:
05/21/2019 08:59:57 PM (3 years ago)
Author:
coffee2code
Message:

Markdown Importer: Prevent duplicate importing of handbook landing pages when special key 'index' is used to denote landing page.

See #4466.

File:
1 edited

Legend:

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

    r8846 r8847  
    124124                WP_CLI::error( 'Invalid manifest' );
    125125            }
    126             return new WP_Error( 'invalid-manifest', 'Manifest did not unfurl properly.' );;
     126            return new WP_Error( 'invalid-manifest', 'Manifest did not unfurl properly.' );
    127127        }
    128128
     
    163163            // Already exists, update.
    164164            $existing = $this->existing[ $key ] ?? $this->existing['slug_only'][ $key ] ?? false;
     165            if ( ! $existing && 'index' === $key ) {
     166                $key = $this->get_post_type();
     167                $existing = $this->existing[ $key ] ?? $this->existing['slug_only'][ $key ] ?? false;
     168            }
    165169            if ( $existing ) {
    166170                $existing_id = $existing['post_id'];
Note: See TracChangeset for help on using the changeset viewer.