There’s an in_footer
parameter that you can pass to wp_enqueue_scripts – does that work?
I would hook to admin_enqueue_scripts
, check the $page for location, and enqueue your script there, with ‘in_footer’ as true.
Example:
add_action( 'admin_enqueue_scripts', 'enqueue_my_script' );
function enqueue_my_script( $page ) {
if ($page !== 'edit.php') return;
wp_enqueue_script( 'my-script', 'http://path/to/my/local/script', null, null, true );
}
Related Posts:
- Add a script as a dependency to a registered script
- Setting up an API “listening” page
- Serving wp-includes (front-end) javascript from a different domain?
- Add conversion/tracking pixel to section for specific post
- WP CLI theme install. Install a private repo?
- How do I enqueue a JavaScript in my footer via the functions.php file?
- Overwrite or Replace code in WP_Footer
- change $src from wp_register_script in plugins/themes
- Change directory of javascript files
- By having WordPress in a subfolder does it mean more script executions?
- Script Code in Text Widget Does NOT Show
- Invision + WordPress integration
- wp_print_scripts runs twice
- How to serve wp-includes javascripts from CDN? [duplicate]
- Register scripts located in child theme?
- How to add GET variable after script url?
- On click load iframe [closed]
- WordPress 5.1 upgrade has lost the parent theme JavaScript
- Generating a static page from a script
- Refused to execute as script because “X-Content-Type: nosniff” was given and its Content-Type is not a script MIME type
- Disable load scripts and styles not working
- Socialite not displaying icons [closed]
- Script dependencies generates different outputs
- Renaming the ‘build’ directory generated by @wordpress/scripts for React development
- How do I get the $handle for all enqueued scripts?
- What are the benefits of using wp_enqueue_script?
- Correct Method to run scripts with dependencies without enqueue?
- dynamically add scripts to WP_Widget widget() method
- Get list of scripts / styles and show file which enqueued them
- How to add code to just before closing body tag
- How to prevent wordpress from loading old versions of jquery in wp_head();?
- How to add JS in footer
- How to get a jQuery script to run on a page?
- Outputting Canonical Resource URLs Across a Multisite Network?
- Add script to footer – on post editor
- Wp_head and wp_footer vs wp_enqueue_script javascript files?
- enqueuing React script and hooking its target div fails to load script
- Shortest possible shell script to install WordPress on Nginx server?
- Add footer.php to WordPress child theme
- Why and how is twentythirteen adding a margin-top to my footer?
- Change directory where get_header(), get_footer() and get_sidebar() look for templates
- How can a Theme Contain no Header File or Footer File?
- Setting a page link in the footer?
- How do you load WordPress from an external script when using MultiSite? [duplicate]
- Is possible dequeue/remove style from wp_footer() hook and add on wp_head() hook?
- How to cancel `wp_print_scripts`?
- Execute Hook on the footer or header after activating a plugin
- My scripts-bundle.js file is getting sent to the browser as a stylesheet css file. Help!
- Where would I place `wp_footer();`?
- Want to make header and footer CMS driven sothat Editors can modify its content from wordpress admin section
- Understanding Theme specific Code
- Newbie: Help with Vertical Spacing on Footer Widget [closed]
- Weird links found in wordpress footer
- WordPress Unite Theme: Footer isn’t sticking [closed]
- Google Analytics tracking code on just one page?
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Load CSS in footer, like your can with JS?
- Removing a link below from footer
- Generate featured images old posts
- What’s a good way to unenqueue all scripts for a single template page?
- Why is JavaScript being added to header as application/oembed?
- Add Different Actions To Different Page’s wp_footer
- How can I load certain JavaScripts only on blog pages?
- How to connect rating to individual comments?
- add 3rd party link (with script) to menu item
- footer does not respect css stylesheet
- Disable Cloudflare Rocket Loader for jQuery javascript and make it load first
- Changing URL of scripts, scripts outside theme folder?
- Multiple rows of footer widget areas
- get_header() in backend – but keep JavaScript and CSS files
- Call Shortcode on wp_footer
- Action inside another action not working
- is there a way to get all queued scripts/styles into a template without `get_header()`?
- Absolutely print script in footer
- Getting A Link below footer – Want to remove it. How?
- JavaScript Libraries in WordPress
- Removing admin javascript
- Insert data through a script directly in the db
- wp_footer hook running twice
- Place Footer at bottom of page with short text
- How to add content above footer in posts from specific category
- Integrating a Gutenberg custom block within a larger plugin
- Defining path of content folder in WP-config solves the issue of missing header, footer, theme options. Is this a good approach? Expert Advice needed
- How to add specific script to WordPress webpage that will working with user input and databases
- Embedding CodePen Calorie Script – jquery error
- Loading different header and footer in woocommerce templates (AMP)
- How to add extra custom social icons to page with same style?
- Why can I not deregister my style and script on custom post type?
- Unable to defer loading of jquery
- Page Contents showing in Footer Area
- Very weird behaviour after removing WP pages
- How to prevent a style sheet to affect a header.php or footer.php?
- Adding javascript to header of MetroMagazine theme
- Moving CDN jQuery to footer does not work?
- Show Header When Not In Iframe
- Content in footer file
- Footer in middle of page in different browers [closed]
- Footer option is missing in Customiser
- CCF7 Field numbuer prefilled after Click event
- Running a long script in PHP