Show Image Using Meta Value in Metabox?

Support General Show Image Using Meta Value in Metabox?Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #44395
    Andrew TegenkampAndrew Tegenkamp
    Participant

    Is it possible to have an image show up based on a meta value? For example, if I have the meta_key image_test, and it stores "toolbox.gif" for a post, can I show that image in the admin?

    I started with something like this but am not sure how to make it dynamic. I'm guessing it part of the name or desc since those take HTML but I'm fine with it as whatever, so long as it can show the image in the post editor.

    
    			[
    				'id'   => 'image_test',
    				'type' => 'text',
    				'name' => '<img src="/archive/images/page/toolbox.gif"></img>',
    			],
    
    #44402
    PeterPeter
    Moderator

    Hello,

    The image field value doesn't show in the field name like that. If you want to display it in the Gutenberg editor in the admin area, you can use a custom block. Please follow the documentation https://docs.metabox.io/extensions/mb-blocks/

    #44409
    Andrew TegenkampAndrew Tegenkamp
    Participant

    Thanks. I wasn't sure, but was able to create a custom field type using https://docs.metabox.io/creating-new-field-types/ as that met my needs better.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.