Making WordPress.org


Ignore:
Timestamp:
01/07/2015 11:39:26 PM (10 years ago)
Author:
obenland
Message:

WP.org Themes: Improve cmmercial themes page.

  • Only enqueues theme scripts if not on a page, to avoid theme list hijacking.
  • Slight adjustment of the Haiku position to be more centered.
  • Less padding at the bottom of the theme list to reduce visual break.

See #745.

File:
1 edited

Legend:

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

    r1089 r1101  
    8181    wp_enqueue_script( 'google-jsapi', '//www.google.com/jsapi', array(), null );
    8282
    83     wp_enqueue_script( 'theme', self_admin_url( 'js/theme.js' ), array( 'wp-backbone' ), false, 1 );
    84     wp_enqueue_script( 'wporg-theme', get_template_directory_uri() . '/js/theme.js', array( 'theme' ), false, 1 );
    85 
    86     wp_localize_script( 'theme', '_wpThemeSettings', array(
    87         'themes'   => false,
    88         'settings' => array(
    89             'isMobile'   => wp_is_mobile(),
    90             'isInstall'  => true,
    91             'canInstall' => false,
    92             'installURI' => null,
    93             'adminUrl'   => '',
    94             'urlBase'    => is_multisite() ? get_blog_details()->path : '/',
    95 
    96         ),
    97         'l10n' => array(
    98             'addNew'            => __( 'Add New Theme' ),
    99             'search'            => __( 'Search Themes' ),
    100             'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
    101             'upload'            => __( 'Upload Theme' ),
    102             'back'              => __( 'Back' ),
    103             'error'             => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ),
    104 
    105             // Downloads Graph
    106             'date'      => __( 'Date' ),
    107             'downloads' => __( 'Downloads' ),
    108         ),
    109         'installedThemes' => array(),
    110     ) );
     83    if ( ! is_singular( 'page' ) ) {
     84        wp_enqueue_script( 'theme', self_admin_url( 'js/theme.js' ), array( 'wp-backbone' ), false, 1 );
     85        wp_enqueue_script( 'wporg-theme', get_template_directory_uri() . '/js/theme.js', array( 'theme' ), false, 1 );
     86
     87        wp_localize_script( 'theme', '_wpThemeSettings', array(
     88            'themes'   => false,
     89            'settings' => array(
     90                'isMobile'   => wp_is_mobile(),
     91                'isInstall'  => true,
     92                'canInstall' => false,
     93                'installURI' => null,
     94                'adminUrl'   => '',
     95                'urlBase'    => is_multisite() ? get_blog_details()->path : '/',
     96            ),
     97            'l10n' => array(
     98                'addNew'            => __( 'Add New Theme' ),
     99                'search'            => __( 'Search Themes' ),
     100                'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
     101                'upload'            => __( 'Upload Theme' ),
     102                'back'              => __( 'Back' ),
     103                'error'             => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ),
     104
     105                // Downloads Graph
     106                'date'      => __( 'Date' ),
     107                'downloads' => __( 'Downloads' ),
     108            ),
     109            'installedThemes' => array(),
     110        ) );
     111    }
    111112}
    112113add_action( 'wp_enqueue_scripts', 'wporg_themes_scripts' );
Note: See TracChangeset for help on using the changeset viewer.