Enqueue Scripts Handle Name Prefix

Dear Bosses,

Should I prefix the handle names of the wp_enqueue_script() function or not?
Like:
wp_enqueue_script( “bootstrap-js”, mythemename_get_js_assets_dir()."/bootstrap.js", array(“jquery”), null,true );

or,
wp_enqueue_script( “b_bootstrap-js”, mythemename_get_js_assets_dir()."/bootstrap.js", array(“jquery”), null,true );

Some articles say to prfix and some say not.
What can I do now?

Thanks in advance.

You should leave it as it is for known scripts and styles such as bootstrap:
wp_enqueue_script( “bootstrap”, mythemename_get_js_assets_dir()."/bootstrap.js", array(“jquery”), null,true );

But if you have a custom script, you need to prefix:

wp_enqueue_script( “mytheme_custom”, mythemename_get_js_assets_dir()."/custom.js", array(“jquery”), null,true );

1 Like

Thanks for your kind reply @ki-themes
That means known plugins like owl carosel, prettyphoto, uikit etc. should not be prefixed?

No prefix required for these as well

1 Like

Sorry to bother you again :slight_smile:
Any problem with this ‘bootstrap-js’?
I mean ‘-js’ should be deleted?

You should remove

1 Like