Support Forum
Hi, I've just been looking through my site and found some code that seems to be being inserted by MetaBox code below:
<script id="tmpl-rwmb-media-item" type="text/html">
<input type="hidden" name="{{{ data.controller.fieldName }}}" value="{{{ data.id }}}" class="rwmb-media-input">
<div class="rwmb-file-icon">
<# if ( data.sizes ) { #>
<# if ( data.sizes.thumbnail ) { #>
<img src="{{{ data.sizes.thumbnail.url }}}">
<# } else { #>
<img src="{{{ data.sizes.full.url }}}">
<# } #>
<# } else { #>
<# if ( data.image && data.image.src && data.image.src !== data.icon ) { #>
<img src="{{ data.image.src }}" />
<# } else { #>
<img src="{{ data.icon }}" />
<# } #>
<# } #>
</div>
<div class="rwmb-file-info">
<a href="{{{ data.url }}}" class="rwmb-file-title" target="_blank">
<# if( data.title ) { #>
{{{ data.title }}}
<# } else { #>
{{{ i18nRwmbMedia.noTitle }}}
<# } #>
</a>
<div class="rwmb-file-name">{{{ data.filename }}}</div>
<div class="rwmb-file-actions">
<a class="rwmb-edit-media" title="{{{ i18nRwmbMedia.edit }}}" href="{{{ data.editLink }}}" target="_blank">
{{{ i18nRwmbMedia.edit }}}
</a>
<a href="#" class="rwmb-remove-media" title="{{{ i18nRwmbMedia.remove }}}">
{{{ i18nRwmbMedia.remove }}}
</a>
</div>
</div>
</script>
<script id="tmpl-rwmb-media-status" type="text/html">
<# if ( data.maxFiles > 0 ) { #>
{{{ data.length }}}/{{{ data.maxFiles }}}
<# if ( 1 < data.maxFiles ) { #>{{{ i18nRwmbMedia.multiple }}}<# } else {#>{{{ i18nRwmbMedia.single }}}<# } #>
<# } #>
</script>
<script id="tmpl-rwmb-media-button" type="text/html">
<a class="button">{{{ data.text }}}</a>
</script>
<script id="tmpl-rwmb-image-item" type="text/html">
<input type="hidden" name="{{{ data.controller.fieldName }}}" value="{{{ data.id }}}" class="rwmb-media-input">
<div class="rwmb-file-icon">
<# if ( 'image' === data.type && data.sizes ) { #>
<# if ( data.sizes[data.controller.imageSize] ) { #>
<img src="{{{ data.sizes[data.controller.imageSize].url }}}">
<# } else { #>
<img src="{{{ data.sizes.full.url }}}">
<# } #>
<# } else { #>
<# if ( data.image && data.image.src && data.image.src !== data.icon ) { #>
<img src="{{ data.image.src }}" />
<# } else { #>
<img src="{{ data.icon }}" />
<# } #>
<# } #>
</div>
<div class="rwmb-image-overlay"></div>
<div class="rwmb-image-actions">
<a class="rwmb-image-edit rwmb-edit-media" title="{{{ i18nRwmbMedia.edit }}}" href="{{{ data.editLink }}}" target="_blank">
<span class="dashicons dashicons-edit"></span>
</a>
<a href="#" class="rwmb-image-delete rwmb-remove-media" title="{{{ i18nRwmbMedia.remove }}}">
<span class="dashicons dashicons-no-alt"></span>
</a>
</div>
</script>
Hello,
Do you add the frontend submission form on pages? I think there is a media field in the form like file
, file_upload
, image
... It supports uploading media files to the form on your site.
Hi Peter,
No I didn't. I'm not using Metabox anywhere on the front end. It never used to do this or I would have spotted it before. It does seem to be unique to this site though, so I'll have a look and see what I'm doing differently.
Hello,
If you are using Meta Box AIO, please go to Meta Box > Extensions > Disable extension MB Frontend Submission.
And also can deactivate all plugins except Meta Box, MB AIO, switch to another theme and check this issue again.
I can confirm that I don't have Front End submission installed (not using AIO). If I switch to 2021 Theme it doesn't show, but then that theme doesn't use Meta Box, so I wouldn't expect it to.
Looking at it, I'm fairly sure it's a mistake in where I've declared the metaboxes in my code. Troubleshooting now.
It looks like any time I include an image advanced field this code appears. I'm enabling them as shown below, have I missed something. I don't have this happening on any other site.
$meta_boxes[] = array(
'id' => $prefix . 'header_gallery',
'title' => esc_html__( 'Header Gallery', 'dlf' ),
'description' => esc_html__( 'Sliding images in the header', 'dlf' ),
'post_types' => array( 'post', 'page' ),
'context' => 'normal',
'priority' => 'high',
'fields' => array(
array(
'name' => esc_html__( 'Images', 'dlf' ),
'id' => $prefix . 'header_imgs',
'desc' => esc_html__( 'Scrolling images at the top of the page', 'dlf' ),
'type' => 'image_advanced',
),
),
);
Experienced same issue.
Hello,
I see that issue in the admin area. I will inform the development team to improve the field template loading in future updates.
Please do, it's very annoying and now happening on another site, so it looks like it's an issue with sites using image advanced anywhere on the site.
I'm experiencing the same issue on dozens of websites with Meta Box AIO installed. The Front End Submission is turned off everywhere.
I can confirm. I am experiencing the same issue. I use these Plugins:
mb-admin-columns
mb-blocks
mb-settings-page
mb-views
meta-box
meta-box-group
meta-box-include-exclude<