Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#61227 closed enhancement (duplicate)

wp_get_theme(): Add "License" and "License URI" header fields

Reported by: wildworks Owned by:
Priority: normal Milestone:
Component: Themes Version:
Severity: normal Keywords:
Cc: Focuses:

Description

The License and License URI fields are required fields when submitting a theme to the theme directory, but these two fields cannot be retrieved with wp_get_theme(). I thought it would be a good idea to include these two fields as well as the other required fields.

The reason behind submitting this ticket is related to the Create Block Thene plugin PR (https://github.com/WordPress/create-block-theme/pull/634). This plugin parses the active theme's style.css and copies all header fields to the overwritten or cloned theme. Currently, these two fields cannot be obtained using wp_get_theme(), so the only option is to use regular expressions or use get_file_data().

Change History (2)

#1 @SergeyBiryukov
2 years ago

  • Component GeneralThemes
  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Hi there, thanks for the ticket!

This was previously suggested in #40034, let's continue the discussion there.

Currently, these two fields cannot be obtained using wp_get_theme(), so the only option is to use regular expressions or use get_file_data().

Looks like one other option would be to use the extra_theme_headers filter, see comment:5:ticket:40034.

#2 @wildworks
2 years ago

Thanks for the reply! Since there is a similar ticket, please feel free to close this one.

Note: See TracTickets for help on using tickets.