WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта
функция не описана

Automattic\WooCommerce\Admin\Notes

MarketingJetpack::possibly_add_note() public WC 1.0

Maybe add a note on Jetpack Backups for Jetpack sites older than a week without Backups.

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

Хуков нет.

Возвращает

null. Ничего.

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

$result = MarketingJetpack::possibly_add_note();

Код MarketingJetpack::possibly_add_note() WC 5.5.2

<?php
public static function possibly_add_note() {
	/**
	 * Check if Jetpack is installed.
	 */
	$installed_plugins = PluginsHelper::get_installed_plugin_slugs();
	if ( ! in_array( 'jetpack', $installed_plugins, true ) ) {
		return;
	}

	$data_store = \WC_Data_Store::load( 'admin-note' );

	// Do we already have this note?
	$note_ids = $data_store->get_notes_with_name( self::NOTE_NAME );
	if ( ! empty( $note_ids ) ) {

		$note_id = array_pop( $note_ids );
		$note    = Notes::get_note( $note_id );
		if ( false === $note ) {
			return;
		}

		// If Jetpack Backups was purchased after the note was created, mark this note as actioned.
		if ( self::has_backups() && Note::E_WC_ADMIN_NOTE_ACTIONED !== $note->get_status() ) {
			$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
			$note->save();
		}

		return;
	}

	// Check requirements.
	if ( ! self::wc_admin_active_for( WEEK_IN_SECONDS ) || ! self::can_be_added() || self::has_backups() ) {
		return;
	}

	// Add note.
	$note = self::get_note();
	$note->save();
}