I'm having trouble with permission to delete files that are within the theme folder. All folders and files are with permission 775 and there is no error in the code , because when I use the code in a directory before the root folder wordpress works.
-The image files are deleted via front-end .
How can I solve this permission ? Or was it this lack of account : wp_enqueue_script