Changeset 35134
- Timestamp:
- 10/13/2015 02:13:12 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/theme-editor.php
r34783 r35134 46 46 wp_reset_vars( array( 'action', 'error', 'file', 'theme' ) ); 47 47 48 if ( $theme ) 48 if ( $theme ) { 49 49 $stylesheet = $theme; 50 else 50 } else { 51 51 $stylesheet = get_stylesheet(); 52 } 52 53 53 54 $theme = wp_get_theme( $stylesheet ); 54 55 55 if ( ! $theme->exists() ) 56 if ( ! $theme->exists() ) { 56 57 wp_die( __( 'The requested theme does not exist.' ) ); 57 58 if ( $theme->errors() && 'theme_no_stylesheet' == $theme->errors()->get_error_code() ) 58 } 59 60 if ( $theme->errors() && 'theme_no_stylesheet' == $theme->errors()->get_error_code() ) { 59 61 wp_die( __( 'The requested theme does not exist.' ) . ' ' . $theme->errors()->get_error_message() ); 62 } 60 63 61 64 $allowed_files = $theme->get_files( 'php', 1 ); … … 63 66 $style_files = $theme->get_files( 'css' ); 64 67 $allowed_files['style.css'] = $style_files['style.css']; 65 $allowed_files += $style_files; 68 /** 69 * Filter the allowed files. 70 * 71 * @since 4.4.0 72 * 73 * @param array $style_files List of style files. 74 * @param object $theme The current Theme object. 75 */ 76 $allowed_files += apply_filters( 'wp_theme_editor_filetypes', $style_files, $theme ); 66 77 67 78 if ( empty( $file ) ) {
Note: See TracChangeset
for help on using the changeset viewer.