en en en en en en en en en en en sv en en en en en en en en en en en en en en en en en en en en en de en de en de en de en en de fr en ja en en en en en en en en en en en en en it en en en en en en en en en en en en en en id en en en
A developer plugin for WordPress that saves template mappings created by the Gather Content WordPress integration to local JSON files.
Last update: 2022-08-28 19:08:07 UTC
$1 This package uses Composer Installers to install the package in the Must Use plugins directory (/wp-content/mu-plugins):
$2 Create a proxy PHP loader file inside the mu-plugins directory, or use the one included with the plugin:
Not using Composer? Download an archive of the code and drop it into the mu-plugins directory. The plugin file will still need to be required and instantiated by an autoloader in the root of the mu-plugins directory.
Once activated, the plugin will add a "Local JSON" column to the Template Mappings Post list in the WordPress admin. It will display one of three sync statuses for each template mapping; "Awaiting Save," "Saved," or "Sync Available."
The default status is "Awaiting Save." As template mappings are created or modified the plugin will write changes to local JSON to the theme directory under gc-templates. Once the local JSON is written, the status will change to "Saved." The local JSON can then be tracked and committed along with the rest of the theme code.
Once the local JSON and plugin is deployed to a remote environment the button "Import Local JSON Template Mappings" will appear above the template mapping table list. It will only appear if the items in the local JSON are not detected in the environment's database. Clicking the button will import them.
If additional changes are made to the same template mappings locally and deployed to the remote environment the Local JSON column status will change to a link that says "Sync Available." Clicking this link will update the remote environment's template mapping with the data from the local JSON file.
The synchronization key for template mappings is the Gather Content project template ID. There can only be one template mapping per Gather Content project template.
The "Sync Available" status appears when the local JSON modified date is greater than the template mapping modified date in the database. This means an older local JSON file cannot be synced with a remote template mapping that was modified at a later date.
The local JSON template mappings need to be synchronized in order to take effect.
Clone repository and create a feature branch. Make changes and run composer run lint to follow the coding specification. composer run fix can help fix some of the issues.
The Mayor's Office for Economic Opportunity (NYC Opportunity) is committed to sharing open source software that we use in our products. Feel free to ask questions and share feedback. Interested in contributing? See our open positions on buildwithnyc.github.io. Follow our team on Github (if you are part of the @cityofnewyork organization) or browse our work on Github.