WordPress.org

Making WordPress.org


Ignore:
Timestamp:
02/15/2019 03:54:03 AM (16 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.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • 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 );
Note: See TracChangeset for help on using the changeset viewer.