WC_Helper_Updater::print_plugin_row_notice │ private static │ WC 11.2.0

Print a notice row underneath a plugin row, styled like the update rows Core renders.

Method of the class: WC_Helper_Updater{}

No Hooks.

Returns

void. Nothing (null).

Usage

$result = WC_Helper_Updater::print_plugin_row_notice( $plugin_file, $row_type, $notice ): void;
$plugin_file(string) (required)
Path to the plugin file relative to the plugins directory.
$row_type(string) (required)
Value for the data-plugin-row-type attribute.
$notice(string) (required)
The notice text, which may contain a single link.

Changelog

Since 11.2.0 Introduced.

WC_Helper_Updater::print_plugin_row_notice() code WC 11.2.2

private static function print_plugin_row_notice( $plugin_file, $row_type, $notice ): void {
	global $wp_list_table;

	printf(
		'<tr class="plugin-update-tr %1$s" data-plugin="%2$s" data-plugin-row-type="%3$s"><td colspan="%4$s" class="plugin-update colspanchange"><div class="update-message notice inline notice-warning notice-alt"><p>%5$s</p></div></td></tr>',
		esc_attr( ( is_network_admin() ? is_plugin_active_for_network( $plugin_file ) : is_plugin_active( $plugin_file ) ) ? 'active' : 'inactive' ),
		esc_attr( $plugin_file ),
		esc_attr( $row_type ),
		esc_attr( (string) $wp_list_table->get_column_count() ),
		self::kses_notice( $notice ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- kses_notice() escapes.
	);
}