#4004 closed enhancement (fixed)
Move content of Update PHP page to template file
Reported by: |
|
Owned by: |
|
---|---|---|---|
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)
Change History (12)
This ticket was mentioned in Slack in #core-php by flixos90. View the logs.
6 years ago
#5
@
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
andthe_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 thepage.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
@
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
@
6 years ago
- Owner changed from SergeyBiryukov to dd32
- Status changed from reviewing to accepted
#3789 was marked as a duplicate.