Changeset 5774
- Timestamp:
- 08/08/2017 01:48:05 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli.php
r5768 r5774 101 101 foreach( $manifest as $doc ) { 102 102 // 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 } 104 109 continue; 105 110 } … … 132 137 if ( $post ) { 133 138 $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 } 134 142 $existing[ $cmd_path ] = array( 135 143 'post_id' => $post->ID,
Note: See TracChangeset
for help on using the changeset viewer.