wpsharks / wp-kb-articles-kb

KB repo for the WP KB Articles plugin.
0 stars 0 forks source link

Can I modify KB Articles in WordPress when I'm using the GitHub Integration? #2

Open raamdev opened 9 years ago

raamdev commented 9 years ago

KB Article Creation Checklist
title: Can I modify KB Articles in WordPress when I'm using the GitHub Integration?
categories: questions
tags: 
author: raamdev
github-issue: https://github.com/websharks/wp-kb-articles-kb/issues/2

Question: What happens if I modify the content of a KB Article on the WordPress side when I'm using the GitHub Integration to import Markdown files? Does the GitHub Integration overwrite those changes with the contents of the Markdown file the next time it checks the repo?

Answer: Yes and no. The GitHub side always wins, so yes. If you change the content in WordPress, during the next GitHub update those changes will be overridden by the Markdown file from GitHub.

However, you might not see this immediately, because the update only occurs when the SHA changes at GitHub. So if you are editing the file in WordPress and never on GitHub, the SHA does not change, and thus the article would not be overwritten until such time as it does change on the GitHub side.

For this reason, it's best not to update any KB Articles from inside WordPress when you're using the GitHub Integration. Doing so could result your updates inside WordPress accidentally being overwritten if and when you make a change to the associated Markdown file inside the GitHub Repo.

A Note about the YAML Fields

The YAML fields are a bit different. Any YAML fields not in the Markdown file at GitHub, can be modified exclusively from within WordPress, unless and until such time as they are included in the Markdown file at GitHub; i.e. the updater only updates YAML fields that are defined on the GitHub side.