WordPress provides a function called unzip_file()— easily found by typing “wordpress unzip” into Google. There is sample code in the Codex:
WP_Filesystem();
$destination = wp_upload_dir();
$destination_path = $destination['path'];
$unzipfile = unzip_file( $destination_path.'/filename.zip', $destination_path);
if ( $unzipfile ) {
echo 'Successfully unzipped the file!';
} else {
echo 'There was an error unzipping the file.';
}
I have no idea what “custom work” you need to do.
Related Posts:
- Redirect to another page using contact form 7? [closed]
- How to register images uploaded via FTP in media library?
- How to use copy() function and paste file in /wp-content/themes directory
- Image upload via FTP to wordpress media library
- WordPress media upload “HTTP error”
- do not show web page section when using advanced custom fields pro
- Am I not understanding plugins?
- Adding a querystring to an image URL when clicking ‘insert into post’?
- Using Font Awesome as post thumbnail
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- custom shortcode will not display the wrapped content
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- How can i upload images in an admin page?
- Hide categories that are not used in the post type
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- what is the best practice to add new field to an api route
- How to upload a file to a folder named after the user_id via plugin
- add custom link to wordpress media gallery modal
- Improve page speed loading using CDN and async or defer attribute
- Can’t upload image using media_sideload_image
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- How to add the sidebar to all the pages except the home page? [closed]
- Can’t upload CSV file to plugin directory using custom upload form in admin panel
- Validate and Sanitize WP REST API Request using WP JSON Schema?
- How can I search all plugins for composer’s vendor/autoload.php?
- custom plugin with upload files does not work
- Removed jQuery script from header.php , any problems?
- Toolbar Hidden in a Virtual Page
- Change image data durgin upload
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- How to extend SelectControl with data from my theme
- How to change basename url for wp-admin?
- Submit remote form to wordpress REST API and save data to custom post type
- Store user form submitted information in post type
- Display attached images of a page or post that are insetred using gallery
- overwrite wordpress gallery with custom gallery shortcode
- Add a custom link to each image in WordPress gallery
- register dependency css and js inside a plugin class
- How to properly escape in ternary operators – Wp Coding Standards?
- Upload images from one server to an other in wordpress
- How to destroy or dispose wordpress uploder/manager?
- Renaming “Expand Details” within “Add Media”
- Save the outputted image into the Media Library, with a different filename and extension
- WP multisite network plugin fails to see classes loaded with spl autoload
- Edit Image/Image Details – Replace button missing
- How to edit the default database of WordPress [closed]
- How to automatically convert images to WebP on WordPress?
- Variable ++ in query loop
- Woocommerce Convert existing order to the cart
- Capture the Selected Radio Button Value between two files in wordpress theme
- Changing upload directory temporarily
- Where to store PHP files created by plugin / themes
- Should I use spl_autoload_register() in my plugin?
- How can I save a multiple select array with the settings API for a plug-in options page?
- Uploading media with the REST API
- Using register_activation_hook in classes
- PHP unit testing WordPress?
- List of all theme customizer control types?
- Is there a way for a plugin to add an attribute to the tag of a theme?
- Gutenberg Blocks doesn’t render correctly when using do_blocks
- Admin Media grid view images won’t load
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Specified file failed upload test. wp_upload_handle
- Multiple do_shortcode($content) within one shortcode
- My shortcode is showing up twice
- Database “Migration” for Plugins?
- Widgets not showing in my custom theme
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- Use WordPress’s Media Uploader/ Manager in non WordPress php application
- Making Quote Plugin more efficient
- What is the fastest way to load PHP functions that are only used in one theme template?
- How do I access the media settings
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Can’t load WP function into external function
- Will simple function names in a class structure conflict with other plugins?
- Instantiate class to be available to all plugin functions
- WooCommerce get_price returning wrong price when used via ajax
- How to test nonce with AJAX – Plugin development
- Open Post Thumbnail in New Child Theme File in WordPress
- Implement toggle switch for theme options in settings API
- WP nonce invalid
- Wp-login appears White Screen, Error: Cannot modify header information
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Reprinting tags with all attributes
- Need Help Fixing My Iframes [closed]
- Update results, Before deleting the related category [closed]
- What are the specifics of WordPress development I need to know? [closed]
- Enable custom logo upload if logo is not in header
- Adding function to Genesis genesis_header [closed]
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- How do I get around “Sorry, this file type is not permitted for security reasons”?
- Get title attribute from galleries
- How can I use a sliced image As banner? [closed]
- Help on Wp_query to print an term
- How to use Amazon Elastic Transcoder from WordPress using AWS SDK for PHP?
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- How do I change the Go To Categories link in the term_updated_messages
- Create a custom plugin with dynamic child pages listing database records