This is untested, but I think you can just define wp_handle_upload_error in your functions.php file and return custom error messages. If you look at where that function is defined in that file,
if ( ! function_exists( 'wp_handle_upload_error' ) ) {
function wp_handle_upload_error( &$file, $message ) {
return array( 'error'=>$message );
}
}
You can see it first does a test to see if the function is defined, so it would be safe to create another one (of course, in your own code, also check to see if its defined just to be safe). You’ll have some experimenting to do, but hopefully this puts you on the right path!
Cheers~
Related Posts:
- What conditions must be met in order to upload .zip file to a multisite WordPress installation?
- How to set Media Box form elements default value?
- Is there a way to send HTML formatted emails with WordPress’ wp_mail() function?
- Is there a hook that runs after a user logs in?
- How to get a translated string from a language other than the current one?
- Hook after image is uploaded and image sizes generated
- How to call a REST endpoint when a post is published?
- __NAMESPACE__ with register_activation_hook
- How to check if which hook triggered the call to a function?
- Hook for URL Request
- Saving the pre-sanitized filename of an attachment as the Title or Caption
- Hook/notify when any option or setting is added or updated
- Which hooks is this? add_action(‘wp’,
- Hook filter to change wp_upload_dir() path in multisite
- admin_notices after register_uninstall / deactivate_hook
- Hooks are not executing
- add_action on inherit post status
- Best possible way to get all options
- Why does wp_enqueue_script ignore my ‘wp_head’ hook?
- Filter the URL of next_posts_link & previous_posts_link
- action lifecycle
- Redirect users on specific post category or category page
- Returning ACF custom field from publish_post
- How to modify an add_action() inside a loop of core function
- Language Translation is not working?
- How to change the language of the ‘Reset Password’ page
- What is the best filter where to use register_block_type?
- How get list all users who edited post?
- Stuck in redirect loop after using wp_login action
- How to change the location of admin notice in html without using Javascript?
- Why doesn’t wp_enqueue_script() work when including a JavaScript file with TEMPLATEPATH?
- What are the differences between comment_form_logged_in_after and comment_form_after_fields?
- Detect change to user_meta and retrieve old and new values
- Featured Image Action Hook
- ‘Trick’ a plugin (WP-Members) to think the blog language has changed for a single page
- Get log of function/method calls made by do_action() on WordPress initialization
- How to find a callback attached to a bbpress hook?
- Event Calendar using insert_post_data after save_post and insert_post after post_transition draft_to_schedule
- How to extend custom (non-core) blocks?
- Hooking into the init action will fire it too frequently?
- Locale switching with a “language” taxonomy
- Implement Hooks Using Array
- What hook is used to display the admin_bar on the front end?
- Is there a JavaScript equivalent of get_post_field?
- Redirect customer to login if not logged in when proceeding to checkout
- Adding a hook to the default (page.php) template
- Add action hook into wp_localize_script
- WP_query hooks before execute a search query
- Conditional for autosave or auto draft?
- Using delete_attachment to prevent an attachment not working
- How does do_action( ) works actually?
- Switch site language to en_ZA
- Giving the_excerpt in the place of the_content?
- Hook to init or call explicitly within functions.php
- How to add content to the end of a page with a hook?
- Use a variable created in get_header to calculate stuff in wp_footer
- register_deactivation_hook argument -> pass arguments in the selected function
- WordPress’s “Text” Format
- run script on publish
- Calling add_action on a filter hook?
- Remove Header and Footer if user is not logged on
- What is deprecated_argument_run meant to do exactly?
- How do I run an action after a featured image has been selected in the Gutenberg editor?
- How to run a function after wp() in the wp-blog-header.php file?
- WordPress cronjob get scheduled but function does not run
- How to add a HTML element in ADMIN edit post window?
- wp query add array by if condition
- WP Cron not executing after timespan
- Gravity Forms | Form Object is NULL [closed]
- Change status of page after an event (Looking for best practice advice)
- add_action hook for links.php page
- Add action save post when create and publish
- Hooks for Start/End of Batch Plugin Updates in wordpress
- Filter Media by attached page or blog post in Library
- How to load another post if condition is true
- Struggling with plugin dev basics: add_action
- RTrouble passing arguments to action
- What hook can you use to get the full response?
- delete_user hook failed
- Which things should be called with `after_setup_theme`?
- Changing header logo href for the checkout page
- Prefixing widget_posts_args Hook
- Can’t get ID of post that relates to the comment
- Updating user meta data from external link, user not logged in
- adding wordpress yoast SEO canonical url from “transition_post_status” hook
- Remove lines from RSS Feed
- Is there a hook that triggers when grant secondary user role in WordPress?
- Conditionally change WordPress core language
- How can I insert custom html code inside a div dynamically?
- How to trigger click events using hooks
- remove_action() hook not working
- How WordPress understands what do with the (all) key in the $wp_filter array? [duplicate]
- Function Hooked on Init Running Multiple Times
- WP-Automatic to run publish hooks
- Hide post completely and still reach it via cURL
- Problem in register activation hook and Copying folder
- Why does hook priority affects admin menu permission error?
- WordPress Site in Multiple Languages
- add_action failed to display function by a plugin
- How to make a multilingual wordpress site to be translated one-to-one without much effort and without using translate?