Skip to content

Commit

Permalink
Fix cloning bug with media
Browse files Browse the repository at this point in the history
  • Loading branch information
funkatron82 committed May 19, 2016
1 parent 9008d64 commit f981512
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions inc/fields/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,9 @@ static function html( $meta, $field )
$meta = (array) $meta;
$meta = implode( ',', $meta );
$attributes = $load_test_attr = self::get_attributes( $field, $meta );
$load_test_attr['disabled'] = false;
$load_test_attr['class'] = 'rwmb-load-test';
$load_test_attr['value'] = - 1;
$load_test_attr['name'] = $field['field_name'];


$html = sprintf(
'<input %s>
<div class="rwmb-media-view" data-mime-type="%s" data-max-files="%s" data-force-delete="%s" data-show-status="%s"></div>',
self::render_attributes( $attributes ),
$field['mime_type'],
Expand Down
2 changes: 1 addition & 1 deletion js/clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jQuery( function ( $ )
// Reset select
$field.prop( 'selectedIndex', -1 )
}
else if ( 'hidden' !== $field.attr( 'type' ) )
else if ( ! $field.hasClass( 'rwmb-hidden' ) )
{
// Reset value
$field.val( '' );
Expand Down

0 comments on commit f981512

Please sign in to comment.