WordPress.org

Make WordPress Core

Ticket #17944: 17944-docs.diff

File 17944-docs.diff, 5.2 KB (added by CoenJacobs, 7 years ago)

New patch with doc block and remove the underscore for function

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

     
    172172        $actions = apply_filters( 'theme_action_links', $actions, $themes[$theme_name] );
    173173
    174174        $actions = implode ( ' | ', $actions );
     175       
     176        $ct = array(
     177                'title'          => $title,
     178                'template_dir'   => $template_dir,
     179                'stylesheet_dir' => $stylesheet_dir,
     180                'parent_theme'   => $parent_theme,
     181        );
    175182?>
    176183                <a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
    177184<?php if ( $screenshot ) : ?>
     
    183190        printf( __( '%1$s %2$s by %3$s' ), $title, $version, $author ) ; ?></h3>
    184191<p class="description"><?php echo $description; ?></p>
    185192<span class='action-links'><?php echo $actions ?></span>
    186         <?php if ( current_user_can( 'edit_themes' ) && $parent_theme ) {
    187         /* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?>
    188         <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>
    189 <?php } else { ?>
    190         <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>
    191 <?php } ?>
     193<?php $this->show_files_location( $ct ); ?>
    192194<?php if ( $tags ) : ?>
    193195<p><?php _e( 'Tags:' ); ?> <?php echo join( ', ', $tags ); ?></p>
    194196<?php endif; ?>
     
    235237                // Only get here if each word exists in the tags or one of the fields
    236238                return true;
    237239        }
     240       
     241        /**
     242        * Show location of template and theme files
     243        *
     244        * @param object/array $ct The theme to show it's file locations
     245        */
     246        function show_files_location( $ct ) {
     247                if ( ! is_array( $ct ) ) {
     248                        $ct = get_object_vars( $ct );
     249                }
     250                if ( current_user_can( 'edit_themes' ) && ! empty( $ct['parent_theme'] ) ) {
     251                        /* translators: 1:  template dir, 2: stylesheet_dir, 3: theme title, 4: parent_theme */ ?>
     252                        <p><?php printf( __( 'The template files are located in <code>%1$s</code>. The stylesheet files are located in <code>%2$s</code>. <strong>%3$s</strong> uses templates from <strong>%4$s</strong>. Changes made to the templates will affect both themes.' ), str_replace( WP_CONTENT_DIR, '', $ct['template_dir'] ), str_replace( WP_CONTENT_DIR, '', $ct['stylesheet_dir'] ), $ct['title'], $ct['parent_theme'] ); ?></p>
     253                <?php } else { ?>
     254                        <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>
     255                <?php }
     256        }
    238257}
    239258
    240259?>
  • wp-admin/setup-config.php

     
    5050require_once(ABSPATH . WPINC . '/class-wp-error.php');
    5151
    5252if (!file_exists(ABSPATH . 'wp-config-sample.php'))
    53         wp_die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
     53        wp_die( __( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.' ) );
    5454
    5555$configFile = file(ABSPATH . 'wp-config-sample.php');
    5656
    5757// Check if wp-config.php has been created
    5858if (file_exists(ABSPATH . 'wp-config.php'))
    59         wp_die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
     59        wp_die( __( "<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>" ) );
    6060
    6161// Check if wp-config.php exists above the root directory but is not part of another install
    6262if (file_exists(ABSPATH . '../wp-config.php') && ! file_exists(ABSPATH . '../wp-settings.php'))
    63         wp_die("<p>The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
     63        wp_die( __( "<p>The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>" ) );
    6464
    6565if (isset($_GET['step']))
    6666        $step = $_GET['step'];
  • wp-admin/themes.php

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