<?php
namespace Automattic\WooCommerce\Admin\Notes;
use WC_Site_Tracking;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Notes {
const UNSNOOZE_HOOK = 'wc_admin_unsnooze_admin_notes';
public static function init() {
add_action( 'admin_init', array( __CLASS__, 'schedule_unsnooze_notes' ) );
add_action( 'admin_init', array( __CLASS__, 'possibly_delete_survey_notes' ) );
add_action( 'update_option_woocommerce_show_marketplace_suggestions', array( __CLASS__, 'possibly_delete_marketing_notes' ), 10, 2 );
add_action( self::UNSNOOZE_HOOK, array( __CLASS__, 'unsnooze_notes' ) );
}
public static function get_notes( $context = 'edit', $args = array() ) {
$data_store = self::load_data_store();
$raw_notes = $data_store->get_notes( $args );
$notes = array();
foreach ( (array) $raw_notes as $raw_note ) {
try {
$note = new Note( $raw_note );