WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#26930 closed defect (bug) (wontfix)

Support custom `theme action links` again

Reported by: georgestephanis Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8
Component: Themes Keywords: has-patch
Focuses: javascript Cc:

Description

With THX38 merging into core, the theme_action_links filter got dropped so it's no longer possible to add custom links to themes.

Let's restore that functionality.

For an example of how this would be used:

https://github.com/georgestephanis/theme-downloader/commit/bb8584add9cf0039580902632e30652829798f52

Attachments (1)

core-patch-3.8-theme-action-links.diff (1.3 KB) - added by georgestephanis 8 years ago.

Download all attachments as: .zip

Change History (7)

#1 follow-up: @helen
8 years ago

Boo, dropped filter. Why not keep the name the same?

#2 @JohnPBloch
8 years ago

+1

Had to add a workaround in Child Themify to deal with this issue. It was distinctly not pretty.

#3 in reply to: ↑ 1 @JohnPBloch
8 years ago

Replying to helen:

Boo, dropped filter. Why not keep the name the same?

Because it wouldn't be doing the same thing, I suppose. Links need to be updated to work with the backbone templating since they only get printed once and have theme-specific data added later by the render() method.

#4 @georgestephanis
8 years ago

what he said.

You can see both implementations here:

https://github.com/georgestephanis/theme-downloader/blob/master/theme-downloader.php

(my implemention assumes the above patch)

In the old way, it was just a case of shoving the link into an array and wp_list_table would take care of the output.

The new way, you actually need to modify the backbone template to expect it and prepare a place, in addition to adding the link to the $theme object that's output in the js.

I also discussed this with @matveb here: https://twitter.com/daljo628/status/426835088278437888

Last edited 8 years ago by georgestephanis (previous) (diff)

#5 follow-up: @helen
7 years ago

  • Keywords close added

I think this poses kind of an interesting general question - how do PHP hooks mix with JS templates?

Upon further thought (10 months of thought, apparently), I think this particular action isn't one I'd be excited to support. The current UI doesn't scale to fit arbitrary things in that spot and, as above, I think this is perhaps more of an opportunity to think about the bigger picture.

#6 in reply to: ↑ 5 @obenland
7 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Replying to helen:

The current UI doesn't scale to fit arbitrary things in that spot […]

Exactly that was my first thought too, when I read the summary of this ticket.

I agree, let's not continue to support that.

Note: See TracTickets for help on using tickets.