Skip to content

Add FAIR Pattern Importer plugin #2

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

costdev
Copy link
Member

@costdev costdev commented Jun 5, 2025

This adds a WP-CLI command for importing patterns from JSON files.

Commands:

wp fair_patterns create_categories # Create the pattern categories, if missing, from a hardcoded list.
wp fair_patterns create_keywords # Create the pattern categories, if missing, from a hardcoded list.
wp fair_patterns import <dir> # Import patterns from a directory of JSON files.

For example:

  • Ensure the Pattern Directory plugin is installed and activated.
  • Get patterns from this endpoint
    • Change page until out of pages.
    • Save each set of results to a JSON file in a /path/to/patterns directory.
  • Run wp fair_patterns create_categories to create the pattern categories.
  • Run wp fair_patterns create_keywords to create the pattern keywords.
  • Run wp fair_patterns import /path/to/patterns to import the patterns.

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.

1 participant