All tags/Emoji
Shortcodes in text
The emoji pipe turns every shortcode in a text into its emoji - one it does not know, or a time like 10:30:00, stays as written.
<?php
// Messages as people type them, shortcodes and all.
$messages = [
[ 'who' => 'Ana', 'text' => 'The build is green :white_check_mark: shipping it :rocket:' ],
[ 'who' => 'Bram', 'text' => 'Nice work :clap: :clap:' ],
[ 'who' => 'Chen', 'text' => 'Coffee at 10:30:00? :coffee:' ],
[ 'who' => 'Dewi', 'text' => 'Count me in :raised_hand: - and :not_a_code: stays as it is' ],
];
?>
<ul style="list-style:none;margin:0;padding:0;max-width:30em;display:grid;gap:10px">
{messages}
<li style="padding:10px 14px;border-radius:14px;background:rgba(42,120,214,.1);line-height:1.5"><strong>{$who}</strong>: {$text | emoji}</li>
{/messages}
</ul>
- Ana: The build is green โ shipping it ๐
- Bram: Nice work ๐ ๐
- Chen: Coffee at 10:30:00? โ
- Dewi: Count me in โ - and :not_a_code: stays as it is