install_plugins_upload() WordPress Function

This function installs a plugin from an uploaded Zip file. If a plugin with the same name is already installed, it will be overwritten.

install_plugins_upload() #

Displays a form to upload plugins from zip files.


Source

File: wp-admin/includes/plugin-install.php

function install_plugins_upload() {
	?>
<div class="upload-plugin">
	<p class="install-help"><?php _e( 'If you have a plugin 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-plugin' ); ?>">
		<?php wp_nonce_field( 'plugin-upload' ); ?>
		<label class="screen-reader-text" for="pluginzip"><?php _e( 'Plugin zip file' ); ?></label>
		<input type="file" id="pluginzip" name="pluginzip" accept=".zip" />
		<?php submit_button( __( 'Install Now' ), '', 'install-plugin-submit', false ); ?>
	</form>
</div>
	<?php
}


Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.