[wp-trac] [WordPress Trac] #7969: filter tiny_mce_before_init +
$initArray + JS objects
WordPress Trac
wp-trac at lists.automattic.com
Sun Oct 26 12:29:23 GMT 2008
#7969: filter tiny_mce_before_init + $initArray + JS objects
----------------------+-----------------------------------------------------
Reporter: oncletom | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.8
Component: TinyMCE | Version:
Severity: normal | Keywords: tinymce, $initArray, settings
----------------------+-----------------------------------------------------
Hello,
currently, when we use the filter `tiny_mce_before_init`, returned values
are systematically wrapped between quotes. It is impossible to pass an
object to TinyMCE settings with that system.
Is there any way to deal with them ?
It's there in the `tiny_mce_config.php` :
{{{
foreach ( $initArray as $k => $v )
$mce_options .= $k . ':"' . $v . '",';
}}}
Suggestion:
{{{
foreach ( $initArray as $k => $v )
$mce_options .= $k . ':' . is_array($v) ? '{'.implode(',', $v).'}' :
'"'.$v.'"' . ',';
}}}
Or if it's an array, convert it recursively to JSON for even an easier
usage.
--
Ticket URL: <http://trac.wordpress.org/ticket/7969>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list