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

Custom post type incorrect width if not public queryable #53885

Closed
Tropicalista opened this issue Aug 23, 2023 · 3 comments
Closed

Custom post type incorrect width if not public queryable #53885

Tropicalista opened this issue Aug 23, 2023 · 3 comments
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Type] Bug An existing feature does not function as intended

Comments

@Tropicalista
Copy link

Description

I have noticed a strange behaviour on Wp 6.3.

Custom post type always have class is-layout-flow if I set 'publicly_queryable' => false,.

The behaviour is happening after latest Wp update. Before I have a width exactly like posts or pages.

This can be checked using my Formello plugin, that simply use CPT to store forms.

Step-by-step reproduction instructions

  1. Create a simple custom post type
  2. Set 'publicly_queryable' => false,
  3. Check the width is full-width and differs from posts or pages.

Screenshots, screen recording, code snippet

No response

Environment info

  • WP 6.3

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@jordesign jordesign added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. [Feature] Layout Layout block support, its UI controls, and style output. labels Aug 23, 2023
@andrewserong
Copy link
Contributor

Thanks for opening this separate issue!

I can reproduce this. To replicate the issue I did the following:

  1. Installed Custom Post Type UI plugin
  2. Created a new custom post type that is publicly queryable
  3. Confirmed that in the post editor, the main post content area uses a constrained layout
  4. If I then switch the post type to not be publicly queryable and then reload the editor for that custom post type, then in the editor, the content is displayed as full-width

The setting in CPT UI:

image
Editor view for a custom post type with publicly_querable true Editor view for a custom post type with publicly_querable false
image image

I'm not sure if it's related to #53752 as that issue is particular to the post content block being rendered in the block editor, however it might also be related to the issue described in #52163

@andrewserong andrewserong removed the Needs Testing Needs further testing to be confirmed. label Aug 23, 2023
@tellthemachines
Copy link
Contributor

I can no longer reproduce this issue and am reasonably sure it was fixed by #54158.

For some reason, the edited post template for a non-publicly queryable post doesn't have a theme file attached, so it defaults to the home/front page template. You can see this if you navigate to the post on the front end: it will show the front page instead of the post content.

(I'm not sure if that's intended behaviour or not; should not being publicly queryable equate to not being publicly visible at all?)

@andrewserong
Copy link
Contributor

I can no longer reproduce this issue and am reasonably sure it was fixed by #54158.

Oh, thanks! Yes, just double checked that fixed the issue for me, so I'll close this out now 👍

(I'm not sure if that's intended behaviour or not; should not being publicly queryable equate to not being publicly visible at all?)

Hrm, oh that's weird! In case it narrows it down at all, for me that only happens if I attempt to access it via the "pretty" url for the post type:

image

If I go to access via post id, then I get a 404, which I'd expect:

image

🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants