Skip to content

The default value for the create-entry enqueue style hook should be wp_enqueue_scripts #723

@kaitlinbolling

Description

@kaitlinbolling

Description of the bug

When running the create-entry script and including a stylesheet, the prompt for "The hook to use for enqueueing the entry styles:" defaults to wp_enqueue_styles. This is not a valid hook. Instead, both scripts and styles should be enqueued via wp_enqueue_scripts, so I would expect this to be the initial value.

Steps To Reproduce

  1. Run npm run create-entry
  2. Enter a slug (ex "test")
  3. Enter 'y' when prompted "Include a stylesheet for this entry?"
  4. Enter 'Y' when prompted "Include a PHP file for enqueueing the entry?"
  5. Press enter to accept the default value for "The hook to use for enqueueing the entry:" (wp_enqueue_scripts)
  6. Press enter to accept the default value for "The hook to use for enqueueing the entry styles:" (wp_enqueue_styles)
  7. Observe that the index.php file created uses a wp_enqueue_styles hook to enqueue styles, which does not load the stylesheet.

Additional Information

It looks like the value is being set here.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions