Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#61227 closed enhancement (duplicate)

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

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

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
8 months ago

  • Component changed from General to Themes
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

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
8 months 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.