0

I'm wanting to change the wording and add some styling to the upgrade.php page.

We have a situation where we update our codebase across multiple sites via Git - when a user logs in after the update they are greeted with the "You must update your database" message.

This is fine but we want to refine the page a little, either filtering the text or adding a script to do it the dirty way.

The problem is I don't see any hook for this page and the text is hardcoded in upgrade.php.

Any help appreciated :)

1

Well, the first lines of that file, not counting comments/headers, are...

/** Include user install customize script. */
if ( file_exists(WP_CONTENT_DIR . '/install.php') )
   require (WP_CONTENT_DIR . '/install.php');

You could include a custom install script with the rest of your code. That seems the most straightforward approach to me. It is hard to say a lot more as you haven't said what you want to do in much detail.

| improve this answer | |
  • Hey s_ha_dum, thanks for that. Sorry for not being clear - I don't actually want to install anything, I just want to change the wording and add a stylesheet or script to that page. I want to change the way the 'Your database needs to be updated' message is displayed. Rob (sorry for the slow reply) – rob_was_taken Dec 23 '13 at 22:40
  • I understand that you aren't trying to install anything extra but this is a way to add content to that page, or by replacing the appropriate function which looks like the thing to do. – s_ha_dum Dec 23 '13 at 23:25
  • OK, thanks, just wanted to clarify. It took me a while to spot that include for some reason.. @s_ha_dum. Thanks, that's got it :) Happy Holidays ;) – rob_was_taken Dec 24 '13 at 9:47
  • If this solved the problem, please mark it "accepted". Look for the check mark on the side. – s_ha_dum Dec 24 '13 at 14:25
  • Done - thanks. Anything I echo out in /wp-content/install.php lands in the text box just as I need and styles get appended to the head, all good! Cheers. – rob_was_taken Dec 25 '13 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.