Conversation
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* sanitize windows new lines * add tests
mikachan
left a comment
There was a problem hiding this comment.
Thanks so much for working on this, @eirichmond!
It looks like this may need a rebase or a fresh merge from #675, I've just merged trunk into that PR so it's up to date. At the moment, it's hard to see which changes are being brought in. However, this is looking great so far 🎉
| * and not the database | ||
| */ | ||
|
|
||
| if ( stripos( $pattern->content, 'pattern-overrides' ) !== true ) { |
There was a problem hiding this comment.
This looks like a neat way to check if the pattern is not synced. I already mentioned here, but I also found wp_pattern_sync_status in postmeta that we could use as well.
| * Title: {$pattern->title} | ||
| * Slug: {$pattern->slug} | ||
| * Categories: {$pattern->categories} | ||
| */ | ||
| ?> | ||
| {$pattern_post->post_content} |
There was a problem hiding this comment.
| * Title: {$pattern->title} | |
| * Slug: {$pattern->slug} | |
| * Categories: {$pattern->categories} | |
| */ | |
| ?> | |
| {$pattern_post->post_content} | |
| * Title: {$template->title} | |
| * Slug: {$pattern_slug} | |
| * Categories: {$template->categories} | |
| */ | |
| ?> | |
| {$template->post_content} |
I think this should use $template rather than $pattern_post - I'm guessing this was accidentally copied over from pattern_from_wp_block. $template->categories might need to be created, too.
This is a hybrid of @mikachan work, just removed inserter from the header of patterns the they are loaded from the theme, adjusted to heredoc for readability and removed unsynced patterns from the database after saving to the theme.