Changeset 11141
- Timestamp:
- 07/20/2021 05:53:11 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-export.php
r10222 r11141 26 26 * [--locale-slug] 27 27 * : Slug of the locale. Default: 'default'. 28 * 29 * [--projects] 30 * : Comma-separated list of projects to export. Default: 'frontend,admin,admin-network,continents-cities'. 28 31 */ 29 32 public function __invoke( $args, $assoc_args ) { … … 34 37 $args = wp_parse_args( $assoc_args, [ 35 38 'locale-slug' => 'default', 39 'projects' => 'frontend,admin,admin-network,continents-cities', 36 40 ] ); 37 41 … … 46 50 if ( 'default' !== $args['locale-slug'] ) { 47 51 $wp_locale = $wp_locale . '_' . $args['locale-slug']; 52 } 53 54 $contexts_to_export = explode( ',', $args['projects'] ); 55 $frontend_context = array_search( 'frontend', $contexts_to_export, true ); 56 if ( false !== $frontend_context ) { 57 // Replace 'frontend' with an empty string which is used as project context. 58 $contexts_to_export[ $frontend_context ] = ''; 48 59 } 49 60 … … 58 69 59 70 foreach ( $projects as $path => $context ) { 71 if ( ! in_array( $context, $contexts_to_export, true ) ) { 72 continue; 73 } 74 60 75 $gp_project = GP::$project->by_path( $path ); 61 76 if ( ! $gp_project ) {
Note: See TracChangeset
for help on using the changeset viewer.