Yes, your code is good.
And that my_custom_script
is a unique identifier for the script you’re enqueueing. You can find the default script handlers/identifiers here — e.g. jquery
for the jQuery library that ships with WordPress.
There you can also find more details about the wp_enqueue_script()
function, e.g. where should you use the function, the parameters, etc.
Related Posts:
- Which hook to use when adding ajax to viewer-facing side?
- Move jQuery on *top* of footer
- Hook with jquery script is not working in wp-admin [closed]
- Using jQuery to delete data stored in wp_options
- WordPress admin notice in plugin function
- Fire jQuery function when post edit screen loads
- Restrict access to admin but allow admin_post hook
- How to Use JSON With AJAX?
- Use latest jQuery in WordPress (admin interface)
- Using wp_ajax and wp_ajax_nopriv hooks
- Remove “Get Shortlink” button in admin of custom post type
- Admin wp_ajax hook returning 0
- Edit single attachment on click (WP-admin)
- Adding a character counter to the excerpt metabox
- WP Admin missing icons, numerous JavaScript errors, but only when SCRIPT_DEBUG is false
- ‘wp_login’ action hook not working with wp-login.php file
- Returning content via jQuery without footers on admin pages
- Can’t load a class into WordPress post editor’s content field
- Unable to uncheck checkbox with jquery in wp admin
- Hide metabox dependant on page template chosen
- jQuery is missing in wp-admin
- Exclude some scripts from removing unique scripts from head function
- Bypass nonce value while trashing a post
- Add/remove action on jQuery toggle
- wp_dequeue_script not working in my plugin
- How to isolate code to the post edit screen
- ‘wp’ hook supposed to trigger when editing a post?
- jQuery does not work
- How to fix my old theme so it loads jQuery properly
- Admin side jquery is not loaded
- Using Foundation 5 in WordPress Administration Area
- change order of add_action hooks for jquery to be loaded first
- Plugin Scripts no loading on options page
- Notice-Updated div moving around unprompted
- How do I add something to the “Edit Tag” page in wp-admin?
- Applying jquery to WordPress admin edit.php
- Is there a default way in wordpress to create a overlay in the dashboard?
- Screen Options JavaScript Code
- Query String Link With Anchor Tag Not Working on Same Page
- Fire action after enqueue script
- What is the earliest Hook a Script can use?
- Add JQuery As Code Snippet
- how to do display: block after user login
- Check get_post value after wp-admin login
- Dashboard controls have all stopped working
- Is not using admin-ajax to ajax submissions okay?
- Add a jQuery snippet for sepcific user role
- I can’t enqueue Suggest.js in frontend – not added
- $_POST empty in using new php file added to theme
- Custom button on admin page doesn’t trigger click event
- Uncaught TypeError: undefined is not a function (shortcode-box)
- Customize wp-admin form custom fields
- JQuery multiple toggle values
- jQuery .change() Event Bubbling in WP Admin
- jQuery datepicker not showing on admin menu
- Override default options in plugin metaboxes
- Download File Using jQuery
- correct way of comparing string jquery operator =
- Split string in jquery
- Javascript : array.length returns undefined
- Comparing dates in jquery
- Trouble understanding apply_filters()
- Correct Method to run scripts with dependencies without enqueue?
- How to prevent wordpress from loading old versions of jquery in wp_head();?
- Moving jQuery to the footer without using de-register in WordPress
- Prevent five different copies of jquery from being included on every page
- How to place HTML below the title of the (custom) post overview
- javascript is not working on Event Submission?
- Is there an action hook that fires just before a template is loaded?
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- Issue plugin commands in admin settings page
- How to get a value from PHP in Jquery through Ajax
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Looking for a hook for post.php
- AJAX Loaded Glossary like Search results with links to other entries from custom table
- I am trying to modify a plugin and am adding Jquery, but it does not seem to be executing
- FacetWP – conditionally display facet labels
- Uncaught ReferenceError: jQuery is not defined . How do I define it correctly?
- Close Fancybox, sumbit form data and redirect
- jQuery tabs plugin with callback to fetch data
- jQuery is not defined [closed]
- Nested Gallery Shortcode INTERMITTENTLY working
- Adding custom Bulk Actions
- Disable auto hide of the login form on Woocommerce’s checkout page
- jQuery .load and WP function
- How can I get this menu container to be the height of the contents?
- JQuery is not working after complete load of the page
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- {status}_{post_type} does not run correctly?
- Are you sure popup on Contact Form 7 [closed]
- change the icon of a custom post type in WordPress to use twitter boostrap
- Using jQuery toggle() in WordPress post to show/hide Tweet button?
- Call a Simple JQuery from within Flash
- Ajax request with jQuery without WP_ajax
- JS file not loading [closed]
- How can insert JQuery in WordPress? [closed]
- Jquery in IE, fully messed up
- Insert plugin html content to a specific spot in the frontpage
- Elementor form – checkboxes validation
- How to add input file plain text and submit to publish?