Creating an accordion model and capturing data

We have chosen to use custom post types for accordions. Therefore, we need to register a new custom post type by using the register_post_type function with necessary settings. We already created a custom post type and discussed the process in previous chapters, while working with the property post type. Therefore, you can refer to the WQKM_UI_Components class inside the source code directory to understand the registration.

Unlike properties, accordions are not intended to be displayed as individual posts or to achieve page items. Instead, we use them to capture the data to be reused in UI elements within posts or pages. Therefore, we have to set the public attribute to false while creating the ...

Get WordPress Development Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.