diff --git a/admin/class-create-theme.php b/admin/class-create-theme.php index 11f76d13..b8907b79 100644 --- a/admin/class-create-theme.php +++ b/admin/class-create-theme.php @@ -103,16 +103,17 @@ function create_sibling_theme( $theme, $screenshot ) { $theme_slug = Theme_Utils::get_theme_slug( $theme['name'] ); // Sanitize inputs. - $theme['name'] = sanitize_text_field( $theme['name'] ); - $theme['description'] = sanitize_text_field( $theme['description'] ); - $theme['uri'] = sanitize_text_field( $theme['uri'] ); - $theme['author'] = sanitize_text_field( $theme['author'] ); - $theme['author_uri'] = sanitize_text_field( $theme['author_uri'] ); - $theme['tags_custom'] = sanitize_text_field( $theme['tags_custom'] ); - $theme['image_credits'] = sanitize_textarea_field( $theme['image_credits'] ); - $theme['slug'] = $theme_slug; - $theme['template'] = wp_get_theme()->get( 'Template' ); - $theme['text_domain'] = $theme_slug; + $theme['name'] = sanitize_text_field( $theme['name'] ); + $theme['description'] = sanitize_text_field( $theme['description'] ); + $theme['uri'] = sanitize_text_field( $theme['uri'] ); + $theme['author'] = sanitize_text_field( $theme['author'] ); + $theme['author_uri'] = sanitize_text_field( $theme['author_uri'] ); + $theme['tags_custom'] = sanitize_text_field( $theme['tags_custom'] ); + $theme['image_credits'] = sanitize_textarea_field( $theme['image_credits'] ); + $theme['recommended_plugins'] = sanitize_textarea_field( $theme['recommended_plugins'] ); + $theme['slug'] = $theme_slug; + $theme['template'] = wp_get_theme()->get( 'Template' ); + $theme['text_domain'] = $theme_slug; // Create ZIP file in the temporary directory. $filename = tempnam( get_temp_dir(), $theme['slug'] ); @@ -164,17 +165,18 @@ function clone_theme( $theme, $screenshot ) { $theme_slug = Theme_Utils::get_theme_slug( $theme['name'] ); // Sanitize inputs. - $theme['name'] = sanitize_text_field( $theme['name'] ); - $theme['description'] = sanitize_text_field( $theme['description'] ); - $theme['uri'] = sanitize_text_field( $theme['uri'] ); - $theme['author'] = sanitize_text_field( $theme['author'] ); - $theme['author_uri'] = sanitize_text_field( $theme['author_uri'] ); - $theme['tags_custom'] = sanitize_text_field( $theme['tags_custom'] ); - $theme['image_credits'] = sanitize_textarea_field( $theme['image_credits'] ); - $theme['slug'] = $theme_slug; - $theme['template'] = ''; - $theme['original_theme'] = wp_get_theme()->get( 'Name' ); - $theme['text_domain'] = $theme_slug; + $theme['name'] = sanitize_text_field( $theme['name'] ); + $theme['description'] = sanitize_text_field( $theme['description'] ); + $theme['uri'] = sanitize_text_field( $theme['uri'] ); + $theme['author'] = sanitize_text_field( $theme['author'] ); + $theme['author_uri'] = sanitize_text_field( $theme['author_uri'] ); + $theme['tags_custom'] = sanitize_text_field( $theme['tags_custom'] ); + $theme['image_credits'] = sanitize_textarea_field( $theme['image_credits'] ); + $theme['recommended_plugins'] = sanitize_textarea_field( $theme['recommended_plugins'] ); + $theme['slug'] = $theme_slug; + $theme['template'] = ''; + $theme['original_theme'] = wp_get_theme()->get( 'Name' ); + $theme['text_domain'] = $theme_slug; // Use previous theme's tags if custom tags are empty. if ( empty( $theme['tags_custom'] ) ) { @@ -235,17 +237,18 @@ function create_child_theme( $theme, $screenshot ) { $child_theme_slug = Theme_Utils::get_theme_slug( $theme['name'] ); // Sanitize inputs. - $theme['name'] = sanitize_text_field( $theme['name'] ); - $theme['description'] = sanitize_text_field( $theme['description'] ); - $theme['uri'] = sanitize_text_field( $theme['uri'] ); - $theme['author'] = sanitize_text_field( $theme['author'] ); - $theme['author_uri'] = sanitize_text_field( $theme['author_uri'] ); - $theme['tags_custom'] = sanitize_text_field( $theme['tags_custom'] ); - $theme['image_credits'] = sanitize_textarea_field( $theme['image_credits'] ); - $theme['is_parent_theme'] = true; - $theme['text_domain'] = $child_theme_slug; - $theme['template'] = $parent_theme_slug; - $theme['slug'] = $child_theme_slug; + $theme['name'] = sanitize_text_field( $theme['name'] ); + $theme['description'] = sanitize_text_field( $theme['description'] ); + $theme['uri'] = sanitize_text_field( $theme['uri'] ); + $theme['author'] = sanitize_text_field( $theme['author'] ); + $theme['author_uri'] = sanitize_text_field( $theme['author_uri'] ); + $theme['tags_custom'] = sanitize_text_field( $theme['tags_custom'] ); + $theme['image_credits'] = sanitize_textarea_field( $theme['image_credits'] ); + $theme['recommended_plugins'] = sanitize_textarea_field( $theme['recommended_plugins'] ); + $theme['is_parent_theme'] = true; + $theme['text_domain'] = $child_theme_slug; + $theme['template'] = $parent_theme_slug; + $theme['slug'] = $child_theme_slug; // Create ZIP file in the temporary directory. $filename = tempnam( get_temp_dir(), $theme['slug'] ); @@ -312,16 +315,17 @@ function create_blank_theme( $theme, $screenshot ) { $theme_slug = Theme_Utils::get_theme_slug( $theme['name'] ); // Sanitize inputs. - $theme['name'] = sanitize_text_field( $theme['name'] ); - $theme['description'] = sanitize_text_field( $theme['description'] ); - $theme['uri'] = sanitize_text_field( $theme['uri'] ); - $theme['author'] = sanitize_text_field( $theme['author'] ); - $theme['author_uri'] = sanitize_text_field( $theme['author_uri'] ); - $theme['tags_custom'] = sanitize_text_field( $theme['tags_custom'] ); - $theme['image_credits'] = sanitize_textarea_field( $theme['image_credits'] ); - $theme['template'] = ''; - $theme['slug'] = $theme_slug; - $theme['text_domain'] = $theme_slug; + $theme['name'] = sanitize_text_field( $theme['name'] ); + $theme['description'] = sanitize_text_field( $theme['description'] ); + $theme['uri'] = sanitize_text_field( $theme['uri'] ); + $theme['author'] = sanitize_text_field( $theme['author'] ); + $theme['author_uri'] = sanitize_text_field( $theme['author_uri'] ); + $theme['tags_custom'] = sanitize_text_field( $theme['tags_custom'] ); + $theme['image_credits'] = sanitize_textarea_field( $theme['image_credits'] ); + $theme['recommended_plugins'] = sanitize_textarea_field( $theme['recommended_plugins'] ); + $theme['template'] = ''; + $theme['slug'] = $theme_slug; + $theme['text_domain'] = $theme_slug; // Create theme directory. $source = plugin_dir_path( __DIR__ ) . 'assets/boilerplate'; diff --git a/admin/create-theme/theme-form.php b/admin/create-theme/theme-form.php index 77677879..e9f12d96 100644 --- a/admin/create-theme/theme-form.php +++ b/admin/create-theme/theme-form.php @@ -163,7 +163,7 @@ public static function create_admin_form_page() {

-