This command would search through posts and find instances where pattern is used (same idea as in #212).
Example usage:
wp block pattern search --name=wpdocs/my-example
You should be also able to limit post type:
wp block pattern search --name=wpdocs/my-example --post-type=page
The command wp post list includes example implementation of passing query arguments, return fields and format so it's good benchmark for this.
Note that results may be incomplete as patterns can be detached etc but with current pattern name metadata in post content this is doable to a degree where command like this would be useful.
Use case: Find real examples from a project where certain patterns are used. This matters when checking styling, when refactoring or when it's safe to remove obsolete patterns.
This command would search through posts and find instances where pattern is used (same idea as in #212).
Example usage:
You should be also able to limit post type:
The command wp post list includes example implementation of passing query arguments, return fields and format so it's good benchmark for this.
Note that results may be incomplete as patterns can be detached etc but with current pattern name metadata in post content this is doable to a degree where command like this would be useful.
Use case: Find real examples from a project where certain patterns are used. This matters when checking styling, when refactoring or when it's safe to remove obsolete patterns.