Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitLab with WP-CLI:
wp plugin install https://gitlab.com/petertoth.sandbox/engrain-units-wordpress-plugin/-/archive/master/engrain-units-wordpress-plugin-master.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Engrain Units WordPress Plugin
@author: Peter Toth - peter@petertoth.email
Here's my solution of the Back-end Developer Assesssment
- Create a simple WordPress plugin with the following functions:
- The plugin should register a custom post type unit.
- The plugin should provide an admin page within the WordPress CMS.
- The plugin's admin page should include a custom button to trigger an API call.
- On click of the button the plugin should consume JSON API and create unit records.
- The admin page for unit posts should include a custom column displaying the floorplanid field included on the unit record.
- The post title for unit post's title should be set to the unit number field.
- The edit page for the unit admin post should display the required custom fields.
Unit Specification:
Post title - unitnumber
Custom fields required:
- assetid
- buildingid
- floorid
- floorplanid
- area
Shortcode
[engrain-units] shortcode displays a list of the unit posts broken into two sections, units with an area greater than 1 and units with an area of 1
Install
Just download and copy the code to wp-content/plugins/engrain-units folder
Dependecies
None
PHP version
=8.0