diff --git a/custom_metadata.php b/custom_metadata.php index d37c9d3..1bd8077 100644 --- a/custom_metadata.php +++ b/custom_metadata.php @@ -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( '', esc_attr( $field_id ), esc_attr( $v ), $readonly_str, $placeholder_str ); printf( '', esc_attr( $field->upload_modal_title ), esc_attr( $field->upload_modal_button_text ), esc_attr( $field->upload_modal_title ) ); printf( '', $field->upload_clear_button_text );