slug = (string) $slug; $this->args = array_merge( array( 'title' => '', 'content' => '', 'cta_url' => '', 'cta_label' => '', 'cta_target' => '', 'learn_more_url' => '', 'learn_more_label' => '', 'dismissible' => false, 'dismiss_label' => __( 'Dismiss', 'google-site-kit' ), ), $args ); } /** * Gets the notification's slug. * * @since 1.4.0 * * @return string Unique notification slug. */ public function get_slug() { return $this->slug; } /** * Prepares the JS representation of the Notification. * * @since 1.4.0 * * @return array */ public function prepare_for_js() { return array( 'id' => $this->get_slug(), 'title' => $this->args['title'], 'content' => $this->args['content'], 'ctaURL' => $this->args['cta_url'], 'ctaLabel' => $this->args['cta_label'], 'ctaTarget' => $this->args['cta_target'], 'learnMoreURL' => $this->args['learn_more_url'], 'learnMoreLabel' => $this->args['learn_more_label'], 'dismissible' => $this->args['dismissible'], 'dismissLabel' => $this->args['dismiss_label'], ); } }