Lessons

Lesson 6. Displaying a list of posts on a page and pagination
Lesson 6. Displaying a list of posts on a page and pagination

Today’s article concludes the series of lessons on developing an autocomplete plugin. Due to the plugin's functionality expansion, many changes have been made. So we’ll need to go through the code from the very beginning again, but without too many details. In short, two additional shortcodes have been added for more flexible output manipulation. One shortcode displays the list of posts, the other — the pagination.

read more...

Lesson 2. Developing a Shortcode for the WP Post Autocomplete Plugin
Lesson 2. Developing a Shortcode for the WP Post Autocomplete Plugin

Let’s continue developing our WP plugin for post autocomplete. Today, we will create a shortcode with an input field for the search query.

Generally speaking, there are two approaches to structuring plugin code:

  1. Use standalone functions to define hooks, filters, helpers, etc. In this case, it’s best to prefix each function name to avoid conflicts with other plugins/themes or WordPress core functions.
  2. Use class-based development. Here, you still need to use prefixes, but far fewer, since most logic is encapsulated in class methods.

read more...