WC_Helper_Updater::add_install_marketplace_plugin_message()public staticWC 1.0

Runs on in_plugin_update_message-{file-name}, show a message to install the Woo Marketplace plugin, on plugin update notification, if the Woo Marketplace plugin isn't already installed.

Метод класса: WC_Helper_Updater{}

Хуков нет.

Возвращает

null..

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

$result = WC_Helper_Updater::add_install_marketplace_plugin_message( $plugin_data, $response );
$plugin_data(объект) (обязательный)
TAn array of plugin metadata.
$response(объект) (обязательный)
An object of metadata about the available plugin update.

Код WC_Helper_Updater::add_install_marketplace_plugin_message() WC 9.4.2

public static function add_install_marketplace_plugin_message( $plugin_data, $response ) {
	if ( ! empty( $response->package ) || WC_Woo_Update_Manager_Plugin::is_plugin_active() ) {
		return;
	}

	if ( ! WC_Woo_Update_Manager_Plugin::is_plugin_installed() ) {
		printf(
			wp_kses(
				/* translators: 1: Woo Update Manager plugin install URL */
				__( ' <a href="%1$s">Install WooCommerce.com Update Manager</a> to update.', 'woocommerce' ),
				array(
					'a' => array(
						'href' => array(),
					),
				)
			),
			esc_url( WC_Woo_Update_Manager_Plugin::generate_install_url() ),
		);
		return;
	}

	if ( ! WC_Woo_Update_Manager_Plugin::is_plugin_active() ) {
		echo esc_html_e( ' Activate WooCommerce.com Update Manager to update.', 'woocommerce' );
	}
}