Hi. there is few lines of html comments created by the layout plugin i guess. is there any way to remove those ? i like my source code to be clean, third party remove html comment unable to remove this strangely.
Thanks.
Hi Dee,
Thanks for asking! I'd be happy to help.
Can you please share a link to the page or a screenshot, to see the comment lines you're referring to?
I'll be in a better position to guide you accordingly.
regards,
Waqar
hi. you need to view the source .
sample here: enlace oculto
i am guessing its created by toolset plugin when the css/js tab is used.
is there any way to remove them ? any existing hooks ? or regex fn ?
thanks
Hi Dee,
Thank you for sharing the screenshot.
Those HTML comments are added wrapped around the custom CSS and JS code, which is added through view's "CSS editor" and "JS editor" tabs, respectively.
Unfortunately, there is no filter or hook available to suppress or remove them, but if you'd prefer not to have them on your pages, you can remove any custom CSS and JS code that exists in your views and load them through third-party plugins like:
https://wordpress.org/plugins/wp-add-custom-css/
https://wordpress.org/plugins/custom-css-js/
regards,
Waqar
Hi ,
thanks for sharing the other approach. make sense as i already have those plugins.
is there anyway to disable toolset css, jss tabs when editing ? [so wont cause confusion]
how about if we can comment out some line in the code that generating this comments manually ,
i'm sure that i need to make this changes every time i update toolset.
thanks
Hi Dee,
You can add the following code in the active theme's "functions.php" file to hide the "CSS editor" and "JS editor" tabs, from the view's edit screen:
add_action('admin_head', 'my_custom_admin_styles');
function my_custom_admin_styles() {
echo '<style>
.toolset_page_views-editor .wpv-editor-metadata-toggle[data-instance="filter-css-editor"],
.toolset_page_views-editor .wpv-editor-metadata-toggle[data-instance="filter-js-editor"] {
display: none;
}
</style>';
}
If you're fine with the unrecommended approach of editing the core plugin files to remove those HTML comments, you'll find the multiple instances in the file:
wp-views/embedded/inc/wpv.class.php
(just search for the string "views-extra-css")
regards,
Waqar
wow, youre still here !
Ill check the approach and update you soon.
Have a good rest Waqar .
Thank you so much, Dee and I'll wait for an update.
You're welcome to open a new ticket for a different question/concern.
regards,
Waqar
hi Waqar, i manage to remove most of them, except from content template
/* ----------------------------------------- */
/* Content Template: GALLERY start */
/* ----------------------------------------- */
thanks.
Hi Dee,
You'll find the code for that comment in the file:
wp-views/embedded/inc/views-templates/wpv-template.class.php
(just search for the string "Content Template:")
Note: to find specific strings or block of code, I use "NetBeans IDE" ( enlace oculto ) since it allows text search across the entire project. You can add specific plugin's folder as a project and then perform a search, as needed.
regards,
Waqar
My issue is resolved now. Thank you!