{"id":5492,"date":"2026-02-12T20:44:36","date_gmt":"2026-02-13T01:44:36","guid":{"rendered":"https:\/\/chubes.net\/?documentation=file-php"},"modified":"2026-03-13T03:27:45","modified_gmt":"2026-03-13T07:27:45","slug":"file-php","status":"publish","type":"documentation","link":"https:\/\/chubes.net\/docs\/wordpress-core\/admin-includes\/file-php\/","title":{"rendered":"file.php"},"content":{"rendered":"<h2 class=\"wp-block-heading\">Overview<\/h2><p>Filesystem helpers for uploads, file editing, and WordPress file operations.<\/p><h2 class=\"wp-block-heading\">Functions<\/h2><ul class=\"wp-block-list\"><li><code>get_file_description()<\/code> \u2014 Filesystem API: Top-level functionality<\/li><li><code>get_home_path()<\/code> \u2014 Gets the absolute filesystem path to the root of the WordPress installation.<\/li><li><code>list_files()<\/code> \u2014 Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.<\/li><li><code>wp_get_plugin_file_editable_extensions()<\/code> \u2014 Gets the list of file extensions that are editable in plugins.<\/li><li><code>wp_get_theme_file_editable_extensions()<\/code> \u2014 Filters the list of file types allowed for editing in the plugin file editor.<\/li><li><code>wp_print_file_editor_templates()<\/code> \u2014 Filters the list of file types allowed for editing in the theme file editor.<\/li><li><code>wp_edit_theme_plugin_file()<\/code> \u2014 Attempts to edit a file for a theme or plugin.<\/li><li><code>wp_tempnam()<\/code> \u2014  This filter is documented in wp-includes\/class-wp-http-streams.php *\/<\/li><li><code>validate_file_to_edit()<\/code> \u2014 Makes sure that the file that was requested to be edited is allowed to be edited.<\/li><li><code>wp_handle_upload()<\/code> \u2014 Filters the data for a file before it is uploaded to WordPress.<\/li><li><code>wp_handle_sideload()<\/code> \u2014 Wrapper for _wp_handle_upload().<\/li><li><code>download_url()<\/code> \u2014 Downloads a URL to a local temporary file using the WordPress HTTP API.<\/li><li><code>verify_file_md5()<\/code> \u2014 Filters the maximum error response body size in <code>download_url()<\/code>.<\/li><li><code>verify_file_signature()<\/code> \u2014 Verifies the contents of a file against its ED25519 signature.<\/li><li><code>wp_trusted_keys()<\/code> \u2014 Retrieves the list of signing keys trusted by WordPress.<\/li><li><code>wp_zip_file_is_valid()<\/code> \u2014 Filters the valid signing keys used to verify the contents of files.<\/li><li><code>unzip_file()<\/code> \u2014  This filter is documented in wp-admin\/includes\/file.php *\/<\/li><li><code>copy_dir()<\/code> \u2014  This filter is documented in src\/wp-admin\/includes\/file.php *\/<\/li><li><code>move_dir()<\/code> \u2014 Moves a directory from one location to another.<\/li><li><code>WP_Filesystem()<\/code> \u2014 Initializes and connects the WordPress Filesystem Abstraction classes.<\/li><li><code>get_filesystem_method()<\/code> \u2014 Filters the path for a specific filesystem method class file.<\/li><li><code>request_filesystem_credentials()<\/code> \u2014 Filters the filesystem method to use.<\/li><li><code>wp_print_request_filesystem_credentials_modal()<\/code> \u2014 Filters the filesystem credentials.<\/li><li><code>wp_opcache_invalidate()<\/code> \u2014 Attempts to clear the opcode cache for an individual PHP file.<\/li><li><code>wp_opcache_invalidate_directory()<\/code> \u2014 Filters whether to invalidate a file from the opcode cache.<\/li><\/ul>","protected":false},"excerpt":{"rendered":"<p>Overview Filesystem helpers for uploads, file editing, and WordPress file operations. Functions get_file_description() \u2014 Filesystem API: Top-level functionality get_home_path() \u2014 Gets the absolute filesystem path to the root of the&#8230;<\/p>\n","protected":false},"featured_media":0,"template":"","meta":{"footnotes":""},"tags":[],"project":[596],"project_type":[749],"class_list":["post-5492","documentation","type-documentation","status-publish","hentry","project-admin-includes","project_type-wordpress-reference"],"project_info":{"id":589,"name":"WordPress Core","slug":"wordpress-core"},"project_type_info":{"id":749,"name":"WordPress Reference","slug":"wordpress-reference"},"_links":{"self":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/5492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/types\/documentation"}],"version-history":[{"count":2,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/5492\/revisions"}],"predecessor-version":[{"id":7923,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/5492\/revisions\/7923"}],"wp:attachment":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/media?parent=5492"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/tags?post=5492"},{"taxonomy":"project","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project?post=5492"},{"taxonomy":"project_type","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project_type?post=5492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}