install_themes_upload() WordPress Function
The install_themes_upload() function installs a theme from an uploaded ZIP file. This function is only available to administrators.
install_themes_upload() #
Source
File: wp-admin/includes/theme-install.php
function install_themes_upload() { ?> <p class="install-help"><?php _e( 'If you have a theme in a .zip format, you may install or update it by uploading it here.' ); ?></p> <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-theme' ); ?>"> <?php wp_nonce_field( 'theme-upload' ); ?> <label class="screen-reader-text" for="themezip"><?php _e( 'Theme zip file' ); ?></label> <input type="file" id="themezip" name="themezip" accept=".zip" /> <?php submit_button( __( 'Install Now' ), '', 'install-theme-submit', false ); ?> </form> <?php }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.8.0 | Introduced. |