WebDevStudios / WebDevStudios/custom-post-type-ui

CPTUI allow non unique slug

Open
#808 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

i18n
Dominant language
PHP
Stars
641
Forks
139
PR merge metrics
No merged PRs in 30d

Description

Hello,

I'm Sébastien from Polylang (support) team.

We have several users/customers in common which fail in the same issue and I think you should keep them from it.
In our side, we will think about a behavior to prevent Editor fatal error.

Today, each admin can create CPT and Taxonomy thanks to CPTUI, and they're allowed to create CPT and Taxonomy with the same slug. More over, they can use already existing slug.

It's problematic as the Rest Api used by the editor has a problem to retrieve correctly the content by choosing the wrong content due to several contents with the same slug.

In Polylang Case, it retrieves content without translation for a translatable content... and it produces a JS fatal error in the editor. We'll manage it to prevent bad experiences.

To avoid having this. Should it be possible to check on CPT and Taxo creation if the slug chosen by the user is available (Not already in use and not in the WordPress reserved terms) ?

Thank you very much

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the plugin creates custom post types and taxonomies, then inspect how slugs can be compared with existing registrations and WordPress reserved terms. Done means conflicting or reserved slugs are detected during creation and the administrator receives a clear validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.