@@ -157,7 +157,7 @@ public function register_rest_routes() {
157
157
);
158
158
}
159
159
160
- function rest_get_theme_data ( $ request ) {
160
+ function rest_get_theme_data () {
161
161
try {
162
162
$ theme_data = CBT_Theme_JSON_Resolver::get_theme_file_contents ();
163
163
return new WP_REST_Response (
@@ -177,7 +177,7 @@ function rest_get_theme_data( $request ) {
177
177
}
178
178
}
179
179
180
- function rest_get_readme_data ( $ request ) {
180
+ function rest_get_readme_data () {
181
181
try {
182
182
$ readme_data = CBT_Theme_Readme::get_sections ();
183
183
return new WP_REST_Response (
@@ -288,7 +288,7 @@ function rest_create_blank_theme( $request ) {
288
288
/**
289
289
* Export the theme as a ZIP file.
290
290
*/
291
- function rest_export_theme ( $ request ) {
291
+ function rest_export_theme () {
292
292
if ( ! class_exists ( 'ZipArchive ' ) ) {
293
293
return new WP_Error (
294
294
'missing_zip_package ' ,
@@ -306,10 +306,10 @@ function rest_export_theme( $request ) {
306
306
307
307
if ( is_child_theme () ) {
308
308
wp_cache_flush ();
309
- $ zip = CBT_Theme_Zip::add_templates_to_zip ( $ zip , 'current ' , $ theme_slug );
309
+ $ zip = CBT_Theme_Zip::add_templates_to_zip ( $ zip , 'current ' );
310
310
$ theme_json = CBT_Theme_JSON_Resolver::export_theme_data ( 'current ' );
311
311
} else {
312
- $ zip = CBT_Theme_Zip::add_templates_to_zip ( $ zip , 'all ' , null );
312
+ $ zip = CBT_Theme_Zip::add_templates_to_zip ( $ zip , 'all ' );
313
313
$ theme_json = CBT_Theme_JSON_Resolver::export_theme_data ( 'all ' );
314
314
}
315
315
@@ -418,7 +418,7 @@ function rest_save_theme( $request ) {
418
418
* It includes the font families from the theme.json data (theme.json file + global styles) and the theme style variations.
419
419
* The font families with font faces containing src urls relative to the theme folder are converted to absolute urls.
420
420
*/
421
- function rest_get_font_families ( $ request ) {
421
+ function rest_get_font_families () {
422
422
$ font_families = CBT_Theme_Fonts::get_all_fonts ();
423
423
424
424
return new WP_REST_Response (
@@ -457,6 +457,7 @@ function rest_reset_theme( $request ) {
457
457
}
458
458
459
459
private function sanitize_theme_data ( $ theme ) {
460
+ $ sanitized_theme = array ();
460
461
$ sanitized_theme ['name ' ] = sanitize_text_field ( $ theme ['name ' ] );
461
462
$ sanitized_theme ['description ' ] = sanitize_text_field ( $ theme ['description ' ] ?? '' );
462
463
$ sanitized_theme ['uri ' ] = sanitize_text_field ( $ theme ['uri ' ] ?? '' );
0 commit comments