1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Product Page
  5. Filter/translate AJAX uploader messages
  1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Translations
  5. Filter/translate AJAX uploader messages

Filter/translate AJAX uploader messages

You can change the messages in the AJAX file uploader by using one or more of the following filters:

<?php
/**
* Change the 'Drop files here to upload' message
*/
function tester_dictDefaultMessage_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_dictDefaultMessage_message', 'tester_dictDefaultMessage_message' );
/**
* Change the 'Your browser does not support drag and drop file uploads' message
*/
function tester_dictFallbackMessage_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_dictFallbackMessage_message', 'tester_dictFallbackMessage_message' );
/**
* Change the 'Please use the fallback form below to upload your files like in the olden days' message
*/
function tester_dictFallbackText_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_dictFallbackText_message', 'tester_dictFallbackText_message' );
/**
* Change the 'The file is too big' message
*/
function tester_dictFileTooBig_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_dictFileTooBig_message', 'tester_dictFileTooBig_message' );
/**
* Change the 'You cannot upload files of this type' message
*/
function tester_dictInvalidFileType_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_dictInvalidFileType_message', 'tester_dictInvalidFileType_message' );
/**
* Change the 'Cancel upload' message
*/
function tester_dictCancelUpload_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_dictCancelUpload_message', 'tester_dictCancelUpload_message' );
/**
* Change the 'Upload cancelled' message
*/
function tester_dictUploadCanceled_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_dictUploadCanceled_message', 'tester_dictUploadCanceled_message' );
/**
* Change the 'Are you sure you want to cancel this upload?' message
*/
function tester_dictCancelUploadConfirmation_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_dictCancelUploadConfirmation_message', 'tester_dictCancelUploadConfirmation_message' );
/**
* Change the 'Remove file' message
*/
function tester_dictRemoveFile_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_dictRemoveFile_message', 'tester_dictRemoveFile_message' );
/**
* Change the 'You cannot upload any more files' message
*/
function tester_dictMaxFilesExceeded_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_dictMaxFilesExceeded_message', 'tester_dictMaxFilesExceeded_message' );

Add a snippet to your site like this.

Was this article helpful?

Related Articles