Skip to content

Warning about AMP being disabled for post type should be hidden for non-admins #4593

@westonruter

Description

@westonruter

Bug Description

Originally reported in #2692. When AMP is not enabled for a post type, there should be no warning displayed users who do not the manage_options capability, since there is no action the user can take. Non-admin users also would likely not care about AMP in the first place.

Relates to #2673.

Expected Behaviour

No warning should be displayed.

Steps to reproduce

  1. Sign-in as a non-admin user.
  2. Disable AMP for a given post type.
  3. Edit an instance of the post type.
  4. See the warning.
  5. Click link and see access denied notice.

Screenshots

Block editor:

image

Classic editor:

image

Clicking link:

image

Additional context

  • WordPress version:
  • Plugin version:
  • Gutenberg plugin version (if applicable):
  • AMP plugin template mode:
  • PHP version:
  • OS:
  • Browser: [e.g. chrome, safari]
  • Device: [e.g. iPhone6]

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

Metadata

Metadata

Assignees

No one assigned

    Labels

    ChangeloggedWhether the issue/PR has been added to release notes.GroomedWS:UXWork stream for UX/Front-end

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions