array( 'type' => 'success', 'message' => $message, 'options' => $options ) )); } else { echo ""; } } /** * Display an error toast notification * * @since 1.0.0 * @param string $message The message to display * @param array $options Additional options */ function easy_invoice_toast_error($message, $options = array()) { if (wp_doing_ajax()) { wp_send_json_error(array( 'toast' => array( 'type' => 'error', 'message' => $message, 'options' => $options ) )); } else { echo ""; } } /** * Display a warning toast notification * * @since 1.0.0 * @param string $message The message to display * @param array $options Additional options */ function easy_invoice_toast_warning($message, $options = array()) { if (wp_doing_ajax()) { wp_send_json_error(array( 'toast' => array( 'type' => 'warning', 'message' => $message, 'options' => $options ) )); } else { echo ""; } } /** * Display an info toast notification * * @since 1.0.0 * @param string $message The message to display * @param array $options Additional options */ function easy_invoice_toast_info($message, $options = array()) { if (wp_doing_ajax()) { wp_send_json_success(array( 'toast' => array( 'type' => 'info', 'message' => $message, 'options' => $options ) )); } else { echo ""; } }