Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of deprecated attributes; allow for replacement via WP-CLI #127

Merged
merged 7 commits into from
Jan 18, 2024

Conversation

jeremyfelt
Copy link
Member

A few things here:

  • On sites where CAB has been active for a long time, mainly one, it's possible that customTaxonomy is a string or an array.
  • Also on those sites, it's possible that a block has both the customTaxonomy and taxonomies attributes added.
  • The customTaxonomy attribute itself has been deprecated for a while.

So - I think this PR starts setting us up to remove these entirely—primarily because we're really the only ones using this plugin. I've added temporary code to upgrade these attributes in place both in the editor and on the front-end. I've also added a WP-CLI command that we can use to fix the content all at once.

Ideally, after we run wp cab fix-block-attributes on sites that need it (after checking wp cab audit-blocks), then we can remove all of the fallbacks and rely only on the taxonomies attribute.

At the same time I noticed that customPostType is/was being stored like document,document, etc... and causing the selection box to default to "Posts" even when document was selected. I don't think we actually rely on that structure, so I've updated that in the WP-CLI command as well.

Copy link

Changed files were detected after build. Please run project build workflows and check git status for any missed changes.

 M build/content-aggregator.asset.php
 M build/content-aggregator.js

You may need to update your local NPM configuration if different than below:

  • Node v18.19.0
  • NPM 10.2.3

Copy link
Contributor

@philcable philcable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@philcable philcable merged commit b2e207d into develop Jan 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants