Making WordPress.org


Ignore:
Timestamp:
03/17/2015 11:37:22 PM (11 years ago)
Author:
obenland
Message:

WP.org Themes: Design parity between modal and singular theme page.

  • Uses Dashicons to display rating stars.
  • Removes the dependency on admin themes styles.

See #950.

File:
1 edited

Legend:

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

    r1386 r1409  
    3838 */
    3939function wporg_themes_scripts() {
    40 
    41     wp_enqueue_style( 'ratings', '//wordpress.org/extend/themes-plugins/bb-ratings/bb-ratings.css', array(), '4' );
    42     wp_enqueue_style( 'themes-style', self_admin_url( 'css/themes.css' ) );
    43     wp_enqueue_style( 'wporg-themes-style', get_stylesheet_uri(), array(), filemtime( __DIR__ . '/style.css' ) );
    44 
    45     wp_enqueue_script( 'google-jsapi', '//www.google.com/jsapi', array( 'jquery' ), null );
     40    wp_enqueue_style( 'wporg-themes', get_stylesheet_uri(), array(), filemtime( __DIR__ . '/style.css' ) );
    4641
    4742    if ( ! is_singular( 'page' ) ) {
     43        wp_enqueue_script( 'google-jsapi', '//www.google.com/jsapi', array( 'jquery' ), null );
     44
    4845        wp_enqueue_script( 'theme', self_admin_url( 'js/theme.js' ), array( 'wp-backbone' ), false, true );
    4946        wp_enqueue_script( 'wporg-theme', get_template_directory_uri() . '/js/theme.js', array( 'theme' ), filemtime( __DIR__ . '/js/theme.js' ), true );
     
    7774}
    7875add_action( 'wp_enqueue_scripts', 'wporg_themes_scripts' );
     76
     77/**
     78 * Extend the default WordPress body classes.
     79 *
     80 * Adds body classes to denote singular themes.
     81 *
     82 * @param array $classes A list of existing body class values.
     83 * @return array The filtered body class list.
     84 */
     85function wporg_themes_body_class( $classes ) {
     86    if ( is_singular( 'repopackage' ) ) {
     87        $classes[] = 'modal-open';
     88    }
     89
     90    return $classes;
     91}
     92add_filter( 'body_class', 'wporg_themes_body_class' );
    7993
    8094/**
Note: See TracChangeset for help on using the changeset viewer.