'
. '
'
. '';
}
return '
';
}
/**
* The "Beep!" brand wordmark shown at the bottom-right of every beep and reply.
*
* Rendered as a crisp inline SVG recreation of the 3D extruded brand logo —
* a blue-violet face with a darker-blue depth and navy outline.
* To swap in the PNG here instead, hook the filter:
* add_filter('beep_post_wordmark', fn() => '');
*/
function beep_post_wordmark() {
// Build the 3D extrusion: stacked copies offset down-left, deepest first.
$depth = 7;
$extrude = '';
for ( $i = $depth; $i >= 1; $i-- ) {
$x = 9 - $i;
$y = 49 + $i;
$extrude .= '
for a user.
*
* @param int $user_id User ID (0 = anonymous → brand bird).
* @param string $class Extra class, e.g. 'beep-avatar-sm'.
*/
function beep_avatar_img( $user_id, $class = '' ) {
list( $url, $filter ) = beep_avatar_url( $user_id );
$classes = trim( 'beep-avatar ' . $class );
$style = $filter ? ' style="filter:' . esc_attr( $filter ) . ';"' : '';
return '
';
}
/**
* Is this user banned from posting/liking/replying?
*/
function beep_user_is_banned($user_id) {
if (!$user_id) {
return false;
}
return get_user_meta($user_id, 'beep_banned', true) === '1';
}
/**
* Render the composer textarea (for logged-in, non-banned users).
*/
function beep_render_composer() {
if ( ! is_user_logged_in() || beep_user_is_banned( get_current_user_id() ) ) {
return '';
}
$avatar = beep_avatar_img( get_current_user_id() );
ob_start();
?>
'
. ''
. '';
}
function beep_relative_time($timestamp) {
$now = time();
$diff = $now - $timestamp;
if ($diff < 0) {
$diff = 0;
}
if ($diff < 60) {
return $diff . 's';
}
if ($diff < 3600) {
return floor($diff / 60) . 'm';
}
if ($diff < 86400) {
return floor($diff / 3600) . 'h';
}
if ($diff < 604800) {
return floor($diff / 86400) . 'd';
}
return gmdate('M j', $timestamp);
}
function beep_icon($name) {
$icons = [
'reply' => '',
'retweet' => '',
'heart' => '',
'heart_filled' => '',
'share' => '',
];
return isset($icons[$name]) ? $icons[$name] : '';
}
/**
* Render the thread/conversation modal (sits outside individual posts).
*/
function beep_render_thread_modal() {
return '