1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Filter AJAX uploader messages
  1. Home
  2. Knowledge Base
  3. Product Page
  4. Filter AJAX uploader messages
  1. Home
  2. Knowledge Base
  3. Advanced
  4. Filter AJAX uploader messages

Filter 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_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 );

Add a snippet to your site like this.

Was this article helpful?

Related Articles