We continue developing the plugin “wp-post-autocomplete”. In today’s article, we will connect styles, a JS file, and the autocomplete library from the jQuery framework (which comes bundled with WordPress by default).

Order website or plugin development for WordPress, website development on the Laravel, Symfony, or Yii2 framework…

We continue developing the plugin “wp-post-autocomplete”. In today’s article, we will connect styles, a JS file, and the autocomplete library from the jQuery framework (which comes bundled with WordPress by default).

The jQuery framework includes a component called Autocomplete, which displays suggestions (input options) directly below the text input field as it’s being typed. Similar to how autocomplete works in search engines like Google or Yandex.
In one of the projects, there was a task to display the full list of available options when clicking a button.
Let’s take a closer look at how to implement this. The first thing we need to do is include all the necessary scripts and libraries:
<link rel="stylesheet" href="../bower_components/jquery-ui/themes/base/all.css"> <script src="../bower_components/jquery/dist/jquery.min.js"></script> <script src="../bower_components/jquery-ui/jquery-ui.min.js"></script>