AnsPress_Notification_Hook::notification_page()

Description #

Display reputation tab content in AnsPress author page.

Source #

File: addons/free/notification.php

	public static function notification_page() {
		$user_id = ap_current_user_id();
	 	$seen    = ap_sanitize_unslash( 'seen', 'r', 'all' );

		if ( get_current_user_id() === $user_id ) {
			$seen = 'all' === $seen ? null : (int) $seen;
			$notifications = new AnsPress_Notification_Query( [ 'user_id' => $user_id, 'seen' => $seen ] );

			do_action( 'ap_before_notification_page', $notifications );

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

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