This might help you.
add_action('wp_footer', 'insert_my_js_to_footer');
function insert_my_js_to_footer(){
?>
<script>
// your script here.
</script>
<?php
};
UPDATE:
And if you want to append the php file itself then you can try this.
add_action('wp_footer', 'insert_php_file_to_footer');
function insert_php_file_to_footer(){
include( 'your-php-file.php' );
};
Related Posts:
- How to include jQuery and JavaScript files correctly?
- jQuery in header or footer
- Use js script from one plugin in another plugin
- Can’t get JS code to work with shortcode
- How do I add a javascript file to all admin pages via a plugin?
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Where to call wp_enqueue_script in a plugin with custom template?
- should i be checking for jquery before enqueing it in a plugin
- Custom Plugin – CSS works, JS doesn’t
- Is “document loaded” different on admin side than public side?
- Add a Script button in W3 Total Cache plugin not working due to conflicting jQuery version
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- ajaxurl not defined on front end
- How to implement color picker from wordpress in my plugin?
- How can I run AJAX on a button click event?
- Add async script
- Can I use the wp media uploader for my own plugin?
- Get list of scripts / styles and show file which enqueued them
- API to trigger prompt on leaving page
- Customizing the 3.5 “Add Media” popup (Backbone.js)
- Test to see if jQuery or Prototype is queued by another plugin?
- How do I conditionally enqueue script for CPT single post type with plugin?
- Where to enqueue stylesheets for plugin?
- How to Add a .js file Only in one specific Page Dynamically to Head
- wp_localize_script $handle
- How to prevent loading of all plugin’s resources?
- How to trap “Publish” button to check for meta box validation?
- Pass javascript result to shortcode executer function
- When is it too late to call the action wp_enqueue_scripts?
- Script won’t load via plugin class
- Plugin Loading Scripts and Styles on Every Page – Even when not being used
- Dequeue / Deregister script and replace it with a new plugin
- Making a custom widget that includes a tinymce and works in Site Origin Page Builder
- Looking for callback function after Gutenberg is rendered?
- What’s the better way to add an inline script?
- How do you output enqueued scripts to an admin page?
- Multisite plugin development and wp_enqueue_script
- Gutenberg: useDispatch is not a function – @wordpress/data included
- Make a list with header and subtext in Gutenberg blocks
- Prevent Javascript Facebook SDK Conflicts in plugin
- is_page() function doesnt working
- how to include javascript file and css file in wordpress
- How to avoid loading same script twice?
- Why is my javascript not invoked in my hooks except wp_head?
- Enqueue scripts in footer
- Loading scripts with wp_register_script and wp_enqueue_script
- Adding Dropbox dropin js using wp_enqueue_script
- Is there an event or an other method that tells me the preview is loaded?
- Do I have to worry about useState causing a re-render?
- How to enqueue or include json file to a plugin
- My WordPress plugin cannot load my JavaScript file
- javascript datatables in a plugin
- jQuery does not enqueue for my purpose… (before an inline script in the footer)
- Inserting code to HTML view from a pop up initiated from visual view
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- WP Plugin Running before jQuery
- Loading custom js file on the admin page through plugin
- Run JavaScript validation script on form submit in plugin
- Plugin Development – Class Constructor Not Firing wp_enqueue_style action hook
- How to enqueue scripts in right way in a plugin?
- unable to wp_enqueue_script(‘suggest’);
- How to make my shortcode load scripts and styles, from within the plugin?
- Need help about understand api, wp, $ syntax in WordPress plugin script
- How do I get rid of my inclusion race-condition on wp_enqueue_script
- Gutenberg – is it ok to load dependencies multiple times?
- Preventing double loading JS scripts (like React) when developing for Gutenberg
- Using function from enqueued .js file in theme in plugin?
- Enqueueing common php scripts in a plugin
- About a programming language starts with [closed]
- Referencing files in JavaScript in WordPress Plugin
- How to insert HTML/CSS/JS into my iframe plugin?
- Is there a WordPress plugin to design WebGL? [closed]
- How to write a shopping queue line plugin with a queue button?
- wp.media gallery collection sometimes undefined
- Rerender core Templates with with ToggleControl but it doesnt recognize block type
- What happens/fires when you select a block in the editor?
- How to use setAttributes outside of the edit function return
- Reading plugin settings in esnext wordpress block
- Dynamically modify content added to table via javascript
- AJAX call of function containing javascript which is not loaded (Plugin development)
- XMLHttpRequest to open PHP file responds with Missing Page
- Javascript scroll eventHandler only working when I’m logged in in WordPress
- Replace the WordPress Media Library Uploader
- Pass javascript result to shortcode executer function
- Filterable posts using categories
- Add language localisation to javascript alert?
- How to enqueue an external Javascript file to Frontpage footer
- How to display archive by selecting year and then selecting month
- Script work on non logged in user but not work for logged in user?
- Why does this fail: Disabling plugins enqueue_script() in functions.php
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- How do I access the contents of WordPress Classic editor in admin area with JavaScript?
- How react js and other Javascript Technologies works on WordPress plugin?
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- Trouble Importing whatsapp-web.js in a WordPress Plugin Development
- Reinitiate Gutenburg’s blocks using javascript
- how to add contact form 7 shortcode in javascript variable