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
- in_footer: gives syntax error
- WordPress generating Undefined Variable warning
- Removing Default Gutenberg Blocks, But Keeping Reusable Block Functionality?
- Uninstalling a plugin: delete all options with specific prefix
- How to get the list of WooCommerce product image of a certain category from database?
- How to override an unpluggable parent theme function?
- Display a text message if the shortcode is not found?
- Can i check if user is doing any ajax request?
- List authors with posts in a category
- Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- Understanding WordPress child theme custom JS loading
- Dynamically add styles to WP TinyMCE editor
- How to make a variable available for the duration of the page request
- Fatal error: Call to undefined method WP_Error::get_item_quantity()
- Removing unneccessary p-tags (Not every p)
- Integrate WordPress in Yii
- wp_kses and magic quotes
- display month in french in wordpress/php?
- WordPress Persistent connection rule does not work for “posts”
- Building a WordPress App
- PHP in CSS file?
- Warning: printf(): Too few arguments in helpers.php file
- Woocommerce Product_cat for current category page
- Action Hook Inside WordPress Plugin Shortcode
- Changes made on php.ini have no effect on wordpress
- Add a select-option to the default widgets
- WordPress low speed after migrating to new host
- Show all people who commented on all posts by an author
- How to pass values from one function to the other using an array variable
- Custom global variable not working in function
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- get_the_author_meta( ‘ID’ ) just return 1
- Register/enqueue scripts only on certain admin pages
- Site title not showing. Please help me
- Email always ends up in spam
- How to link featured images in single.php for only non-logged-in users?
- Grouping posts by date
- Search the post using get_search_form()
- Need to Echo A Url path to show on a wordpress page
- How can I move the posted-on date above the post and below the entry-header?
- ‘posts_per_page’ in costum page type
- How to use ‘depth’?
- Pagination on Custom Loop
- Passing multiple variables through url (php)
- Query Concatenation
- Link a lightbox thumbnail to a post instead of opening the lightbox
- Login user into magento using wordpress account
- Use of undefined constant issue
- Advanced Custom Fields – How do I get field values of a group within a group field type
- WordPress per ACF – permalink is not working
- Processing data and redirecting with query string
- get_var not returning a value when the field contains an apostrophe