WC_Install::delete_obsolete_notes()public staticWC 1.0

Delete obsolete notes.

{} Это метод класса: WC_Install{}

Хуки из метода

Возвращает

null. Ничего.

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

$result = WC_Install::delete_obsolete_notes();

Код WC_Install::delete_obsolete_notes() WC 6.8.0

public static function delete_obsolete_notes() {
	global $wpdb;
	$obsolete_notes_names = array(
		'wc-admin-welcome-note',
		'wc-admin-store-notice-setting-moved',
		'wc-admin-store-notice-giving-feedback',
		'wc-admin-learn-more-about-product-settings',
		'wc-admin-onboarding-profiler-reminder',
		'wc-admin-historical-data',
		'wc-admin-review-shipping-settings',
		'wc-admin-home-screen-feedback',
		'wc-admin-effortless-payments-by-mollie',
		'wc-admin-google-ads-and-marketing',
		'wc-admin-marketing-intro',
		'wc-admin-draw-attention',
		'wc-admin-need-some-inspiration',
		'wc-admin-choose-niche',
		'wc-admin-start-dropshipping-business',
		'wc-admin-filter-by-product-variations-in-reports',
		'wc-admin-learn-more-about-variable-products',
		'wc-admin-getting-started-ecommerce-webinar',
		'wc-admin-navigation-feedback',
		'wc-admin-navigation-feedback-follow-up',
		'wc-admin-set-up-additional-payment-types',
		'wc-admin-deactivate-plugin',
	);

	/**
	 * An array of deprecated notes to delete on update.
	 *
	 * @since 6.5.0
	 */
	$additional_obsolete_notes_names = apply_filters(
		'woocommerce_admin_obsolete_notes_names',
		array()
	);

	if ( is_array( $additional_obsolete_notes_names ) ) {
		$obsolete_notes_names = array_merge(
			$obsolete_notes_names,
			$additional_obsolete_notes_names
		);
	}

	foreach ( $obsolete_notes_names as $obsolete_notes_name ) {
		$wpdb->delete( $wpdb->prefix . 'wc_admin_notes', array( 'name' => $obsolete_notes_name ) );
		$wpdb->delete( $wpdb->prefix . 'wc_admin_note_actions', array( 'name' => $obsolete_notes_name ) );
	}
}