fix: pollora:status reports the slug the attribute registers - #375
Merged
Merged
Conversation
Closes #298. The slug rule moves to PostType::resolveSlug() and Taxonomy::resolveSlug(), used by discovery and by the status collector alike.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #298.
Problem
SystemInfoCollector(behindpollora:statusand the dashboard) derived each post type and taxonomy slug from the class name (kebab(class_basename)), ignoring#[PostType('…')]/#[Taxonomy('…')]. It also skipped the 20-character cut discovery applies to a derived slug, and ignored the attribute'splurallabel.Change
PostType::resolveSlug($className)andTaxonomy::resolveSlug($className)— explicit slug, else kebab-case of the class name cut to 20 characters.PostTypeDiscovery/TaxonomyDiscoveryregister with it (their privategenerateSlug()copies are gone).pluralbefore the class name.Tests
resolveSlug()for both attributes (explicit, derived, 20-char cut).#[PostType('synthese-presse', …)] class SyntheseDePresse) — fails on the old code (synthese-de-presse).pollora:statusliststest_casefor#[PostType('test_case')] class TestCase— matchingwp post-type list— where the old code showedtest-case.