Simply you’ve to call the function to execute it:
function _test() {
console.log("Test");
}
_test();
Related Posts:
- Get only enqueued styles and scripts of the current theme
- Trigger a php file on every post or page if a condition is met
- Enqueue less file not working in child theme?
- Execute only on a certain page
- How to execute a simple php script in WP (I don’t think wp_enque_script applies here)
- Is it recommended to pass some data to scripts in `wp_enqueue_scripts`?
- if file_exists not working with wp_enqueue_style
- enqueue hover function
- Adding tawk.to code just before body tag on functions.php file
- How to enqueue CSS and JS only on specific template?
- Deregistering a script in WordPress seems impossible
- How to inject variables into public-facing JS using wp_enqueue_script
- How to only enqueue script if it’s a post
- WordPress Scripts Being Loaded in Footer
- Jquery function working in Dev Console but not otherwise [duplicate]
- jQuery code not working when included in functions.php
- Conditional Javascript based on WP Version
- Is the wp_enqueue method efficient?
- Correct way to enqueue page specific CSS file
- linking stylesheets and scripts with functions.php
- Double jQuery loaded
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- How to use wordpress function wp_enqueue_script() in php?
- Enqueing External JS on the remote server JS
- url_to_postid returns 0
- ‘Bones’ theme: Load stock scripts in footer instead of header?
- Enqueueing a code block from an options framework
- Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?
- Using Google Analytics in an enqueued JS file
- Enqueue assets from multiple directories using add_action/do_action
- How to change order inside foreach using wp_enqueue_script?
- Call a single function on two different methods with hooks
- Enqueue sripts and styles only if function is called
- Load script and styles using an array of resources
- Importing the style and scripts in the plugin doesn’t work as well as in the theme
- When to use wp_register_script() function?
- How to stop loading my custom scripts files for wordpress iframe?
- How can I enqueue comment-reply script only on certain page?
- Chosen Select jquery Not Working in Plugin
- Adding javascript files to WordPress and jQuery version
- How can I print out a single stylesheet or javascript link?
- Adding Gravity Form With if(is_page) Is Not Working
- wp_enqueue_style conflict when using in different action hooks
- Errors while Loading Most Recent Version of jQuery
- Warning: filemtime(): stat failed for wp_
- How to enqueue structured data as file – jsonld file seems not to work
- Make a variable global and use it for inline script
- functions.php doesn’t load all custom theme assets
- Fatal error: Call to undefined function mysql_connect()
- How Attackers write script into my php files?
- Fatal error: Call to undefined function plugin_dir_path()
- Switching wp_get_sites to get_sites
- How to get author ID when an author page is being viewed?
- How to remove html comment from source?
- Need help on WordPress and php
- Looking to exclude blog posts from category Previous/Next buttons
- Automatic Excerpt Not Working
- Best way to create a user programatically
- Can’t use get_results() in ajax query
- Remove all nav menu classes ( but keep useful ones… )
- How do I turn a shortcode into PHP code?
- Can I change the contents of a description meta tag generated by Yoast?
- How to filter/hook-into retrieve_password() to filter $_POST[‘user_login’]?
- Sorting Posts | Alphabetical Order
- Shortcode content output but not in correct place
- Storing Array from returned database query and using the array in a new query
- Automatically adding new post categories to menu
- Show prices with tax in Woocommerce Mini Cart [closed]
- WordPress ajax doesn’t display object method on jQuery .change() function
- get author_name from queried post
- Bootstrap and Custom CSS in custom plugin are being overwritten by theme
- post thumbnail, conditions, else wont work
- PHP in Edit Post link
- How to add drag and drop functionalities to a div inside option panel
- PHP Warning: include(): Unable to allocate memory for pool
- javascript variable to wordpress php variable
- Do I need to edit my theme in order to change the title of my blog page?
- trouble with parse error [closed]
- Why does my settings form redirect to the homepage?
- Passing an array into WP_Query as a variable
- Shortcodes showing in excerpt despite using strip_shortcodes
- Remove Post if Advanced Custom Field is checked to fix paging
- Using php inside javascript [closed]
- How to separate product payment and shipping payment in WooCommerce checkout? [closed]
- WordPress single.php get_header not working
- Load more posts using AJAX based on posts inside WP_Query
- Undefined array key 0 wp-includes/capabilities.php on line 76
- Store GA Client ID in User DB
- Hide author from search results meta, still display date and categories
- A WordPress Page to display custom database query results
- Site doesnt work once PHP changed to 7.1
- admin uploads pre_get_posts not working as expected
- Run PHP Results inside WP Shortcode
- Accessing Variables Used In a Plugin Using PHPStorm + XDebug
- Show Nav Link To Users Signed In
- WordPress $GLOBALS and PHP $GLOBALS
- Remove the_content From Loop
- Load a Header in wordpress
- Trouble figuring out how to get my button to submit comment
- Correct way to perform a GET to another PHP file hosted on wordpress