I know it's not a good practice to hide the warnings using @copy, but what other alternatives are there?
Is there any way you can make sure copy would work or not ?
If you find an error message particularly annoying and you are sure it definitely does not apply to you, PHP has a method for you to silence the message entirely. If you place an at symbol, @, before a function that generates an error, PHP will catch the error and silence it entirely.
Either way, you're looking for the “WP_DEBUG” portion of the wp-config. php file. Click the “Save Changes” button in the top right. Once the file is saved, this will disable the PHP warnings in WordPress.
Use is_readable() and is_writable() to check the status of the source and target before attempting the copy().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With