1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Change upload field messages
  1. Home
  2. Knowledge Base
  3. File Uploads
  4. Change upload field messages
  1. Home
  2. Knowledge Base
  3. Product Page
  4. Change upload field messages
  1. Home
  2. Knowledge Base
  3. Front End
  4. Change upload field messages
  1. Home
  2. Knowledge Base
  3. Advanced
  4. Change upload field messages

Change upload field messages

You can filter all the messages on the AJAX file upload field using the following snippets:

<?php
/**
* Change the 'Drop files here to upload' message
*/
function tester_pewc_filter_drop_files_message( $message, $post_id ) {
return 'Your message';
}
add_filter( 'pewc_filter_drop_files_message', 'tester_pewc_filter_drop_files_message', 10, 2 );
/**
* Change the 'Max file size' message
*/
function tester_pewc_filter_max_file_size_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_max_file_size_message', 'tester_pewc_filter_max_file_size_message', 10 );
/**
* Change the 'Permitted file types' message
*/
function tester_pewc_filter_permitted_file_types_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_permitted_file_types_message', 'tester_pewc_filter_permitted_file_types_message', 10 );
/**
* Change the 'Uploaded' message
*/
function tester_pewc_filter_upload_success_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_upload_success_message', 'tester_pewc_filter_upload_success_message', 10 );
/**
* Change the 'Failed' message
*/
function tester_pewc_filter_upload_failed_message( $message ) {
return 'Your message';
}
add_filter( 'pewc_filter_upload_failed_message', 'tester_pewc_filter_upload_failed_message', 10 );

You can add snippets to your site by following these steps.

Was this article helpful?

Need More Support?

If you can't find the answer that you're looking for, then please use the link below to raise a support ticket.
Contact Support

Related Articles