Permalink
Browse files

Fix #371 #372, metadata not properly imported

  • Loading branch information...
CaerCam committed May 17, 2017
1 parent fafb158 commit 4ffecd98690ef1a6f2a237cb6c58116f8e1dfa53
Showing with 6 additions and 6 deletions.
  1. +6 −6 includes/classes/class-wpmoly-utils.php
@@ -416,20 +416,20 @@ public static function filter_crew_data( $data ) {
if ( ! is_array( $data ) || empty( $data ) || ! isset( $data['crew'] ) )
return $data;
- $filtered_crew = array(
- 'cast' => apply_filters( 'wpmoly_filter_cast_data', $data['cast'] )
- );
+ $filtered_crew = array();
$supported_jobs = WPMOLY_Settings::get_supported_movie_meta( 'crew' );
- foreach ( wp_list_pluck( $supported_jobs, 'job' ) as $job ) {
+ foreach ( wp_list_pluck( $supported_jobs, 'job' ) as $slug => $job ) {
$jobs = wp_filter_object_list( $data['crew'], array( 'job' => $job ) );
if ( ! empty( $jobs ) ) {
- $filtered_crew[ $job ] = wp_list_pluck( $jobs, 'name' );
+ $filtered_crew[ $slug ] = array_values( wp_list_pluck( $jobs, 'name' ) );
} else {
- $filtered_crew[ $job ] = '';
+ $filtered_crew[ $slug ] = '';
}
}
+ $filtered_crew['cast'] = apply_filters( 'wpmoly_filter_cast_data', $data['cast'] );
+
return $filtered_crew;
}

0 comments on commit 4ffecd9

Please sign in to comment.