Opened 16 years ago
Closed 16 years ago
#12207 closed defect (bug) (invalid)
Trying to override wordpress_adv_hidden to show "kitchen sink" has no effect
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.9.1 |
| Component: | TinyMCE | Keywords: | |
| Focuses: | Cc: |
Description
There's a setting that WordPress / TinyMCE consumes called wordpress_adv_hidden, but it doesn't appear that one can override this setting using the teeny_mce_before_init and tiny_mce_before_init filters. It is certainly possible to add wordpress_adv_hidden => 0 (or "0", doesn't matter) to this array via the filter, but when the TinyMCE settings ultimately get written out in the JavaScript, the values in the key / value pair are always quoted.
Ultimately, these quoted values are causing an issue due to the irritating way JavaScript handles boolean assertions ("0" && {} is true, 0 && {} is false, yet 0 == "0" is true). In the case of this issue, since the values are quoted, the assertion is evaluating to true even if I try to set the value to false so that the "kitchen sink" will forcibly show.
Since wordpress_adv_hidden is set in the JavaScript as a number anyway, can we just wrap a parseInt around that assertion? See patch.
Attachments (1)
Change History (5)
#2
@
16 years ago
Have you tried passing an empty string there, i.e. wordpress_adv_hidden => "". That should always evaluate to false.
#4
@
16 years ago
- Keywords reporter-feedback close removed
- Milestone Unassigned deleted
- Resolution set to invalid
- Status changed from new to closed
You should use boolean false instead of 0. This works as expected:
function unhide_kitchensink( $args ) {
$args['wordpress_adv_hidden'] = false;
return $args;
}
add_filter( 'tiny_mce_before_init', 'unhide_kitchensink' );
Wrap parseInt around wordpress_adv_hidden check