Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Diener committed Mar 15, 2016
1 parent 75a5bf2 commit 3c984b2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions classes/AeriaSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ function($post) use ($args) {
}
});

add_filter( 'postbox_classes_' . $args['type'] . '_aeria_section', function( $classes ) use ( $args ) {
array_push( $classes, 'aeria_section_' . $args['title'] );
return $classes;
});
foreach ( (array) $args['type'] as $type ) {
add_filter( 'postbox_classes_' . $type . '_aeria_section', function( $classes ) use ( $args ) {
array_push( $classes, 'aeria_section_' . $args['title'] );
return $classes;
});
}

add_action('save_post', function($post_id) use($args) {

Expand All @@ -42,7 +44,7 @@ function($post) use ($args) {
return;
}

if( $_POST['post_type'] !== $args['type']){
if ( !in_array( $_POST['post_type'], (array) $args['type'] ) ) {
return;
}

Expand Down

0 comments on commit 3c984b2

Please sign in to comment.