WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 16 months ago

Last modified 16 months ago

#17387 closed defect (bug) (duplicate)

Issue with wp_theme_update_row() setting $details_url

Reported by: valendesigns Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1.2
Component: Upgrade/Install Keywords:
Focuses: administration, multisite Cc:

Description

I'm building my own theme auto update script and everything was working perfectly, until I ran into a weird bug.

When you're running WordPress in Multisite the $details_url for themes with an update available is set differently than when running WordPress in single site mode.

In single site mode the details url is set inside the theme_update_available() function found in this file /wp-admin/includes/theme.php. It uses the returned 'url' like so.

$details_url = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']);

However, in Multisite the url is built completely different. It uses the wp_theme_update_row() function in the /wp-admin/includes/update.php file like so.

$details_url = self_admin_url("theme-install.php?tab=theme-information&theme=$theme_key&TB_iframe=true&width=600&height=400");

I'm not exactly sure what the best approach would be to fixing this. I know there is a reason why the url is set like that but without a way to change it for my personal themes (i.e. filter or something) I'm stuck with a broken details screen in Multisite.

I did just add a filter to test it and was successful in fixing the issue, but not sure how to proceed from here.

$details_url = apply_filters( 'network_details_url', self_admin_url("theme-install.php?tab=theme-information&theme=$theme_key&TB_iframe=true&width=600&height=400"), $theme_key, $theme );

Thanks for any help you can give me.

Cheers!
Derek Herman

Change History (4)

comment:1 @wonderboymusic17 months ago

  • Focuses administration multisite added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 3.9

This is Multisite in a nutshell

comment:2 follow-up: @jeremyfelt17 months ago

Sorry for the wait @valendesigns. I think the URL change was taken care of in [21110] via #20961.

We may be able close this ticket unless a filter could come in handy here.

comment:3 in reply to: ↑ 2 @rzen16 months ago

  • Keywords needs-patch removed
  • Resolution set to duplicate
  • Status changed from new to closed

Replying to jeremyfelt:

Sorry for the wait @valendesigns. I think the URL change was taken care of in [21110] via #20961.

We may be able close this ticket unless a filter could come in handy here.

Good eye @jeremyfelt! I don't think a filter is necessary here as the data that is passed in is already filterable. I second your vote to close this one out instead.

comment:4 @jeremyfelt16 months ago

  • Milestone 3.9 deleted
Note: See TracTickets for help on using tickets.