~canonical-sysadmins/wordpress/4.8

« back to all changes in this revision

Viewing changes to wp-admin/theme-editor.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:50:12 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: barry.price@canonical.com-20160817045012-qfui81zhqnqv2ba9
Merge WP4.6 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
}
16
16
 
17
17
if ( !current_user_can('edit_themes') )
18
 
        wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site.').'</p>');
 
18
        wp_die('<p>'.__('Sorry, you are not allowed to edit templates for this site.').'</p>');
19
19
 
20
20
$title = __("Edit Themes");
21
21
$parent_file = 'themes.php';
25
25
'title'         => __('Overview'),
26
26
'content'       =>
27
27
        '<p>' . __('You can use the Theme Editor to edit the individual CSS and PHP files which make up your theme.') . '</p>
28
 
        <p>' . __("Begin by choosing a theme to edit from the dropdown menu and clicking Select. A list then appears of the theme's template files. Clicking once on any file name causes the file to appear in the large Editor box.") . '</p>
 
28
        <p>' . __( 'Begin by choosing a theme to edit from the dropdown menu and clicking the Select button. A list then appears of the theme&#8217;s template files. Clicking once on any file name causes the file to appear in the large Editor box.' ) . '</p>
29
29
        <p>' . __('For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Look Up takes you to a web page with reference material about that particular function.') . '</p>
30
30
        <p id="newcontent-description">' . __( 'In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key. In some cases the Esc key will need to be pressed twice before the Tab key will allow you to continue.' ) . '</p>
31
31
        <p>' . __('After typing in your edits, click Update File.') . '</p>
66
66
$default_types = array( 'php', 'css' );
67
67
 
68
68
/**
69
 
 * Filter the list of file types allowed for editing in the Theme editor.
 
69
 * Filters the list of file types allowed for editing in the Theme editor.
70
70
 *
71
71
 * @since 4.4.0
72
72
 *
112
112
        $newcontent = wp_unslash( $_POST['newcontent'] );
113
113
        $location = 'theme-editor.php?file=' . urlencode( $relative_file ) . '&theme=' . urlencode( $stylesheet ) . '&scrollto=' . $scrollto;
114
114
        if ( is_writeable( $file ) ) {
115
 
                // is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable
 
115
                // is_writable() not always reliable, check return value. see comments @ https://secure.php.net/is_writable
116
116
                $f = fopen( $file, 'w+' );
117
117
                if ( $f !== false ) {
118
118
                        fwrite( $f, $newcontent );
229
229
 
230
230
                        echo "\t<ul>\n";
231
231
                }
232
 
                
 
232
 
233
233
                $file_description = get_file_description( $filename );
234
234
                if ( $filename !== basename( $absolute_filename ) || $file_description !== $filename ) {
235
235
                        $file_description .= '<br /><span class="nonessential">(' . $filename . ')</span>';