FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Snippet-Library/enqueue-javascript-files.php at master · Codeinwp/Snippet-Library · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
This repository was archived by the owner on Jul 16, 2026. It is now read-only.
Codeinwp
/
Snippet-Library
Public archive
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Actions
Security and quality
0
Insights
Additional navigation options
Code
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
Snippet-Library
/
enqueue-javascript-files.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (26 loc) · 733 Bytes
Breadcrumbs
Snippet-Library
/
enqueue-javascript-files.php
Copy path
File metadata and controls
32 lines (26 loc) · 733 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* Enqueue javascript files
*
* @param array $scripts
* @return array
*/
function
wpmm_enqueue_javascript_files
(
$
scripts
) {
$
scripts
[
'
file
'
] =
'
path/to/javascript/file.js
'
;
$
scripts
[
'
file2
'
] =
'
path/to/javascript/file2.js
'
;
return
$
scripts
;
}
add_filter
(
'
wpmm_scripts
'
,
'
wpmm_enqueue_javascript_files
'
,
10
,
1
);
/**
* Add code before scripts if necessary
*
* (this code is outputted before the javascript files so that they can use it)
*/
function
wpmm_add_code_before_scripts
() {
?>
<script type='text/javascript'>
console.log('This is a test... :-)')
</script>
<?php
}
add_action
(
'
wpmm_before_scripts
'
,
'
wpmm_add_code_before_scripts
'
);
Back
|
FazBrowse Home
|
New Git URL