wp_plugin_update_rows() WordPress Function

The wp_plugin_update_rows() function is used to update the database row for a given plugin. It is typically used when a new plugin version is released. This function accepts two parameters: the first is the plugin slug, and the second is an array of data to be updated. The data array can contain any of the following keys: 'name' - the plugin's name 'plugin_uri' - the plugin's URI 'version' - the plugin's new version 'author' - the plugin's author 'author_uri' - the plugin's author URI 'network' - whether the plugin is network-activated 'requires_wp_version' - the minimum WordPress version required 'requires_php_version' - the minimum PHP version required 'updated' - the date the plugin was last updated 'upgrade_notice' - any special notes for upgrading to the new version If the plugin slug is not specified, the function will return false. Otherwise, it will return true on success or false on failure.

wp_plugin_update_rows() #


Source

File: wp-admin/includes/update.php

function wp_plugin_update_rows() {
	if ( ! current_user_can( 'update_plugins' ) ) {
		return;
	}

	$plugins = get_site_transient( 'update_plugins' );
	if ( isset( $plugins->response ) && is_array( $plugins->response ) ) {
		$plugins = array_keys( $plugins->response );
		foreach ( $plugins as $plugin_file ) {
			add_action( "after_plugin_row_{$plugin_file}", 'wp_plugin_update_row', 10, 2 );
		}
	}
}


Top ↑

Changelog

Changelog
VersionDescription
2.9.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.