Title: wp-admin/includes/file.php | Developer.WordPress.org

---

# File: wp-admin/includes/file.php

 * function[wp_zip_file_is_valid()](https://developer.wordpress.org/reference/functions/wp_zip_file_is_valid/)
 * Determines whether the given file is a valid ZIP file.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_zip_file_is_valid/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_zip_file_is_valid/#uses)
   | Source: [wp-admin/includes/file.php:1576](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1576-L1594)
 * hook[pre_unzip_file](https://developer.wordpress.org/reference/hooks/pre_unzip_file/)
 * Filters archive unzipping to override with a custom process.
 * Used by [2 functions](https://developer.wordpress.org/reference/hooks/pre_unzip_file/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/pre_unzip_file/#uses)
   | Source: [wp-admin/includes/file.php:1797](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1797-L1797)
 * hook[unzip_file](https://developer.wordpress.org/reference/hooks/unzip_file/)
 * Filters the result of unzipping an archive.
 * Used by [2 functions](https://developer.wordpress.org/reference/hooks/unzip_file/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/unzip_file/#uses)
   | Source: [wp-admin/includes/file.php:1853](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1853-L1853)
 * function[wp_opcache_invalidate_directory()](https://developer.wordpress.org/reference/functions/wp_opcache_invalidate_directory/)
 * Attempts to clear the opcode cache for a directory of files.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_opcache_invalidate_directory/#used-by)
   | Uses [4 functions](https://developer.wordpress.org/reference/functions/wp_opcache_invalidate_directory/#uses)
   | Source: [wp-admin/includes/file.php:2792](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L2792-L2839)
 * function[move_dir()](https://developer.wordpress.org/reference/functions/move_dir/)
 * Moves a directory from one location to another.
 * Used by [3 functions](https://developer.wordpress.org/reference/functions/move_dir/#used-by)
   | Uses [5 functions](https://developer.wordpress.org/reference/functions/move_dir/#uses)
   | Source: [wp-admin/includes/file.php:2106](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L2106-L2156)
 * hook[{$action}_overrides](https://developer.wordpress.org/reference/hooks/action_overrides/)
 * Filters the override parameters for a file before it is uploaded to WordPress.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/action_overrides/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/action_overrides/#uses)
   | Source: [wp-admin/includes/file.php:866](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L866-L866)
 * function[wp_opcache_invalidate()](https://developer.wordpress.org/reference/functions/wp_opcache_invalidate/)
 * Attempts to clear the opcode cache for an individual PHP file.
 * Used by [5 functions](https://developer.wordpress.org/reference/functions/wp_opcache_invalidate/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/wp_opcache_invalidate/#uses)
   | Source: [wp-admin/includes/file.php:2725](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L2725-L2778)
 * hook[wp_opcache_invalidate_file](https://developer.wordpress.org/reference/hooks/wp_opcache_invalidate_file/)
 * Filters whether to invalidate a file from the opcode cache.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_opcache_invalidate_file/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_opcache_invalidate_file/#uses)
   | Source: [wp-admin/includes/file.php:2773](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L2773-L2773)
 * hook[wp_signature_hosts](https://developer.wordpress.org/reference/hooks/wp_signature_hosts/)
 * Filters the list of hosts which should have Signature Verification attempted 
   on.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_signature_hosts/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_signature_hosts/#uses)
   | Source: [wp-admin/includes/file.php:1287](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1287-L1287)
 * hook[wp_signature_url](https://developer.wordpress.org/reference/hooks/wp_signature_url/)
 * Filters the URL where the signature for a file is located.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_signature_url/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_signature_url/#uses)
   | Source: [wp-admin/includes/file.php:1316](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1316-L1316)
 * hook[wp_signature_softfail](https://developer.wordpress.org/reference/hooks/wp_signature_softfail/)
 * Filters whether Signature Verification failures should be allowed to soft fail.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_signature_softfail/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_signature_softfail/#uses)
   | Source: [wp-admin/includes/file.php:1348](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1348-L1348)
 * function[verify_file_signature()](https://developer.wordpress.org/reference/functions/verify_file_signature/)
 * Verifies the contents of a file against its ED25519 signature.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/verify_file_signature/#used-by)
   | Uses [7 functions](https://developer.wordpress.org/reference/functions/verify_file_signature/#uses)
   | Source: [wp-admin/includes/file.php:1410](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1410-L1536)
 * function[wp_trusted_keys()](https://developer.wordpress.org/reference/functions/wp_trusted_keys/)
 * Retrieves the list of signing keys trusted by WordPress.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_trusted_keys/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_trusted_keys/#uses)
   | Source: [wp-admin/includes/file.php:1545](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1545-L1563)
 * hook[wp_trusted_keys](https://developer.wordpress.org/reference/hooks/wp_trusted_keys/)
 * Filters the valid signing keys used to verify the contents of files.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_trusted_keys/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_trusted_keys/#uses)
   | Source: [wp-admin/includes/file.php:1562](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1562-L1562)
 * hook[download_url_error_max_body_size](https://developer.wordpress.org/reference/hooks/download_url_error_max_body_size/)
 * Filters the maximum error response body size in `download_url()`.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/download_url_error_max_body_size/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/download_url_error_max_body_size/#uses)
   | Source: [wp-admin/includes/file.php:1211](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1211-L1211)
 * hook[pre_move_uploaded_file](https://developer.wordpress.org/reference/hooks/pre_move_uploaded_file/)
 * Filters whether to short-circuit moving the uploaded file after passing all checks.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/pre_move_uploaded_file/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/pre_move_uploaded_file/#uses)
   | Source: [wp-admin/includes/file.php:1017](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L1017-L1017)
 * function[wp_get_plugin_file_editable_extensions()](https://developer.wordpress.org/reference/functions/wp_get_plugin_file_editable_extensions/)
 * Gets the list of file extensions that are editable in plugins.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_get_plugin_file_editable_extensions/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_get_plugin_file_editable_extensions/#uses)
   | Source: [wp-admin/includes/file.php:192](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L192-L242)
 * function[wp_get_theme_file_editable_extensions()](https://developer.wordpress.org/reference/functions/wp_get_theme_file_editable_extensions/)
 * Gets the list of file extensions that are editable for a given theme.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_get_theme_file_editable_extensions/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_get_theme_file_editable_extensions/#uses)
   | Source: [wp-admin/includes/file.php:252](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L252-L302)
 * function[wp_print_file_editor_templates()](https://developer.wordpress.org/reference/functions/wp_print_file_editor_templates/)
 * Prints file editor templates (for plugins and themes).
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_print_file_editor_templates/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/wp_print_file_editor_templates/#uses)
   | Source: [wp-admin/includes/file.php:309](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L309-L357)
 * function[wp_edit_theme_plugin_file()](https://developer.wordpress.org/reference/functions/wp_edit_theme_plugin_file/)
 * Attempts to edit a file for a theme or plugin.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_edit_theme_plugin_file/#used-by)
   | Uses [23 functions](https://developer.wordpress.org/reference/functions/wp_edit_theme_plugin_file/#uses)
   | Source: [wp-admin/includes/file.php:380](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L380-L656)
 * hook[wp_theme_editor_filetypes](https://developer.wordpress.org/reference/hooks/wp_theme_editor_filetypes/)
 * Filters the list of file types allowed for editing in the theme file editor.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/wp_theme_editor_filetypes/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/wp_theme_editor_filetypes/#uses)
   | Source: [wp-admin/includes/file.php:298](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L298-L298)
 * function[wp_print_request_filesystem_credentials_modal()](https://developer.wordpress.org/reference/functions/wp_print_request_filesystem_credentials_modal/)
 * Prints the filesystem credentials modal when needed.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_print_request_filesystem_credentials_modal/#used-by)
   | Uses [4 functions](https://developer.wordpress.org/reference/functions/wp_print_request_filesystem_credentials_modal/#uses)
   | Source: [wp-admin/includes/file.php:2684](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L2684-L2705)
 * function[_wp_handle_upload()](https://developer.wordpress.org/reference/functions/_wp_handle_upload/)
 * Handles PHP uploads in WordPress.
 * Used by [2 functions](https://developer.wordpress.org/reference/functions/_wp_handle_upload/#used-by)
   | Uses [8 functions](https://developer.wordpress.org/reference/functions/_wp_handle_upload/#uses)
   | Source: [wp-admin/includes/file.php:809](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L809-L1082)
 * hook[{$action}_prefilter](https://developer.wordpress.org/reference/hooks/action_prefilter/)
 * Filters the data for a file before it is uploaded to WordPress.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/action_prefilter/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/action_prefilter/#uses)
   | Source: [wp-admin/includes/file.php:840](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L840-L840)
 * function[get_filesystem_method()](https://developer.wordpress.org/reference/functions/get_filesystem_method/)
 * Determines which method to use for reading, writing, modifying, or deleting files
   on the filesystem.
 * Used by [5 functions](https://developer.wordpress.org/reference/functions/get_filesystem_method/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/get_filesystem_method/#uses)
   | Source: [wp-admin/includes/file.php:2271](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L2271-L2343)
 * hook[filesystem_method](https://developer.wordpress.org/reference/hooks/filesystem_method/)
 * Filters the filesystem method to use.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/filesystem_method/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/filesystem_method/#uses)
   | Source: [wp-admin/includes/file.php:2342](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L2342-L2342)
 * function[request_filesystem_credentials()](https://developer.wordpress.org/reference/functions/request_filesystem_credentials/)
 * Displays a form to the user to request for their FTP/SSH details in order to 
   connect to the filesystem.
 * Used by [12 functions](https://developer.wordpress.org/reference/functions/request_filesystem_credentials/#used-by)
   | Uses [19 functions](https://developer.wordpress.org/reference/functions/request_filesystem_credentials/#uses)
   | Source: [wp-admin/includes/file.php:2375](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L2375-L2677)
 * hook[request_filesystem_credentials](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/)
 * Filters the filesystem credentials.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/request_filesystem_credentials/#uses)
   | Source: [wp-admin/includes/file.php:2400](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L2400-L2400)
 * hook[fs_ftp_connection_types](https://developer.wordpress.org/reference/hooks/fs_ftp_connection_types/)
 * Filters the connection types to output to the filesystem credentials form.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/fs_ftp_connection_types/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/fs_ftp_connection_types/#uses)
   | Source: [wp-admin/includes/file.php:2554](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L2554-L2554)
 * function[list_files()](https://developer.wordpress.org/reference/functions/list_files/)
 * Returns a listing of all files in the specified folder and all subdirectories
   up to 100 levels deep.
 * Used by [3 functions](https://developer.wordpress.org/reference/functions/list_files/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/functions/list_files/#uses)
   | Source: [wp-admin/includes/file.php:139](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/file.php#L139-L182)

1 [2](https://developer.wordpress.org/reference/file/wp-admin/includes/file.php/page/2/?output_format=md)

 [Next Page](https://developer.wordpress.org/reference/file/wp-admin/includes/file.php/page/2/?output_format=md)