Making WordPress.org

Changeset 9631


Ignore:
Timestamp:
03/25/2020 06:40:50 AM (5 years ago)
Author:
coffee2code
Message:

Theme Directory: Sync the postsPerPage value localized to the JS with value set via posts_per_page option.

In preparation of reducing pageload overhead by loading 12 themes at a time instead of 24. This change will allow JS and non-JS values to match and be changeable via WP admin.

Props dufresnesteven.
See #5062.

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

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    r9622 r9631  
    135135                ),
    136136                'isMobile'     => wp_is_mobile(),
    137                 'postsPerPage' => 24,
     137                'postsPerPage' => get_option( 'posts_per_page' ),
    138138                'path'         => trailingslashit( parse_url( home_url(), PHP_URL_PATH ) ),
    139139                'locale'       => get_locale(),
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js

    r9522 r9631  
    234234            instance = instance || 0;
    235235
    236             // Themes per instance are set at 24
     236            // Themes per instance are set via posts_per_page option in WP admin.
    237237            collection = _( collection.rest( themes.data.settings.postsPerPage * instance ) );
    238238            collection = _( collection.first( themes.data.settings.postsPerPage ) );
Note: See TracChangeset for help on using the changeset viewer.