WordPress.org

Plugin Directory

Changeset 618859


Ignore:
Timestamp:
10/29/12 23:48:52 (18 months ago)
Author:
cfinke
Message:

Infinite Scroll: Backwards-compatibility with WordPress 3.2.

Location:
jetpack/branches/infinite-scroll/modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • jetpack/branches/infinite-scroll/modules/infinite-scroll/infinity.php

    r618841 r618859  
    383383     */ 
    384384    function posts_per_page_query( $query ) { 
    385         if ( is_home() && $query->is_main_query() ) 
     385        global $wp_the_query; 
     386 
     387        if ( is_home() && $query === $wp_the_query ) // After 3.3, this line would be: if ( is_home() && $query->is_main_query() ) 
    386388            $query->query_vars['posts_per_page'] = self::get_settings()->posts_per_page; 
    387389 
     
    746748            return; 
    747749 
    748         $theme_name = wp_get_theme()->name; 
     750        if ( function_exists( 'wp_get_theme' ) ) { 
     751            $theme_name = wp_get_theme()->Name; 
     752        } 
     753        else { 
     754            $theme_name = get_current_theme(); 
     755        } 
    749756 
    750757        ?> 
  • jetpack/branches/infinite-scroll/modules/module-info.php

    r618819 r618859  
    616616 
    617617    <?php else : ?> 
    618         <p><?php echo esc_html( sprintf( __( "At this time, your theme, %s, doesn't support Infinite Scroll. Unlike other Jetpack modules, Infinite Scroll needs information from your theme to function properly.", 'jetpack' ), wp_get_theme()->name ) ); ?></p> 
     618        <p><?php echo esc_html( sprintf( __( "At this time, your theme, %s, doesn't support Infinite Scroll. Unlike other Jetpack modules, Infinite Scroll needs information from your theme to function properly.", 'jetpack' ), ( function_exists( 'wp_get_theme' ) ? wp_get_theme()->Name : get_current_theme() ) ) ); ?></p> 
    619619 
    620620        <p><?php esc_html_e( "Until your theme supports Infinite Scroll, you won't be able to activate this module.", 'jetpack' ); ?></p> 
    621621 
    622622        <?php 
     623 
     624        if ( current_user_can( 'update_themes' ) ) { 
    623625            ob_start(); 
    624             theme_update_available( wp_get_theme() ); 
     626            theme_update_available( function_exists( 'wp_get_theme' ) ? wp_get_theme() : (object) get_theme( get_current_theme() ) ); 
    625627            $theme_update_available = ob_get_clean(); 
    626628 
    627             if ( current_user_can( 'update_themes' ) && ! empty( $theme_update_available ) ) : ?> 
    628             <p><?php printf( __( 'There is an update available for your theme. You may wish to check if this update adds Infinite Scroll support by visiting the <a href="%s">WordPress Updates</a> page.', 'jetpack' ), esc_url( admin_url( 'update-core.php' ) ) ); ?></p> 
    629         <?php endif; ?> 
     629            if ( ! empty( $theme_update_available ) ) : ?> 
     630                <p><?php printf( __( 'There is an update available for your theme. You may wish to check if this update adds Infinite Scroll support by visiting the <a href="%s">WordPress Updates</a> page.', 'jetpack' ), esc_url( admin_url( 'update-core.php' ) ) ); ?></p> 
     631            <?php endif; ?> 
     632        <?php } ?> 
    630633    <?php endif; 
    631634} 
Note: See TracChangeset for help on using the changeset viewer.