install_plugins_upload

函数
install_plugins_upload ( No parameters )

install_plugins_upload: 这个函数用来从ZIP文件中上传和安装一个WordPress插件。

显示一个从压缩文件上传插件的表格。

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 esc_url( 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
}

常见问题

FAQs
查看更多 >