Opened 4 years ago
Closed 4 years ago
#9677 closed defect (bug) (worksforme)
Quick edit of pages strips page code content
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 2.7.1 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: |
Description
Using WordPress MU 2.7.1 (same codebase as WordPress 2.7.1 in this part)
I'm creating the BuddyPress codex documentation, which includes code snippets. I've turned off the visual editor as it doesn't handle code snippets very well.
Everything works well, and the code displays correctly when saved.
However, if I use the "Quick Edit" option for that page (I changed the slug) then save, all the code snippet content on the page is stripped completely. I'm assuming this would probably be the same for a post.
Here are the steps:
- Create a page with the visual editor turned off.
- Add some example code to that page, wrapped in the <?php ?> tags.
- Save the page, WordPress will convert the code so it uses HTML entities.
- View the page, it should display the code just fine on the page within the theme.
- Go to the edit pages screen and hit the "Quick Edit" link for the page.
- Change the slug and hit the "Update Page" button.
- View the page again, the code is now stripped.
Change History (7)
Page revision previews are also stripping the code, even though it is converted to HTML entities. So now I can't get it back. :(
- Keywords needs-patch added; pages quick edit removed
- Milestone changed from Unassigned to Future Release
- Version set to 2.7.1
Cannot reproduce in trunk. QE doesn't load the post/page content, it's only passed along internally in php (there may be some extra filters in MU).
Also you cannot enter code directly in a textarea, the html special chars have to be entered as entities there when you need to display them.
Well, tested that. For me (2.8 trunk) entering works as long as you do not switch to the visual tab. Looks like the javascript code is already removing it while switching fomr HTML -> Visual.
my test page content (HTML):
Heya, I love that!
<code>Testcode.</code>
<code>Extended Testcode.</code>
<code><?php echo('Test'); ?></code>
With Javascript switched of, the data keeps untained, here is the output within the default theme:
<p><code>Testcode.</code></p>
<p><code>Extended Testcode.</code></p>
<p><code><?php echo('Test'); ?></code></p>
- Milestone Future Release deleted
- Resolution set to worksforme
- Status changed from new to closed
works for me too. please re-open with feedback.

Ugh... Trac formatting.