Automattic\WooCommerce

Packages::display_notice_for_merged_plugins()public staticWC 1.0

Displays a maintenance notice next to merged plugins, to inform users that the plugin functionality is now offered by WooCommerce core.

Requires 'mark_merged_plugins_as_pending_update' to properly display this notice.

Method of the class: Packages{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = Packages::display_notice_for_merged_plugins( $plugin_file );
$plugin_file(string) (required)
Plugin file.

Packages::display_notice_for_merged_plugins() code WC 9.6.1

public static function display_notice_for_merged_plugins( $plugin_file ) {
	global $wp_list_table;

	$plugin_dir = basename( dirname( $plugin_file ) );
	if ( ! self::is_package_enabled( $plugin_dir ) || is_null( $wp_list_table ) ) {
		return;
	}

	$columns_count = $wp_list_table->get_column_count();
	$notice        = __( 'This plugin can no longer be activated because its functionality is now included in <strong>WooCommerce</strong>. It is recommended to <strong>delete</strong> it.', 'woocommerce' );
	echo '<tr class="plugin-update-tr"><td colspan="' . esc_attr( $columns_count ) . '" class="plugin-update"><div class="update-message notice inline notice-error notice-alt"><p>' . wp_kses_post( $notice ) . '</p></div></td></tr>';
}