wp/wp-admin/update.php
changeset 19 3d72ae0968f4
parent 16 a86126ab1dd4
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    57 			wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
    57 			wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
    58 		}
    58 		}
    59 
    59 
    60 		check_admin_referer( 'upgrade-plugin_' . $plugin );
    60 		check_admin_referer( 'upgrade-plugin_' . $plugin );
    61 
    61 
       
    62 		// Used in the HTML title tag.
    62 		$title        = __( 'Update Plugin' );
    63 		$title        = __( 'Update Plugin' );
    63 		$parent_file  = 'plugins.php';
    64 		$parent_file  = 'plugins.php';
    64 		$submenu_file = 'plugins.php';
    65 		$submenu_file = 'plugins.php';
    65 
    66 
    66 		wp_enqueue_script( 'updates' );
    67 		wp_enqueue_script( 'updates' );
   121 
   122 
   122 		if ( is_wp_error( $api ) ) {
   123 		if ( is_wp_error( $api ) ) {
   123 			wp_die( $api );
   124 			wp_die( $api );
   124 		}
   125 		}
   125 
   126 
       
   127 		// Used in the HTML title tag.
   126 		$title        = __( 'Plugin Installation' );
   128 		$title        = __( 'Plugin Installation' );
   127 		$parent_file  = 'plugins.php';
   129 		$parent_file  = 'plugins.php';
   128 		$submenu_file = 'plugin-install.php';
   130 		$submenu_file = 'plugin-install.php';
       
   131 
   129 		require_once ABSPATH . 'wp-admin/admin-header.php';
   132 		require_once ABSPATH . 'wp-admin/admin-header.php';
   130 
   133 
   131 		/* translators: %s: Plugin name and version. */
   134 		/* translators: %s: Plugin name and version. */
   132 		$title = sprintf( __( 'Installing Plugin: %s' ), $api->name . ' ' . $api->version );
   135 		$title = sprintf( __( 'Installing Plugin: %s' ), $api->name . ' ' . $api->version );
   133 		$nonce = 'install-plugin_' . $plugin;
   136 		$nonce = 'install-plugin_' . $plugin;
   151 
   154 
   152 		check_admin_referer( 'plugin-upload' );
   155 		check_admin_referer( 'plugin-upload' );
   153 
   156 
   154 		$file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' );
   157 		$file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' );
   155 
   158 
       
   159 		// Used in the HTML title tag.
   156 		$title        = __( 'Upload Plugin' );
   160 		$title        = __( 'Upload Plugin' );
   157 		$parent_file  = 'plugins.php';
   161 		$parent_file  = 'plugins.php';
   158 		$submenu_file = 'plugin-install.php';
   162 		$submenu_file = 'plugin-install.php';
       
   163 
   159 		require_once ABSPATH . 'wp-admin/admin-header.php';
   164 		require_once ABSPATH . 'wp-admin/admin-header.php';
   160 
   165 
   161 		/* translators: %s: File name. */
   166 		/* translators: %s: File name. */
   162 		$title = sprintf( __( 'Installing plugin from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) );
   167 		$title = sprintf( __( 'Installing plugin from uploaded file: %s' ), esc_html( basename( $file_upload->filename ) ) );
   163 		$nonce = 'plugin-upload';
   168 		$nonce = 'plugin-upload';
   204 
   209 
   205 		check_admin_referer( 'upgrade-theme_' . $theme );
   210 		check_admin_referer( 'upgrade-theme_' . $theme );
   206 
   211 
   207 		wp_enqueue_script( 'updates' );
   212 		wp_enqueue_script( 'updates' );
   208 
   213 
       
   214 		// Used in the HTML title tag.
   209 		$title        = __( 'Update Theme' );
   215 		$title        = __( 'Update Theme' );
   210 		$parent_file  = 'themes.php';
   216 		$parent_file  = 'themes.php';
   211 		$submenu_file = 'themes.php';
   217 		$submenu_file = 'themes.php';
       
   218 
   212 		require_once ABSPATH . 'wp-admin/admin-header.php';
   219 		require_once ABSPATH . 'wp-admin/admin-header.php';
   213 
   220 
   214 		$nonce = 'upgrade-theme_' . $theme;
   221 		$nonce = 'upgrade-theme_' . $theme;
   215 		$url   = 'update.php?action=upgrade-theme&theme=' . urlencode( $theme );
   222 		$url   = 'update.php?action=upgrade-theme&theme=' . urlencode( $theme );
   216 
   223 
   267 
   274 
   268 		if ( is_wp_error( $api ) ) {
   275 		if ( is_wp_error( $api ) ) {
   269 			wp_die( $api );
   276 			wp_die( $api );
   270 		}
   277 		}
   271 
   278 
       
   279 		// Used in the HTML title tag.
   272 		$title        = __( 'Install Themes' );
   280 		$title        = __( 'Install Themes' );
   273 		$parent_file  = 'themes.php';
   281 		$parent_file  = 'themes.php';
   274 		$submenu_file = 'themes.php';
   282 		$submenu_file = 'themes.php';
       
   283 
   275 		require_once ABSPATH . 'wp-admin/admin-header.php';
   284 		require_once ABSPATH . 'wp-admin/admin-header.php';
   276 
   285 
   277 		/* translators: %s: Theme name and version. */
   286 		/* translators: %s: Theme name and version. */
   278 		$title = sprintf( __( 'Installing Theme: %s' ), $api->name . ' ' . $api->version );
   287 		$title = sprintf( __( 'Installing Theme: %s' ), $api->name . ' ' . $api->version );
   279 		$nonce = 'install-theme_' . $theme;
   288 		$nonce = 'install-theme_' . $theme;
   293 
   302 
   294 		check_admin_referer( 'theme-upload' );
   303 		check_admin_referer( 'theme-upload' );
   295 
   304 
   296 		$file_upload = new File_Upload_Upgrader( 'themezip', 'package' );
   305 		$file_upload = new File_Upload_Upgrader( 'themezip', 'package' );
   297 
   306 
       
   307 		// Used in the HTML title tag.
   298 		$title        = __( 'Upload Theme' );
   308 		$title        = __( 'Upload Theme' );
   299 		$parent_file  = 'themes.php';
   309 		$parent_file  = 'themes.php';
   300 		$submenu_file = 'theme-install.php';
   310 		$submenu_file = 'theme-install.php';
   301 
   311 
   302 		require_once ABSPATH . 'wp-admin/admin-header.php';
   312 		require_once ABSPATH . 'wp-admin/admin-header.php';