Making WordPress.org

Ticket #4276: 4276.diff

File 4276.diff, 2.3 KB (added by atanasangelovdev, 7 years ago)
  • wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php
    index 47af07e01..628858bad 100644
    function wporg_themes_scripts() {  
    7272                        'query'    => wporg_themes_get_themes_for_query(),
    7373                        'settings' => array(
    7474                                /* translators: %s: theme name */
    75                                 'title'        => __( '%s | WordPress.org', 'wporg-themes' ),
     75                                'title'        => array(
     76                                        'default' => __( '%s | WordPress.org', 'wporg-themes' ),
     77                                        'theme'   => '%s - ' . sprintf( __( '%s | WordPress.org', 'wporg-themes' ), __( 'WordPress theme', 'wporg-themes' ) ),
     78                                ),
    7679                                'isMobile'     => wp_is_mobile(),
    7780                                'postsPerPage' => 24,
    7881                                'path'         => trailingslashit( parse_url( home_url(), PHP_URL_PATH ) ),
  • wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js
    index faf9d4e00..8e58ae214 100644
    window.wp = window.wp || {};  
    1616        _.extend( themes, { model: {}, view: {}, routes: {}, router: {}, template: wp.template });
    1717
    1818        themes.utils = {
    19                 title: function ( item ) {
    20                         document.title = $( '<div/>' ).html( themes.data.settings.title.replace( '%s', $( '<div/>' ).text(item).html() ) ).text();
     19                title: function ( item, isTheme ) {
     20                        var format = !!isTheme ? themes.data.settings.title.theme : themes.data.settings.title.default;
     21                        var title  = $( '<div/>' ).html( format.replace( '%s', $( '<div/>' ).text( item ).html() ) ).text();
     22
     23                        if ( document.title !== title ) {
     24                                document.title = title;
     25                        }
    2126                }
    2227        };
    2328
    window.wp = window.wp || {};  
    11311136
    11321137                        // Trigger a route update for the current model
    11331138                        themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.id ) );
    1134                         themes.utils.title( this.model.attributes.name );
     1139                        themes.utils.title( this.model.attributes.name, true );
    11351140
    11361141                        // Sets this.view to 'detail'
    11371142                        this.setView( 'detail' );