Theme Export: Add index.php and style.css#39173
Conversation
|
Size Change: -30 B (0%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
| $zip->addFromString( | ||
| 'theme/style.css', | ||
| file_get_contents( get_stylesheet_directory() . '/style.css' ) | ||
| ); |
There was a problem hiding this comment.
I think we can use ZipArchive::addFile here. It is what core uses in privacy tools export.
|
|
||
| $zip->addFromString( | ||
| 'theme/index.php', | ||
| '<?php // This file is needed to make the theme work, but it doesn\'t do anything.' |
There was a problem hiding this comment.
Can we go with "Silence is golden"?
There was a problem hiding this comment.
I wonder if the best thing to do is the same as for the style.css - just copy the index.php
draganescu
left a comment
There was a problem hiding this comment.
I am approving this as it is easy to update and revert but it gives us a ground to see how it works. After checking out the nit picks, 🚢
|
I changed the approach slightly to just copy the index.php and style.css from the current theme. |
Mamaduka
left a comment
There was a problem hiding this comment.
Thanks, @scruffian!
We also might want to use wp_normalize_path for file paths.
Description
This adds an index.php and style.css to the export part of the Site Editor. Addressing part of #38199. This raises a few questions:
Testing Instructions
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
*.native.jsfiles for terms that need renaming or removal).