It’s an Immediately Invoked Function Expression (IIFE) – an anonymous function that executes itself after it has been defined.
The variables at the bottom are taken from the global scope and are passed as parameters to the anonymous function.
So api
represents wp.customize
,
wp
represents wp
and
$
represents jQuery
inside the function.
Related Posts:
- How to include jQuery and JavaScript files correctly?
- Test to see if jQuery or Prototype is queued by another plugin?
- jQuery in header or footer
- Hook the Keydown Event in the TinyMCE Post Editor
- How to Add a .js file Only in one specific Page Dynamically to Head
- How to trap “Publish” button to check for meta box validation?
- Use js script from one plugin in another plugin
- Mixing Regular Javascript With jQuery in a Plugin
- Is there an event or an other method that tells me the preview is loaded?
- javascript datatables in a plugin
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- should i be checking for jquery before enqueing it in a plugin
- Insert Into Post Not Working For Audio File Using jQuery
- wp.media gallery collection sometimes undefined
- Query String Filtering API
- jQueryUI draggable doesn’t work in WordPress plugin
- Filterable posts using categories
- Add a Script button in W3 Total Cache plugin not working due to conflicting jQuery version
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- How to get the value entered in the input field in wordpres
- How react js and other Javascript Technologies works on WordPress plugin?
- Insert meta-description into Yoast-SEO input-field via JavaScript
- 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 Do I Use jQuery UI In My Plugin
- How to implement color picker from wordpress in my plugin?
- How can I run AJAX on a button click event?
- Add async script
- API to trigger prompt on leaving page
- wp_localize_script $handle
- How to prevent loading of all plugin’s resources?
- Help adding image upload functionality to widget
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Pass javascript result to shortcode executer function
- Using Ajax call in jQuery doesn’t work in widget
- 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?
- Plugin admin page meta_box toggle and order state not saving
- How to create popup same as wordpress popup feature
- Ajax in WordPress – path issue
- 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
- how to include javascript file and css file in wordpress
- jquery document ready function not being called [closed]
- Why is my javascript not invoked in my hooks except wp_head?
- how to add Jquery script to one page?
- How to test nonce with AJAX – Plugin development
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- how to search users by ajax live search
- Do I have to worry about useState causing a re-render?
- jQuery selectors for editor elements safe to use?
- Display WordPress the_content() via data attributes
- My WordPress plugin cannot load my JavaScript file
- WordPress custom taxonomy check box to dropdown
- 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
- jQuery in WordPress 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
- jQuery instantly executes (a button click and css change) on load
- How to include jQuery into my plugin so I can use it on plugin page?
- Loading custom js file on the admin page through plugin
- Is it save to use eval for a jQuery callback method coming from the database?
- insert query on a custom table using ajax with jQuery plugin Jeditable
- How to enqueue scripts in right way in a plugin?
- making a plugin that moves other plugins wp_head actions to wp_footer
- How to add a panel/box/widget/are/screen to the right side of edit post/page confusion
- Service Worker Uncaught (in promise) DOMException
- Gutenberg – is it ok to load dependencies multiple times?
- Preventing double loading JS scripts (like React) when developing for Gutenberg
- About a programming language starts with [closed]
- Referencing files in JavaScript in WordPress Plugin
- Use options to control jQuery plugin
- Should I put my plugin javascript inline?
- How to localize data array in plugin’s option page
- sanitizing/escaping plugin options
- Using jQuery prepend() with file include
- Ajax on the Administration Side of plugin – returns 0
- What happens/fires when you select a block in the editor?
- How to properly enqueue jQuery knob on WordPress without conflict?
- Reading plugin settings in esnext wordpress block
- setTimeout not working in jquery
- Dynamically modify content added to table via javascript
- 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
- How to get values from Tinymce visual editor popup?
- Add language localisation to javascript alert?
- How to display archive by selecting year and then selecting month
- Ajax call not working with
- Script work on non logged in user but not work for logged in user?
- Why this plugin is not working?
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- Page reload occurs before request finishes
- How do I access the contents of WordPress Classic editor in admin area with JavaScript?
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Trouble Importing whatsapp-web.js in a WordPress Plugin Development