wpengine / atlas-content-modeler

Content modeling plugin for WordPress
https://developers.wpengine.com/docs/atlas-content-modeler
GNU General Public License v2.0
165 stars 13 forks source link

Make 'slug' appear in Quick Edit for public models #520

Closed jasonbahl closed 9 months ago

jasonbahl commented 2 years ago

A clear and concise description of the bug goes here.

To reproduce

  1. Create an ACM Model
  2. Add content to the model
  3. Try to edit the slug

Expected behavior

In core WordPress post types, there's a UI to edit slugs.

With ACM models there's no way to edit the slug once it's been set.

I would like to be able to edit the slug.

Screenshots

Post Type registered with the following code:

    register_post_type( 'custom_rabbit', [
        'label' => 'Custom Rabbit',
        'show_ui' => true,
        'public' => true,
        'show_in_graphql' => true,
        'show_in_rest' => true,
        'graphql_single_name' => 'CustomRabbit',
        'graphql_plural_name' => 'CustomRabbits',
    ]);

I can edit the slug while editing the post

CleanShot 2022-05-05 at 15 28 17

I can edit the slug in quick edit

CleanShot 2022-05-05 at 15 27 41


Post Type registered using ACM:

I can't edit the slug on the edit view

CleanShot 2022-05-05 at 15 29 54

I can't edit the slug in quick edit

CleanShot 2022-05-05 at 15 29 36

Version information

nickcernis commented 2 years ago

@jasonbahl On the edit view, you should be able to enable the slug meta box via Screen Options:

Screenshot 2022-05-06 at 10 15 18

Perhaps we should enable it by default if that's possible, though (I think those settings are per-user, but there might be some defaults we can tweak). Or we could enable the real title field in place of the ACM 'title' field.

The fact that it's missing on the quick edit view is a bug, though. (Core suggests the slug should appear for any publicly_queryable CPT — i.e. if “API visibility” is 'true' in ACM, which isn't working.)

I tracked it down to here, where we're disabling titles so that they don't appear on the edit screen:

https://github.com/wpengine/atlas-content-modeler/blob/8fa0a296754a06be2cca6e38d400076c4a495454/includes/publisher/class-publisher-form-editing-experience.php#L93-L96

We need to adjust that logic to run only on edit/create screens and not on the post list view. I added this to Jira for us to fix. https://wpengine.atlassian.net/browse/MTKA-1495.

mindctrl commented 9 months ago

Since ACM has entered an end-of-life phase and won't be receiving any new features like this, I'm going to close this issue. Source: https://github.com/wpengine/atlas-content-modeler/blob/main/docs/end-of-life/index.md