Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion custom_metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,8 @@ function _display_metadata_field( $field_slug, $field, $object_type, $object_id,
break;
case 'upload' :
$_attachment_id = $this->get_metadata_field_value( $field_slug . '_attachment_id', $field, $object_type, $object_id );
$attachment_id = array_shift( array_values( $_attachment_id ) ); // get the first value in the array
$_attachment_id_first_value = array_values( $_attachment_id ); //let's save it into a variable to avoid Strict Standard
$attachment_id = array_shift( $_attachment_id_first_value ); // get the first value in the array
printf( '<input type="text" name="%s" value="%s" class="custom-metadata-upload-url"%s%s/>', esc_attr( $field_id ), esc_attr( $v ), $readonly_str, $placeholder_str );
printf( '<input type="button" data-uploader-title="%s" data-uploader-button-text="%s" class="button custom-metadata-upload-button" value="%s"/>', esc_attr( $field->upload_modal_title ), esc_attr( $field->upload_modal_button_text ), esc_attr( $field->upload_modal_title ) );
printf( '<input type="button" class="button custom-metadata-clear-button" value="%s"/>', $field->upload_clear_button_text );
Expand Down