WordPress.org

Make WordPress Core

Opened 10 months ago

Closed 10 months ago

Last modified 9 months ago

#41455 closed defect (bug) (invalid)

Text widget removes php

Reported by: WPwebbouw Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Widgets Keywords:
Focuses: Cc:

Description

Just tested the 4.8.1 RC1 on a test site.

I use the Php text plugin a lot (https://nl.wordpress.org/plugins/php-text-widget/). That plugin filters the content of the text widget to enable php code in text widgets.

Code between <?php ?> tags including the tags is either removed or placed inside html comments upon switching between Visual and Text mode.

Change History (2)

#1 @marsjaninzmarsa
10 months ago

  • Resolution set to invalid
  • Status changed from new to closed

Current WordPress behavior is correct - content allowed for text widget is HTML code, and PHP is not valid HTML code. If default purpose of native widget is extended/shifted by 3rd party code, that's up to 3rd party to cover new model and also extend sanitization. Or, better, to don't mess with core widget and to create dedicated one.

Problem is with plugin, not with core.

#2 @SergeyBiryukov
9 months ago

  • Component changed from General to Widgets
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.