Automattic\WooCommerce\Admin\Marketing

InstalledExtensions::get_pinterest_extension_data()protected staticWC 1.0

Get Pinterest extension data.

Method of the class: InstalledExtensions{}

No Hooks.

Return

Array|true|false.

Usage

$result = InstalledExtensions::get_pinterest_extension_data();

InstalledExtensions::get_pinterest_extension_data() code WC 7.1.0

protected static function get_pinterest_extension_data() {
	$slug = 'pinterest-for-woocommerce';

	if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
		return false;
	}

	$data         = self::get_extension_base_data( $slug );
	$data['icon'] = WC_ADMIN_IMAGES_FOLDER_URL . '/marketing/pinterest.svg';

	// TODO: Finalise docs url.
	$data['docsUrl'] = 'https://woocommerce.com/document/pinterest-for-woocommerce/?utm_medium=product';

	if ( 'activated' === $data['status'] && class_exists( 'Pinterest_For_Woocommerce' ) ) {
		$pinterest_onboarding_completed = Pinterest_For_Woocommerce()::is_setup_complete();
		if ( $pinterest_onboarding_completed ) {
			$data['status']      = 'configured';
			$data['settingsUrl'] = admin_url( 'admin.php?page=wc-admin&path=/pinterest/settings' );
		} else {
			$data['settingsUrl'] = admin_url( 'admin.php?page=wc-admin&path=/pinterest/landing' );
		}
	}

	return $data;
}