get_notes_with_name( $name ); if ( ! empty( $note_ids ) ) { return; } // Getting install timestamp reference class-wc-admin-install.php. $wc_admin_installed = get_option( 'wc_admin_install_timestamp', false ); if ( false === $wc_admin_installed ) { $wc_admin_installed = time(); update_option( 'wc_admin_install_timestamp', $wc_admin_installed ); } $current_time = time(); $three_days_in_seconds = 259200; // We need to show Admin Giving feeback notification after 3 days of install. if ( $current_time - $wc_admin_installed < $three_days_in_seconds ) { return; } // Otherwise, create our new note. $note = new WC_Admin_Note(); $note->set_title( __( 'Giving feedback', 'woocommerce-admin' ) ); $note->set_content( __( 'Are you enjoying the new WooCommerce experience? We\'d love to get your feedback.', 'woocommerce-admin' ) ); $note->set_content_data( (object) array() ); $note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); $note->set_icon( 'info' ); $note->set_name( $name ); $note->set_source( 'woocommerce-admin' ); $note->add_action( 'share-feedback', __( 'Share feedback', 'woocommerce-admin' ), 'https://github.com/woocommerce/woocommerce-admin/issues/new/choose' ); $note->save(); } }