Notifications::notification_page()

Description #

Display reputation tab content in AnsPress author page.

Source #

File: addons/notifications/notifications.php

	public function notification_page() {
		$user_id = ap_current_user_id();
		$seen    = ! empty( ap_sanitize_unslash( 'seen', 'r' ) ) ? ap_sanitize_unslash( 'seen', 'r', 'all' ) : 0;

		if ( get_current_user_id() === $user_id ) {
			$seen          = 'all' === $seen ? null : (int) $seen;
			$notifications = new \AnsPress\Notifications(
				array(
					'user_id' => $user_id,
					'seen'    => $seen,
				)
			);

			do_action( 'ap_before_notification_page', $notifications );

			include ap_get_theme_location( 'addons/notification/index.php' );
		} else {
			esc_attr_e( 'You do not have permission to view this page', 'anspress-question-answer' );
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment