bp_invite_show_data( $column, $post_id )
Display data by column and post id.
Description
Parameters
- $column
-
(Required)
- $post_id
-
(Required)
Source
File: bp-invites/bp-invites-admin.php
function bp_invite_show_data( $column, $post_id ) {
switch( $column ) {
case 'inviter':
$author_id = get_post_field ('post_author', $post_id );
$inviter_link = bp_core_get_user_domain( $author_id );
$inviter_name = bp_core_get_user_displayname( $author_id );
printf(
'<strong>%s<a href="%s">%s</a></strong>',
get_avatar( $author_id, '32' ),esc_url( $inviter_link ), $inviter_name
);
break;
case 'invitee_name':
echo get_post_meta( $post_id, '_bp_invitee_name', true );
break;
case 'invitee_email':
echo get_post_meta( $post_id, '_bp_invitee_email', true );
break;
case 'date_invited':
$date = get_the_date( '',$post_id );
echo $date;
break;
case 'status':
$title = ( '1' === get_post_meta( $post_id, '_bp_invitee_status', true ) ) ? __( 'Registered', 'buddyboss' ) : __( 'Pending – Revoke Invite', 'buddyboss' );
if ( '1' === get_post_meta( $post_id, '_bp_invitee_status', true ) ) {
printf(
'<a href="javascript:void(0);">%s</a>',
$title
);
} else {
$redirect_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$revoke_link = bp_core_get_user_domain( bp_loggedin_user_id() ) . bp_get_invites_slug() . '/revoke-invite-admin/?id=' . $post_id . '&redirect=' .$redirect_link;
$confirm_title = __( 'Are you sure you want to revoke this invitation?', 'buddyboss' );
?>
<a onclick="return confirm('<?php echo esc_attr( $confirm_title ) ?>')" href="<?php echo esc_url( $revoke_link ); ?>"><?php echo esc_html( $title ); ?></a>
<?php
}
break;
}
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.