Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#12275 closed defect (bug) (fixed)

get_themes() returns formatted data

Reported by: georgwp's profile GeorgWP Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9.2
Component: General Keywords: has-patch
Focuses: Cc:

Description

WP 2.9 has changed the way get_themes() functions. The variable 'Author' is now a formatted link which even includes a TITLE tag.

This makes it easier to generate the Themes subpage. However, I would think that this function should return an array with unformatted raw data from style.css.

Please, change this.

Best regards

Attachments (1)

12275.diff (2.2 KB) - added by blepoxp 15 years ago.
Adds AuthorName to array of theme_data available. Differs from author in that it doesn't have the Author URI link wrapped around it.

Download all attachments as: .zip

Change History (8)

#1 follow-up: @nacin
15 years ago

  • Milestone changed from Unassigned to 3.0

Not sure if changing it back is worth it, but this sounds like it is due to abstraction to get_file_data(). Setting to 3.0 for review.

#2 in reply to: ↑ 1 @blepoxp
15 years ago

  • Keywords dev-feedback added; get_themes() removed

Replying to nacin:

Not sure if changing it back is worth it, but this sounds like it is due to abstraction to get_file_data(). Setting to 3.0 for review.

Ping me if you'd like any type of patch for this. I checked in theme.php and its set on line 230. I'm not sure if its worth changing back. I did a quick look to see what else uses that information. Most if it is - surprise - on the theme admin pages. All instances I saw are being printed with printf functions. In those cases, its nice that the author is delivered with the AuthorURI link already embeded so that we don't have to build the link in every instance.

I don't think it would be worth changing it back because we'd have to update the code everywhere that its currently used (to build the link using AuthorURI).

If you feel like its important enough, I could add another key to the $theme_data array, returning [ 'AuthorName' ] or something.

#3 @nacin
15 years ago

If you feel like its important enough, I could add another key to the $theme_data array, returning [ 'AuthorName' ] or something.

Adding another key seems like a decent compromise.

@blepoxp
15 years ago

Adds AuthorName to array of theme_data available. Differs from author in that it doesn't have the Author URI link wrapped around it.

#4 @blepoxp
15 years ago

  • Keywords has-patch needs-testing added; dev-feedback removed

I tested the above patch and all seemed well. Extra eyes never hurts though.

Not directly related to this ticket, but I noticed while testing that if author name is not included and author uri is included, anonymous isn't linked. Do we care about that?

#5 @bi0xid
15 years ago

  • Keywords tested added; needs-testing removed

Tested and working.

I think that if the author is not included (Anonymous) it must not be linked by default. You can still get author URI and theme URI calling to them.

#6 @blepoxp
15 years ago

  • Keywords tested removed

Still applies (with 10 line offset)

#7 @nacin
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [14658]) Also return raw author name and URI from get_theme_data and get_themes. props blepoxp, fixes #12275.

Note: See TracTickets for help on using tickets.