Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate what entity(s) are blocking the use of the paired endpoint suffix #6374

Merged
merged 12 commits into from
Jun 12, 2021

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Jun 11, 2021

Summary

Fixes #6339

Before After
image image

Testing

To test the functionality:

  • Create a post with the slug amp.
  • Create a page with the slug amp.
  • Create a post tag with the slug amp.
  • Create a category with the slug amp.
  • Create a user with the username of amp.

Then:

  • Register a post type with amp as the rewrite slug.
  • Register a taxonomy with amp as the rewrite slug.
  • Register an amp rewrite endpoint.

These can be achieved with this plugin code:

add_action(
	'init',
	function () {
		add_rewrite_endpoint( 'amp', E_ALL );
		register_post_type( 'amp-post',
			[
				'labels' => [
					'name'          => 'AMP Posts',
					'singular_name' => 'AMP Post',
				],
				'rewrite' => [
					'slug' => 'amp'
				],
			]
		);
		register_taxonomy( 'amp-tax', 'post', [
			'labels' => [
				'name'          => 'AMP Taxes',
				'singular_name' => 'AMP Tax',
			],
			'rewrite' => [
				'slug' => 'amp'
			],
		] );
	}
);

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@westonruter westonruter added this to the v2.1.3 milestone Jun 11, 2021
@westonruter westonruter marked this pull request as ready for review June 11, 2021 22:07
@westonruter westonruter requested review from pierlon and delawski June 11, 2021 22:07
@github-actions
Copy link
Contributor

github-actions bot commented Jun 11, 2021

Plugin builds for fd93c82 are ready 🛎️!

westonruter and others added 6 commits June 11, 2021 16:43
Co-authored-by: Pierre Gordon <16200219+pierlon@users.noreply.github.com>
Co-authored-by: Pierre Gordon <16200219+pierlon@users.noreply.github.com>
Co-authored-by: Pierre Gordon <16200219+pierlon@users.noreply.github.com>
Co-authored-by: Pierre Gordon <16200219+pierlon@users.noreply.github.com>
@westonruter westonruter merged commit 8893d62 into develop Jun 12, 2021
@westonruter westonruter deleted the add/path-suffix-conflict-details branch June 12, 2021 05:54
westonruter added a commit that referenced this pull request Jun 12, 2021
…uffix (#6374)

Co-authored-by: Pierre Gordon <pierregordon@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Entity(s) causing path suffix conflicts are not indicated
2 participants