WordPress.org

Making WordPress.org

Changeset 8254


Ignore:
Timestamp:
02/15/2019 03:54:03 AM (20 months ago)
Author:
dd32
Message:

Support: Move the update-php strings from the Helphub to the Support Theme for easier usage by locales.

This also switches the page template used from page.php to page-full-width.php on non-en_US sites to avoid some edgecases.

See #4139.

Location:
sites/trunk/wordpress.org/public_html/wp-content
Files:
1 deleted
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/support-helphub.php

    r8071 r8254  
    2424require_once( dirname( __FILE__ ) . '/inc/helphub-customroles/class-helphub-custom-roles.php' );
    2525require_once( dirname( __FILE__ ) . '/inc/helphub-manager/class-helphub-manager.php' );
    26 require_once( dirname( __FILE__ ) . '/inc/helphub-update-php/helphub-update-php.php' );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php

    r8208 r8254  
    811811}
    812812
     813/**
     814 * Include the Strings for the supporg/update-php page.
     815 */
     816include_once __DIR__ . '/helphub-update-php-strings.php';
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/helphub-update-php-strings.php

    r8253 r8254  
    1616 * @return string Filtered post title.
    1717 */
    18 function hh_filter_update_php_title( $title, $id ) {
     18function wporg_support_filter_update_php_title( $title, $id ) {
    1919    if ( is_admin() ) {
    2020        return $title;
     
    2727    return __( 'Get a faster, more secure website: update your PHP today', 'wporg-forums' );
    2828}
    29 add_filter( 'the_title', 'hh_filter_update_php_title', 5, 2 );
     29add_filter( 'the_title', 'wporg_support_filter_update_php_title', 5, 2 );
    3030
    3131/**
     
    3535 * @return string Filtered post content.
    3636 */
    37 function hh_filter_update_php_content( $content ) {
     37function wporg_support_filter_update_php_content( $content ) {
    3838    if ( is_admin() ) {
    3939        return $content;
    4040    }
    4141
    42     if ( ! is_page_template( 'page-update-php.php' ) ) {
     42    if ( ! in_the_loop() || get_the_ID() !== get_queried_object_id() ) {
    4343        return $content;
    4444    }
    4545
    46     if ( ! in_the_loop() || get_the_ID() !== get_queried_object_id() ) {
     46    if ( ! is_page_template( 'page-update-php.php' ) ) {
    4747        return $content;
    4848    }
     
    145145    return $content;
    146146}
    147 add_filter( 'the_content', 'hh_filter_update_php_content', 5 );
     147add_filter( 'the_content', 'wporg_support_filter_update_php_content', 5 );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/page-update-php.php

    r8071 r8254  
    99/*
    1010Use the default template for pages. This specific template is only used to indicate that the content needs to be
    11 manually injected, which happens in the HelpHub plugin.
     11manually injected, which happens in `helphub-update-php-strings.php`
    1212 */
    13 require get_stylesheet_directory() . '/page.php';
     13if ( 'en_US' == get_locale() ) {
     14    // Helphub will be active, so we need it's sidebar
     15    require get_stylesheet_directory() . '/page.php';
     16} else {
     17    // Helphub may be active, but we're loading in a non-en_US locale so shouldn't display the EN sidebar
     18    require get_stylesheet_directory() . '/page-full-width.php';
     19}
Note: See TracChangeset for help on using the changeset viewer.