WordPress.org

Making WordPress.org

Changeset 3315


Ignore:
Timestamp:
06/07/2016 06:55:39 PM (4 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Prevent errors on reference landing page when no wp-parser-since terms are found.

Primarily for development installs of the theme.

Fixes #1698.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r3314 r3315  
    319319     *
    320320     * @param  boolean $ignore_minor Use the major release version X.Y.0 instead of the actual version X.Y.Z?
    321      * @return object
     321     * @return object|WP_Error
    322322     */
    323323    function get_current_version_term( $ignore_minor = true ) {
     
    345345        ) );
    346346
    347         return $version[0];
     347        return is_wp_error( $version ) ? $version : reset( $version );
    348348    }
    349349
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/page-reference-landing.php

    r1504 r3315  
    3636                <div class="new-in-guide section two-columns clear">
    3737                    <div class="widget box gray">
    38                         <h3 class="widget-title"><?php $version = DevHub\get_current_version_term(); printf( __( 'New &amp; Updated in WordPress %s:', 'wporg' ), substr( $version->name, 0, -2 ) ); ?></h3>
     38                    <?php $version = DevHub\get_current_version_term(); ?>
     39                    <?php if ( $version && ! is_wp_error( $version ) ) : ?>
     40                        <h3 class="widget-title"><?php printf( __( 'New &amp; Updated in WordPress %s:', 'wporg' ), substr( $version->name, 0, -2 ) ); ?></h3>
    3941                        <div class="widget-content">
    4042                            <ul class="unordered-list no-bullets">
     
    6264                            </ul>
    6365                        </div>
     66                    <?php endif; ?>
    6467                    </div>
    6568                    <div class="widget box gray">
Note: See TracChangeset for help on using the changeset viewer.