late answer
From a brief look:
You’d have to use
include( admin_url().'load-scripts.php' );
- and
include( admin_url().'script-loader.php' );
Then jump into $GLOBALS['wp_scripts']
:
Use…
$wp_scripts->default_dirs( array_merge(
$wp_scripts->default_dirs
,array( '/themes/your_theme/js/' )
);
…to extend it.
And then use
$wp_scripts->add( $handle, $path_from_content_dir, false/array( $deps ), $ver )
to add a script.
Notes:
- Uncompressed scripts get searched by
.dev.js
(whenSCRIPT_DEBUG
isTRUE
). - Same seems to be possible for
$wp_styles
. - EDIT: WP 3.5 will change this behavior and use
.js
for “dev” versions and “.min.js” when (SCRIPT_DEBUG
isTRUE
);
(But I guess this will only work if you use a plugin or mu-plugin.)
It´s not tested and I´m not shure if this will work.
Related Posts:
- wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i’m confused
- How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
- Relative path instead of absolute for wp_enqueue_script
- How to insert html/css/javascript code to wordpress plugin
- How to integrate my HTML and javascript into my child theme
- enqueing Javascript and CSS
- Enqueue CSS and Script only if needeed
- Bootstrap 4 Optimization
- How to use Head JS with all enqueued scripts?
- How can I test how fast or slow my wordpress website it?
- How can I reduce the amount of files loaded/included per plugin?
- Use wp_enqueue_scripts, not wp_print_styles?
- wp_register_script multiple identifiers?
- How to solve ‘Eliminate render-blocking JavaScript and CSS in above-the-fold’ content for multiple files?
- WordPress Displaying Thumbnails Vertically
- wp_enqueue_script + how to load JS or CSS in one URL merge call?
- Prevent CSS/JS loading when plugin is not used
- Changing Font-Size based on specific Font thru javascript
- Collapsible button inside a ul list does work in jsfiddle but not in WP
- Handling URLs in WordPress application
- Combining multiple javascript and css files
- Custom Admin CSS styles to style media uploader?
- Can “ and “ tags be used in the HTML editor?
- Is it better to put CSS in additional CSS or in Child theme styles.css [closed]
- JavaScript added as link/stylesheet
- Write text below a specific part of a sentence
- WordPress on localhost working, when sharing IP to connect receive err_connection_refused on .js and .css files
- Show enqueued CSS and Script in custom header
- Eliminate render-blocking JavaScript and CSS in above-the-fold content
- Older isotope portfolio rows shifting downward by 1 pixel on hover
- Shrink Header Image on Scroll
- How to create fa-bars animated menu
- Does costum code in the root folder get lost when wordpress is updated?
- CSS Minification
- How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]
- Child theme stylesheet not always overriding “index”
- Why is this jquery / java script code not working in mobile / in devices?
- Seperate functions.php for part of site
- How can I get the search form to be selected automatically?
- Implementing a simple slider in code?
- Cannot set property ‘className’ of null at setThemeFromCookie
- wp_enqueue_scripts and CSS
- Custom Plugin – CSS works, JS doesn’t
- Ordering stylesheet above using functions.php
- How to change “““ to “““?
- How can I force Dynamic CSS via ACF values to update on page load?
- Conditionally enqueue a stylesheet based off of a javascript click event
- get_template_directory_uri() generates wrong path
- functions.php – inject inline css from file
- Remove CSS & JS from
- How to Add a Read-only Textbox With Text in it That Has a Button to Copy it?
- Load custom CSS before admin CSS
- Theme JS is available but theme CSS isn’t
- Including CSS files in HEAD based on page content
- ACF Pro with SlickJS [closed]
- Show/Hide Div for Login Mask
- prevent HTML output if custom field is empty [closed]
- Plugins not showing up for custom template
- Equal height sections in custom Headway Theme
- W3TotalCache and Javascript — what should go where, when?
- How would I create the same popup in css and javascript as the one in contact button on the site https://www.sublimotionibiza.com/es/main.html [closed]
- Combine CSS Files without plugin
- Button doesn’t work in the profile panel
- WordPress Rest Api access the header and extract stylesheets URL
- Invert porfolio item order
- How to make a function to play only on the home page?
- Embed widget from external source (Zendesk)
- Hide Tab Titles from Tabs Block
- How can I hide this custom slider while Elementor editing window is open?
- Dequeue styles with query doesn’t work
- broken internal JavaScript and CSS files
- Getting and setting CSS variables with JQuery in WordPress backend fails
- Unable to use Datepicker in a table when inserting a row
- Bootstrap Integtration
- Two CSS files loading extremely slow
- How to properly hide the div of an inline collapsible button?
- Change the version of default style.css in wordpress
- Performance hit of Inline CSS
- Web Developer Console: “Slow network is detected.” with fonts
- How to display javascript banner in website header?
- How would I add this code to a single WordPress page?
- The placeholder text doesnt disappear
- Trouble with adding preloader to my home page index.html and index.js
- Loading css files conditionally useful?
- Import HTML code that loads css and javascript into specific page
- Change Login CSS – Include instead of echo
- How to implement a JavaScript and CSS file for my WordPress homepage?
- What can cause JavaScript and CSS files to be minified?
- Move main menu to top of screen
- How to remove audio player styles added by mediaelement.js JavaScript?
- Interactive maps in wordpress
- Eliminate Render blocking CSS?
- Can I upload my HTML/CSS/Javascript game onto a WordPress page?
- How do I add JS and CSS to WP (Flatsome)
- plugin not loading my css and js
- “Plate” theme broken after update
- How to print HTML content on click of a button, but not the page?
- What is the difference between “screen” and “only screen” in media queries?
- How can I add this specific link hover effect to a WP site? [closed]
- s2member captcha how to make responsive – css or javascript