Ticket #17944: 17944-textual-2.diff

File 17944-textual-2.diff, 3.2 KB (added by CoenJacobs, 20 months ago)

New diff, combining all vars to a new single line of text.

  • wp-admin/includes/class-wp-themes-list-table.php

     
    156156        $actions = apply_filters( 'theme_action_links', $actions, $themes[$theme_name] ); 
    157157 
    158158        $actions = implode ( ' | ', $actions ); 
     159         
     160        $ct = array( 
     161                'title'          => $title, 
     162                'template_dir'   => $template_dir, 
     163                'stylesheet_dir' => $stylesheet_dir, 
     164                'parent_theme'   => $parent_theme, 
     165        ); 
    159166?> 
    160167                <a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot"> 
    161168<?php if ( $screenshot ) : ?> 
     
    167174        printf( __( '%1$s %2$s by %3$s' ), $title, $version, $author ) ; ?></h3> 
    168175<p class="description"><?php echo $description; ?></p> 
    169176<span class='action-links'><?php echo $actions ?></span> 
    170         <?php if ( current_user_can( 'edit_themes' ) && $parent_theme ) { 
    171         /* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?> 
    172         <p><?php printf( __( 'The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.' ), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ), $title, $parent_theme ); ?></p> 
    173 <?php } else { ?> 
    174         <p><?php printf( __( 'All of this theme&#8217;s files are located in <code>%2$s</code>.' ), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ) ); ?></p> 
    175 <?php } ?> 
     177<?php $this->show_files_location( $ct ); ?> 
    176178<?php if ( $tags ) : ?> 
    177179<p><?php _e( 'Tags:' ); ?> <?php echo join( ', ', $tags ); ?></p> 
    178180<?php endif; ?> 
     
    217219                // Only get here if each word exists in the tags or one of the fields 
    218220                return true; 
    219221        } 
     222         
     223        /** 
     224        * Show location of template and theme files 
     225        * 
     226        * @param object/array $ct The theme to show it's file locations 
     227        */ 
     228        function show_files_location( $ct ) { 
     229                if ( ! is_array( $ct ) ) { 
     230                        $ct = get_object_vars( $ct ); 
     231                } 
     232                if ( current_user_can( 'edit_themes' ) && ! empty( $ct['parent_theme'] ) ) { 
     233                        /* translators: 1:  template dir, 2: stylesheet_dir, 3: theme title, 4: parent_theme */ ?> 
     234                        <p><?php printf( __( '<strong>%3$s</strong> (<code>%2$s</code>) uses templates from <strong>%4$s</strong> (<code>%1$s</code>).' ), str_replace( WP_CONTENT_DIR, '', $ct['template_dir'] ), str_replace( WP_CONTENT_DIR, '', $ct['stylesheet_dir'] ), $ct['title'], $ct['parent_theme'] ); ?></p> 
     235                <?php } else { ?> 
     236                        <p><?php printf( __( 'All of this theme&#8217;s files are located in <code>%1$s</code>.' ), str_replace( WP_CONTENT_DIR, '', $ct['template_dir'] ) ); ?></p> 
     237                <?php } 
     238        } 
    220239} 
    221240 
    222241?> 
  • wp-admin/themes.php

     
    117117                } 
    118118        } 
    119119        echo implode ( ' | ', $options ); 
     120         
     121        $wp_list_table->show_files_location( $ct ); 
    120122 
    121123        if ( $ct->tags ) : ?> 
    122124        <p><?php _e('Tags:'); ?> <?php echo join(', ', $ct->tags); ?></p>