Hi,
I have looked at the source code of a almost finished website I have built with TVC-toolset, and I noticed some CSS and JS is included of the Views plugin.
In this topic: https://toolset.com/forums/topic/remove-unneccessary-css-files/, I found this to paste in my functions.php file, I understand this 100%:
// dequeue wp-types front-end scripts and stylesheets
add_action('wp_enqueue_scripts', 'prefix_remove_views_assets', 20);
function prefix_remove_views_assets() {
// Scripts
// views_front_end_utils.js - used in Views parametric searches
wp_deregister_script( 'wpv-front-end-utils' );
// wpv-pagination-embedded.js - used in Views pagination and table sorting
wp_deregister_script( 'views-pagination-script' );
// jquery.ui.datepicker.min.js and wpv-date-front-end-control.js - used in Views parametric searches by a date field
wp_deregister_script( 'jquery-ui-datepicker' );
wp_deregister_script( 'wpv-date-front-end-script' );
// Styles
// wpv-views-sorting.css - used in Views table sorting
wp_deregister_style( 'views-table-sorting-style' );
// wpv-pagination.css -used in Views pagination
wp_deregister_style( 'views-pagination-style' );
}
QS 1) When I look at the files mentioned above, and looking them up in the source of my website (frontend), then I can't find:
- views_front_end_utils.js
- wpv-date-front-end-control.js
- wpv-views-sorting.css
Why are those not included in my website?
QS 2) The purpose of using the code above, is ofcourse to get rid of CSS and JS files inserted by Views that are not used at my website. It this topic: https://toolset.com/forums/topic/remove-unneccessary-css-files/, from end 2012, a feature request is made that only CSS and JS files by views are included when they are needed. What is the status of this feature request? Because it's now 2014 and we still need to use the code I included above.
Kind regards,
Willem
QS 3) I also see this in my HTML:
<script type="text/javascript">
var front_ajaxurl = '<em><u>hidden link</u></em>';
var wpv_calendar_image = '<em><u>hidden link</u></em>';
var wpv_calendar_text = 'Datum selecteren';
</script>
Can I also delete this?
Dear willem-siebeS,
The code above should remove the following files from your source code in the front-end:
wp-views/res/js/views_front_end_utils.js
wp-views/res/js/wpv-pagination-embedded.js
wp-views/res/js/jquery.ui.datepicker.min.js
wp-views/res/js/wpv-date-front-end-control.js
wp-views/res/css/wpv-views-sorting.css
wp-views/res/css/wpv-pagination.css
When exactly our developers will add a new feature or not is not up-to us to determine. Each issue reported in, whether a bug or a new feature request, is taken seriously into consideration. It is given a high or low priority based on a number of factors. Factors which those with the overview of all things related are in the best position to determine.
You could remove the code in #235555 with:
remove_action( 'wp_head', 'wpv_add_front_end_js' );
Please let me know if you are satisfied with my answer and if I can help you with any other related question.