@@ -262,30 +262,34 @@ function add_project_moves_chart_shortcode( $atts ) {
262
262
$ current_year = (int ) gmdate ( 'Y ' );
263
263
264
264
for ( $ this_year = $ start_year ; $ this_year <= $ current_year ; $ this_year ++ ) {
265
- $ archived_move [ $ this_year ] = 0 ;
265
+ $ archived_move [ $ this_year ] = 0 ;
266
266
$ incubating_move [ $ this_year ] = 0 ;
267
267
$ graduated_move [ $ this_year ] = 0 ;
268
268
if ( $ current_year == $ this_year ) {
269
269
$ graduated_background [] = 'rgb(193, 96, 220, .4) ' ;
270
270
$ incubating_background [] = 'rgb(240, 188, 0, .4) ' ;
271
- $ archived_background [] = 'rgb(116, 116, 116, .4) ' ;
271
+ $ archived_background [] = 'rgb(116, 116, 116, .4) ' ;
272
272
} else {
273
273
$ graduated_background [] = 'rgb(193 96 220) ' ;
274
274
$ incubating_background [] = 'rgb(240, 188, 0) ' ;
275
- $ archived_background [] = 'rgb(116, 116, 116) ' ;
275
+ $ archived_background [] = 'rgb(116, 116, 116) ' ;
276
276
}
277
277
}
278
278
279
279
foreach ( $ maturity_data as $ md ) {
280
- $ md_year = (int ) explode ( '- ' , $ md ['accepted ' ] )[0 ];
281
- if ( 2016 <= $ md_year && $ md_year <= $ current_year ) {
282
- if ( $ md ['graduated ' ] == $ md ['accepted ' ] ) {
283
- $ graduated_move [ $ md_year ] += 1 ;
284
- } elseif ( $ md ['incubating ' ] == $ md ['accepted ' ] ) {
285
- $ incubating_move [ $ md_year ] += 1 ;
286
- } else {
287
- $ archived_move [ $ md_year ] += 1 ;
288
- }
280
+ $ accepted_year = (int ) explode ( '- ' , $ md ['accepted ' ] )[0 ];
281
+ $ graduated_year = (int ) explode ( '- ' , $ md ['graduated ' ] )[0 ];
282
+ $ incubating_year = (int ) explode ( '- ' , $ md ['incubating ' ] )[0 ];
283
+ $ archived_year = (int ) explode ( '- ' , $ md ['archived ' ] )[0 ];
284
+
285
+ if ( 2016 <= $ graduated_year && $ graduated_year != $ accepted_year ) {
286
+ $ graduated_move [ $ graduated_year ] += 1 ;
287
+ }
288
+ if ( 2016 <= $ incubating_year && $ incubating_year != $ accepted_year ) {
289
+ $ incubating_move [ $ incubating_year ] += 1 ;
290
+ }
291
+ if ( 2016 <= $ archived_year && $ archived_year != $ accepted_year ) {
292
+ $ archived_move [ $ archived_year ] += 1 ;
289
293
}
290
294
}
291
295
0 commit comments