Curious if this is correct php for showing X to Z people.
I’ve made a custom Notification Loop inside the header of my site that should of course only be visible for logged-in users + only the notifications-list of the current loggedin_user_id.
This is what I made, first I check if user_is_logged in -> if TRUE start the has_notifications Loop of the user_id => loggedin_user_id.
Everything seems to work fine but I’m not very convinced I did this the correct way.
<?php if ( is_user_logged_in() ): ?> <?php if ( bp_has_notifications( array( 'user_id' => bp_loggedin_user_id() ) ) ): ?> ... here I've got the loop stuff ... <?php endif; ?> <?php endif; ?>
You must be logged in to reply to this topic.