It would be a right way to enqueue the scripts using foreach loop only for
jquery
, jquery-ui-widge
t, jquery-UI-accordion
, jquery-ui-slider
, jquery-ui-tabs
, jquery-ui-datepicker
, Jquery-ui-dialog
and Jquery-ui-button
because I have to write it many times so
I have make it like this:
$jquery_ui = array(
'jquery',
'jquery-ui-core',
'jquery-ui-widget',
'jquery-ui-accordion',
'jquery-ui-slider',
'jquery-ui-tabs',
'jquery-ui-datepicker',
'jquery-ui-dialog',
'jquery-ui-button',
);
// Framework JS
foreach ($jquery_ui as $ui) {
wp_enqueue_script($ui);
}
So I just want to know this laziness is a right way or not:)