Skip to content

Pattern Creator: Print stylesheet depends on a deregistered parent stylesheet #798

Open

Description

@elphizu

The front-end pattern creator displays this PHP notice when debugging is enabled:

The style with the handle "wporg-parent-2021-print" was enqueued with dependencies that are not registered: wporg-parent-2021-style.

The creator deregisters the parent theme’s main stylesheet but leaves its dependent print stylesheet registered.

To Reproduce

  1. Run the Pattern Directory locally with the wporg-parent-2021 parent theme.
  2. Enable WP_DEBUG and WP_DEBUG_DISPLAY.
  3. Log in and visit /new-pattern/.
  4. Observe the PHP notice above the editor.

Expected behavior

The pattern creator loads without stylesheet dependency notices.

Screenshots

Image

The notice text is included above.

Desktop

  • OS: macOS
  • Browser: Chrome 155.0.8059.85

Additional context

Reproduced with WordPress 7.2-beta1-64675 and PHP 8.4.

This can be fixed by deregistering the print stylesheet alongside the parent theme’s main stylesheet in pattern_creator_init():

wp_deregister_style( 'wporg-parent-2021-print' );
wp_deregister_style( 'wporg-parent-2021-style' );

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions