<?php
/**
* Handles storage and retrieval of admin notes
*/
namespace Automattic\WooCommerce\Admin\Notes;
use WC_Site_Tracking;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Admin Notes class.
*/
class Notes {
/**
* Hook used for recurring "unsnooze" action.
*/
const UNSNOOZE_HOOK = 'wc_admin_unsnooze_admin_notes';
/**
* Hook appropriate actions.
*/
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' ) );
}
/**
* Get notes from the database.
*
* @param string $context Getting notes for what context. Valid values: view, edit.
* @param array $args Arguments to pass to the query( e.g. per_page and page).
* @return array Array of arrays.
*/
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 );
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX