Opened 7 years ago
Closed 7 years ago
#3421 closed defect (bug) (fixed)
WP-CLI command reference generates duplicate posts
Reported by: | schlessera | Owned by: | danielbachhuber |
---|---|---|---|
Milestone: | Priority: | high | |
Component: | Developer Hub | Keywords: | has-patch |
Cc: |
Description
The cron job that updates the WP-CLI command reference is currently generating massive amounts of duplicate posts.
This issue is due to the fact that CPT slugs share a namespace with other CPTs, and we hit this with commands like embed
. The entire synchronization mechanism is built around the URL, and the embed
command that has a conflict with _some_ other post on the site is created under the slug embed-2
. This causes every check to detect the entry as an existing parent to fail and thus parents are re-created all the time.
I have a patch that normalizes the command path so that these added numeric suffixes are removed from the path that is used for all checks.
Attachments (2)
Change History (5)
#1
@
7 years ago
The patch does the following:
- normalize command paths to avoid duplicated items due to slug conflicts
- add 'page-attributes' to CPT 'supports', so that parent posts can be manually inspected/modified
- Only filter the queries for this CPT on the frontend, so that we keep access to all generated commands on the backend
Note: See
TracTickets for help on using
tickets.
Normalize command paths