[wp-trac] [WordPress Trac] #40960: Widgets: The Text widget should respect the “Disable the visual editor when writing” setting
WordPress Trac
noreply at wordpress.org
Tue Jul 4 23:25:15 UTC 2017
#40960: Widgets: The Text widget should respect the “Disable the visual editor when
writing” setting
-----------------------------------+-----------------------
Reporter: westonruter | Owner: azaozz
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 4.8.1
Component: Widgets | Version: 4.8
Severity: critical | Resolution:
Keywords: has-patch fixed-major | Focuses:
-----------------------------------+-----------------------
Comment (by westonruter):
Replying to [comment:42 dfterry]:
> Replying to [comment:39 westonruter]:
> > (including if there are line breaks and the auto-paragraphing checkbox
was unchecked),
>
> What if auto paragraphing was disabled in a function and the checkbox
does not match?
How would a function do this? The legacy mode detection in the
[https://github.com/xwp/wordpress-develop/pull/235/files patch] is
currently looking for whether the checkbox was checked and whether there
are line breaks in the widget's text:
{{{#!php
<?php
$wpautop = ! empty( $instance['filter'] );
$has_line_breaks = ( false !== strpos( $instance['text'], "\n" ) );
// If auto-paragraphs are not enabled and there are line breaks, then
ensure legacy mode.
if ( ! $wpautop && $has_line_breaks ) {
return true;
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40960#comment:44>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list