You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Full Site Editing themes provide templates and template parts as HTML files.
Whenever needed, the site converts those files into wp_template and wp_template_part posts.
At every load, the site checks if there are differences between the files and the posts, and update the posts whenever needed (e.g. if the file content changed, and the post wasn't customized by the user).
The sync process matches file name with post slug.
If the site is missing a post with a given name, the sync will create it.
If the site has that post, and its content is different than the file content, the sync will update it.
The Issue
This sync logic doesn't take into account deleted or renamed files, as it never deletes any posts.
This could happen if, for example, a theme introduced a template file for a specific post misspelling its slug, and renamed it in the following update.
A Possible Fix
I don't think we have many options here. 🤔
Currently the sync loops through the theme files.
We'll need to also loop through the posts — those that are based upon theme files, and have never been customized by the user — check if the corresponding file still exists, and delete the post if needed.
If a user customized a file-based post, we should not delete it — exactly like we don't update its content if the file changed.
The text was updated successfully, but these errors were encountered:
If a user customized a file-based post, we should not delete it — exactly like we don't update its content if the file changed.
It would be nice if the user could get some feedback reporting the fact that updates / deletions have occurred but not been applied. Maybe that something for the Site Editor or the wp-template and wp-template part admin pages.
That would be a good place to initiate reconciliation.
Props to @bobbingwide for reporting!
Quick recap
Full Site Editing themes provide templates and template parts as HTML files.
Whenever needed, the site converts those files into
wp_template
andwp_template_part
posts.At every load, the site checks if there are differences between the files and the posts, and update the posts whenever needed (e.g. if the file content changed, and the post wasn't customized by the user).
The sync process matches file name with post slug.
If the site is missing a post with a given name, the sync will create it.
If the site has that post, and its content is different than the file content, the sync will update it.
The Issue
This sync logic doesn't take into account deleted or renamed files, as it never deletes any posts.
This could happen if, for example, a theme introduced a template file for a specific post misspelling its slug, and renamed it in the following update.
A Possible Fix
I don't think we have many options here. 🤔
Currently the sync loops through the theme files.
We'll need to also loop through the posts — those that are based upon theme files, and have never been customized by the user — check if the corresponding file still exists, and delete the post if needed.
If a user customized a file-based post, we should not delete it — exactly like we don't update its content if the file changed.
The text was updated successfully, but these errors were encountered: