[wp-meta] [Making WordPress.org] #4004: Move content of Update PHP page to template file

Making WordPress.org noreply at wordpress.org
Tue Dec 18 13:50:41 UTC 2018


#4004: Move content of Update PHP page to template file
-----------------------------------------------+-----------------------
 Reporter:  flixos90                           |       Owner:  flixos90
     Type:  enhancement                        |      Status:  assigned
 Priority:  normal                             |   Milestone:
Component:  Support Hub                        |  Resolution:
 Keywords:  servehappy has-patch dev-feedback  |
-----------------------------------------------+-----------------------
Changes (by flixos90):

 * keywords:  needs-patch servehappy => servehappy has-patch dev-feedback


Comment:

 [attachment:"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).

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/4004#comment:5>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list