It’s sometimes easier to work with sprintf()
:
'Default' => sprintf(
'<img src="https://wordpress.stackexchange.com/questions/213508/%s/admin/images/default.png"
width="120"
height="80"
alt="%s"
/>',
get_template_directory(),
esc_attr__( 'Default', 'my_theme' )
);
where we use the esc_attr__()
to return a translated value that’s safe to be used in an attribute, but I’m not sure what your THEMEROOT
contains, so I just replaced it with get_template_directory()
.
Related Posts:
- How to add qtranslate multi language support for media?
- How to translate get_intermediate_image_sizes?
- show hide image script after 4 seconds [closed]
- How do I disable responsive images in WP 4.4?
- Set default image sizes in WordPress to hard crop
- How to delete resized (cropped) image uploads and prevent future resizing?
- After Moving a Site to Another Domain, All Images Are Lost
- How to display a page’s featured image?
- Featured image shortcode
- How to find attachment by it’s name?
- Change html structure of all img tags in WordPress
- Theme Customiser Image Control
- How to disable “insert into post” only when selecting the Featured Image?
- Is there a way to define a default caption to all uploaded images
- How can I add the “Use as featured image” to a custom metabox?
- How to increase media image scale limit?
- Dynamic-Image-Resize Plugin does not output anything
- How to default all users to no link for attachments?
- How to output placeholder image if no featured image set?
- Cannot access the thumbnails of attachment images… Cannot find the reason
- How to place an image into header.php? [closed]
- Uploading an image as featured image from frontend form
- @wordpress/create-block image url in css
- How does WordPress work out the srcsets?
- How to include a picture in a blog post such that it will show in Facebook?
- Remove ‘wp-content/themes/themename/’ from Image path
- Why html tags are being appended to my pictures?
- Restrict Image Uploads to a Certain File Type
- How to create a simple slideshow out of a post image gallery?
- Lazyload post thumbnails
- Is there a way to change wordpress image resize settings?
- wordpress media library shows empty images
- How to change the target size of images clicked on in WordPress standard gallery
- Adding different backgrounds for different pages
- Mobile Featured Image Bug
- How to display alt tags in img src?
- If Media Type .GIF
- Migrate image from my old blog
- the_post_thumbnail() image sizing problem?
- Imagick vs GD colour issues on image uploads
- How to add image and featured image to post by WP REST API
- Jetpack’s photon causes local site to try and serve images from WordPress CDN [closed]
- How to stop wordpress always displaying full-res images
- Get ALT attribute from title post (code not work)
- Why it doesn’t show media urls on rest Api? (WordPress)
- Resize images in existing posts
- WordPress PNG compression issue
- “Unable to create new image” error in wordpress dashboard image editor
- Fallback image size when using wp_get_attachment_image_src / full size compressed image
- Rewrite all article pictures to link to file
- Upload box media size not working
- Featured images disappear after DB export/import?
- How can I add a ‘Click to Enlarge Image’ feature, with the enlarged image opening in a popup?
- Is there a resolution limit in image resize?
- Images give 404 after changing default domain
- Load Gallery Images with Title on Homepage BX Slider
- Resize images in batch
- How can I check if the first block is an image aligned left or right?
- How would you add sequentially numbered labels to images in posts?
- Advice on image heavy site, compression and slow page loads
- Blurry images when using add_image_size with crop
- Auto delete pictures in media library by age
- Can wp_get_image_editor convert to icon?
- How to get image URL from media_sideload_image?
- Can’t get text to wrap around image
- Allow SVG in WP step by step
- Serve different images per screen size and cache possible?
- Product Images Low Quality After Updating From WP 3.5 to 4 [closed]
- Auto-crop width, not height
- Convert featured images into “product images”
- Making a parent directory writable by the server
- Having an issue in compressing Images in wordpress site
- Word press cutting sliding images – not displaying the entire image
- Show featured image in all posts
- How to re-arrange images in default WP Gallery more than one image at once?
- Image links broken / “DNS Update Required” message
- Convert multiple image blocks to gallery block in Gutenberg?
- WordPress After migration some images src is empty
- Image sizes reset when changing theme
- How to get featured image of last post in a category?
- How can I add “alt” tag to element?
- After moving a site to new hosting, not all images are showing in media library
- How to inject alt and title attributes for every image in each post into HTML?
- Custom Background for each page and post
- How can the alt be added to this wooCommerce category image?
- Displaying “alt” attribute text as captions?
- How to make Facebook share the featuterd image from url on WordPress
- After I upload a file to library its name converted to dashes
- Image to only show up in the single post page, not on the blog/home page
- Delete images of a particular size
- Images not rendering
- Add category description to list of category with taxonomy image
- Images in sub-pages fail to load
- How do add custom class and id to the that is generated from media gallery insert image into post [duplicate]
- How do I get the URL of only the first picture in a WordPress post?
- Images getting corrupt automatically
- Thumbnail size keeps resetting automatically
- WordPress Theme: replace logo image with title site if file doesn´t exist on server
- WordPress update leads to 404 error on admin page and signup. CSS mishap with all plugin related functions
- How to get dimension of Logo and Crest