WC_Helper_Updater::add_install_marketplace_plugin_message
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.
Method of the class: WC_Helper_Updater{}
No Hooks.
Returns
null..
Usage
$result = WC_Helper_Updater::add_install_marketplace_plugin_message( $plugin_data, $response );
- $plugin_data(object) (required)
- TAn array of plugin metadata.
- $response(object) (required)
- An object of metadata about the available plugin update.
WC_Helper_Updater::add_install_marketplace_plugin_message() WC Helper Updater::add install marketplace plugin message code WC 10.8.1
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() ) {
esc_html_e( ' Activate WooCommerce.com Update Manager to update.', 'woocommerce' );
}
}