Making WordPress.org

Changeset 5774


Ignore:
Timestamp:
08/08/2017 01:48:05 PM (9 years ago)
Author:
danielbachhuber
Message:

devhub/cli: Update manifest importer to handle repo_url

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli.php

    r5768 r5774  
    101101        foreach( $manifest as $doc ) {
    102102            // Already exists
    103             if ( wp_filter_object_list( $existing, array( 'cmd_path' => $doc['cmd_path'] ) ) ) {
     103            $existing_doc = wp_filter_object_list( $existing, array( 'cmd_path' => $doc['cmd_path'] ) );
     104            if ( $existing_doc ) {
     105                $existing_doc = array_shift( $existing_doc );
     106                if ( ! empty( $doc['repo_url'] ) ) {
     107                    update_post_meta( $existing_doc['post_id'], 'repo_url', esc_url_raw( $doc['repo_url'] ) );
     108                }
    104109                continue;
    105110            }
     
    132137        if ( $post ) {
    133138            $cmd_path = rtrim( str_replace( home_url( 'cli/commands/' ), '', get_permalink( $post->ID ) ), '/' );
     139            if ( ! empty( $doc['repo_url'] ) ) {
     140                update_post_meta( $post->ID, 'repo_url', esc_url_raw( $doc['repo_url'] ) );
     141            }
    134142            $existing[ $cmd_path ] = array(
    135143                'post_id'   => $post->ID,
Note: See TracChangeset for help on using the changeset viewer.