WordPress plugin for working with JSON definitions in a post content
A huge number of ready themes and the constant emergence of new encourages developers to write plugins for tasks not typical for WordPress. Often there are added a new data structures to CMS. Purpose
Lisette_JDP does not change anything in the data structure of WordPress. However, it is easy turns post_content to the record (model), which then works.
The post becomes a record for the end user, with the opportunity to ask selection criteria or to prepare feed for transmission in third-party services.
The system administrator also gets the opportunity to work with the post how to record editing fields using custom forms.
The attribute values of records are stored in post_content field in the form of notation like JSON definition. The plugin reads the definitions and converts them into records on the fly. How it's made
The catalogue includes a plug configured for real estate agencies. Possible any other setting. How this can be done, see below. Installation
Installation the usual for WordPress - download, unzip, put it in the plugins directory and activate.
Unlike most plug-ins for WordPress plugin Lisette_JDP has no configuration tools in the administration panel exept two widgets - criteria form and map. Setting
The customizations should be done in the configuration files and forms files. That is the way it is done by programmers.
What can be customized?
If you want to change fields of the record
- Attributes (fields) of records you would like to fill are in the file ./config/new_ad.json. Format is field_name: value by default.
- Given in accordance with the modifications to the files ./config/fields.php, ./config/select_options.php, ./config/categories.php.
- Form ./views/edit.php designed to edit the fields in the administration panel. And other views for frontend, is located in the same folder.
- To change the event handlers to respond to user actions on the client side in the file ./js/start.js.
If you want to change the form of the search criteria
- Change form ./views/criteria.php used to enter search criteria.
- The class inherits from LisetteJDPApplication.php. For this plugin is RealtyApplication.php. You need to override methods, format, condition, yaPoint to bring them into conformity with the new attributes.