Skip to content

Query terms by slug #36785

@iandunn

Description

@iandunn

What problem does this address?

Currently the Query block requires hardcoding categoryIds and tagIds, which isn't always portable across development environments.

One example is when a limited set of content is exported from production, to avoid leaking private data into local environments. When only exporting a specific post type, the WRX export file won't include meta data for categories. Instead, it includes the slug, and new categories are created with the next available ID.

When that happens, the local category IDs don't match production, and templates that work in one environment don't work in the other.

I assume there are other situations where hardcoding IDs is undesirable too.

What is your proposed solution?

Support querying by term slugs in addition to IDs.

That can still lead to problems in some situations, but it's much more portable, and much easier to fix when something does go wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions