Making WordPress.org

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#4004 closed enhancement (fixed)

Move content of Update PHP page to template file

Reported by: flixos90's profile flixos90 Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: HelpHub (wordpress.org/documentation) Keywords: servehappy has-patch dev-feedback
Cc:

Description

Currently the content of https://wordpress.org/support/upgrade-php/ has been written in Gutenberg. While this allows for maximum flexibility, it also has several drawbacks, particularly around the lack of localization support.

Since it is a high priority to have this page available in as many languages as possible, it was decided to instead implement a specific page template, with the content being hard-coded as translatable strings. In addition to that, this approach will make it easier to quickly add further visual assets, as we don't need to worry about implementing Gutenberg blocks for now.

This is a follow-up to #2996.

Attachments (1)

4004.diff (15.2 KB) - added by flixos90 6 years ago.

Download all attachments as: .zip

Change History (12)

#1 @flixos90
6 years ago

  • Keywords servehappy added

This ticket was mentioned in Slack in #core-php by flixos90. View the logs.


6 years ago

#3 @SergeyBiryukov
6 years ago

#3789 was marked as a duplicate.

#4 @SergeyBiryukov
6 years ago

  • Component changed from General to Support Hub

@flixos90
6 years ago

#5 @flixos90
6 years ago

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

4004.diff implements the Update PHP content via a page template and some new specific HelpHub plugin functions:

  • A page template page-update-php.php is added to the Support theme, however that is solely to flag a page as the "Update PHP" page. The actual markup is exactly the same as for regular pages.
  • The actual page content (all translatable) is added by hooking into the_title and the_content (through a new file in the HelpHub plugin). Doing so ensures that the regular filters still fire (for example for adding the TOC to the page), and also decouples it from the actual template - the page's layout is no different from others, hence we'd only end up with redundant markup that we would manually keep in sync with the page.php template.
  • The PHP versions mentioned in the content are injected into the translation strings and dynamically fetched via the Servehappy API so that we can manage this in a central location. I hardcoded the currently relevant values as fallback when such a request would fail - since this will probably not happen, I think it's okay to do so. Better to have something almost relevant there than nothing.
  • I adjusted one link about updating WordPress core, plugins and themes (was previously linking to an old Codex page).

This ticket was mentioned in Slack in #core-php by flixos90. View the logs.


6 years ago

#7 @SergeyBiryukov
6 years ago

  • Owner changed from flixos90 to SergeyBiryukov
  • Status changed from assigned to reviewing

This ticket was mentioned in Slack in #core-php by flixos90. View the logs.


6 years ago

#9 @dd32
6 years ago

  • Owner changed from SergeyBiryukov to dd32
  • Status changed from reviewing to accepted

4004.diff looks good to me, although we'll remove the API call and replace it with the constants we now have available from #4009.

I'll review/commit/implement the changes tomorrow. I don't need an updated patch removing the api call though :)

#10 @dd32
6 years ago

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

In 8071:

Support Hub: Move the Update PHP page to translatable strings.

Props flixos90 for initial patch, dd32.
Fixes #4004.

This ticket was mentioned in Slack in #meta by joyously. View the logs.


6 years ago

Note: See TracTickets for help on using tickets.