Replies: 0
Hello,
I’m using meta box image advanced filed to add some images to my custom posts and I use Lightbox to show them.
The problem is that when the image has an apostrophe in the title, the title is trimmed.
So, for example, if the title is “let’s go”, the title become “let” and everything after the apostrophe disappears.
I thought that the problem was the lightbox but I’ve noticed that if I add the image in an post not using meta box there are not problems in showing the title with the apostrophe.
To add the image in the post I use this code
$images = rwmb_meta( 'base_images' );
if ($images != null){
echo "<h3 class='info'>Immagini</h3><br />";
foreach ( $images as $image )
{
echo "<a href='{$image['full_url']}' title='{$image['title']}' rel='lightbox'><img style='padding:5px' src='{$image['url']}' alt='{$image['alt']}' /></a>";
}
and the metabox code is this:
array(
'name' => esc_html__( 'Aggiungi Immagini', 'base_' ),
'id' => "{$prefix}images",
'type' => 'image_advanced',
'width' => 100,
'height' => 'auto',
'max_file_uploads' => 20,
),
The only way to see the apostrophe is to write the in title & apos; or & #039; instead of the ‘ but this is something I’d like to avoid.
What I miss? How can I have this fixed?
Thank you
-
This topic was modified 1 minute ago by
xxkiefxx.