diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 93a955a3..dd20bab3 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -2968,11 +2968,16 @@ if ( ! class_exists( 'um\core\Fields' ) ) { if ( empty( $disabled ) ) { $output .= '' . $button_text . ''; } - } $output .= ''; /* modal hidden */ if ( empty( $disabled ) ) { + if ( ! isset( $allowed_types ) ) { + $allowed_types = 'gif,jpg,jpeg,png'; + } elseif ( is_array( $allowed_types ) ) { + $allowed_types = implode( ',', $allowed_types ); + } + $output .= '
'; $output .= '
' . $modal_label . '
'; $output .= '
'; @@ -2983,7 +2988,8 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $set_id = 0; $set_mode = ''; } - $nonce = wp_create_nonce( 'um_upload_nonce-' . $this->timestamp ); + + $nonce = wp_create_nonce( 'um_upload_nonce-' . $this->timestamp ); $output .= '
'; $output .= '
' . $button_text . '
'; $output .= ''; @@ -3072,6 +3078,12 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $output .= '
'; /* modal hidden */ if ( empty( $disabled ) ) { + if ( ! isset( $allowed_types ) ) { + $allowed_types = 'pdf,txt'; + } elseif ( is_array( $allowed_types ) ) { + $allowed_types = implode( ',', $allowed_types ); + } + $output .= '
'; $output .= '
' . $modal_label . '
'; $output .= '
';