You can change the messages in the AJAX file uploader by using one or more of the following filters:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |