Unnecessary code on every page
- This topic has 11 replies, 5 voices, and was last updated 1 year, 7 months ago by
Aaron Kessler.
-
AuthorPosts
-
August 12, 2023 at 12:16 AM #42900
chillifish
ParticipantHi, 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>
August 12, 2023 at 10:58 PM #42904Peter
ModeratorHello,
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.August 14, 2023 at 9:56 PM #42910chillifish
ParticipantHi 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.
August 14, 2023 at 10:39 PM #42914Peter
ModeratorHello,
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.August 14, 2023 at 10:51 PM #42915chillifish
ParticipantI 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.
August 14, 2023 at 11:06 PM #42917chillifish
ParticipantLooking at it, I'm fairly sure it's a mistake in where I've declared the metaboxes in my code. Troubleshooting now.
August 14, 2023 at 11:16 PM #42918chillifish
ParticipantIt 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', ), ), );
August 15, 2023 at 1:55 AM #42922kiterocket-dev
ParticipantExperienced same issue.
August 15, 2023 at 9:47 PM #42925Peter
ModeratorHello,
I see that issue in the admin area. I will inform the development team to improve the field template loading in future updates.
August 18, 2023 at 5:57 PM #42972chillifish
ParticipantPlease 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.
August 22, 2023 at 9:24 PM #43001Key_Webdesign
ParticipantI'm experiencing the same issue on dozens of websites with Meta Box AIO installed. The Front End Submission is turned off everywhere.
August 29, 2023 at 9:34 PM #43079Aaron Kessler
ParticipantI 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< -
AuthorPosts
- You must be logged in to reply to this topic.