$allowed_files = array
( 'style.css' =>
$allowed_files['style.css'
] ) +
$allowed_files;
}if ( empty( $file ) ) { $relative_file = 'style.css';
$file =
$allowed_files['style.css'
];
} else { $relative_file =
wp_unslash( $file );
$file =
$theme->
get_stylesheet_directory() . '/' .
$relative_file;
}validate_file_to_edit( $file,
$allowed_files );
// Handle fallback editing of file when JavaScript is not available.
$edit_error = null;
$posted_content = null;
if ( 'POST' ===
$_SERVER['REQUEST_METHOD'
] ) { $r =
wp_edit_theme_plugin_file( wp_unslash( $_POST ) );
if ( is_wp_error( $r ) ) { $edit_error =
$r;
if ( check_ajax_referer( 'edit-theme_' .
$stylesheet . '_' .
$relative_file, 'nonce', false
) &&
isset( $_POST['newcontent'
] ) ) { $posted_content =
wp_unslash( $_POST['newcontent'
] );
}