wp_plugin_update_rows()WP 2.9.0

Adds a callback to display update information for plugins with updates available.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wp_plugin_update_rows();

Список изменений

С версии 2.9.0 Введена.

Код wp_plugin_update_rows() WP 6.5.2

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 );
		}
	}
}