Hook my_load_js()
to wp_enqueue_scripts
as in the examples in the Codex, and not to admin_init
.
add_action('wp_enqueue_scripts', 'my_load_js');
…pretty sure that will take care of it.
Related Posts:
- Get a path to a different plugin
- How to check uniqueness of plugin prefix?
- Plugin API for easy admin list table generation, handling & exporting of MySQL tables?
- How to check username/password without signing in the user
- Understanding WordPress functions’ naming conventions
- Using query_vars filter
- What’s the earliest point I can get the queried object ID?
- Custom admin_notices Messages Ignored During Redirects
- Add content to widget title in admin area within the widget?
- Is it save to require plugin.php early to be able to use get_plugin_data() earlier?
- When is it appropriate to put functions on page template vs. functions.php?
- How to use the settings API to set multidimensional arrays
- Plugin to Consume a Web Service
- How to enable users to down-vote in this simple voting counter (that uses the post meta)?
- Multisite, sharing content by URL
- How to allow Unfiltered HTML in a wordpress multisite install
- Rewrite Point Doesn’t Work on Custom Taxonomy
- Best way for plugin to accept POSTs?
- wp_remote_get keeps timing out
- What are the really difference writing WordPress 3.x widget plugins?
- Calling plugins API within a theme
- How do you output enqueued scripts to an admin page?
- Woocommerce – Hide a Column in Cart Table
- Does WordPress’s HTTP API use any caching?
- query users by role
- null callback in add_settings_section
- Should shorcodes in i18n plugins be translated and if so, how?
- How long should it take for a plugin to fully load into the WordPress.org plugin repository?
- Which directory in my plugin repo does WordPress Plugin Directory package?
- get post attachment using ajax
- Replace default Blogroll Links with Social Media Links
- Append varible to url or set session
- Adding custom end points, No error line
- How to enqueue or include json file to a plugin
- Search and Filter
- Trying to code a simple plugin, infinite loop?
- Update own Plugin Repository on Multisite
- Custom Plugin theme filter
- Issue with contextual help overwriting existing content
- Inserting code to HTML view from a pop up initiated from visual view
- CSS not affecting widget output
- wp_editor add media button not working
- How to create custom settings page for custom plugin
- Why wp_die() doesn’t work with wp_redirect but exit() works
- Taxonomies within plugin invalid
- Category select options for plugin settings
- Make Database query only when option is updated
- shortcode executed in the page editor
- Plugin header: WP and PHP version control uses wp_die(), can I change that?
- Completely isolate a plugin view so it doesn’t load the theme
- Does is_admin() really provide a plugin performance improvement?
- Enqueueing common php scripts in a plugin
- How to translate wordpress backend to another language
- How can I save a password securely as a settings field
- How to localize data array in plugin’s option page
- Changing permalink structure breaks link to .php file which generates files dynamically
- rewrite_rules problem
- Custom post type change permalink query
- Upload product image from frontside for administrator only
- $wpbd->insert_id is returning null
- Allowing duplicating users with same user_login and user_email
- Why does theme’s reset CSS have higher precedence of plugin’s CSS?
- Redirect WooCommerce checkout to cart
- Initializing rest endpoint issue
- Plugin Activation Causes wp_register errors
- WordPress plugin how to run function when button is clicked
- Save in my custom admin page and redirect to the saved object
- How to get values from Tinymce visual editor popup?
- How to display archive by selecting year and then selecting month
- Ajax call not working with
- What is more secure checking capabilities of user or checking role of user in WordPress plugin development
- Undefined notice on unset field
- Theming Custom Plugin Page
- From my Plugin Settings Page use check boxes to load specific css files (e.g. Bootstrap / Foundation)
- Script work on non logged in user but not work for logged in user?
- Sessions in plugin development?
- Can wp_schedule_single_event be used to run background proccess?
- Is it possible to make WordPress as a RESTful app?
- List all content by post type
- Get user logged in status from within a plugin. $current_user not defined
- Widget plugin and input file
- How to inject html to every page with a plugin?
- Custom plugin not appearing
- Gutenberg’s Popover component position relative to the focused element
- Safe XML response from wordpress plugin
- Gutenberg: – Call a function after Server Side Component is rendered
- How are themes and plugins localized using the gettext GNU framework?
- Theme, Plugin or Both?
- Accept only PDF file for upload
- WordPress upload path decalration
- Add a custom image source
- filter on get_posts efficiently
- How to get custom user meta by id in custom Gutenberg block
- How to prepend a header section to all pages related to my WordPress Plugin
- How to access Elementor-navigation-elements via jQuery
- Hook a search form anywhere on the site, using a custom plugin
- Plugin forms overwrite each other’s options
- ACF – programmatically install and activate in pipeline to automate testing for custom plugin development?
- How can I include React useState in a custom gutenberg block plugin?
- Problem with Owl Carousel, infinite loop [closed]