Skip to content

Commit a5b6393

Browse files
committed
Merge pull request #29 from roidayan/allow_to_pass_options_to_wp_editor
Allow to pass options to wp_editor
2 parents f7e3ddf + c70a2d2 commit a5b6393

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

class.settings-api.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,16 @@ function callback_wysiwyg( $args ) {
274274

275275
echo '<div style="width: ' . $size . ';">';
276276

277-
wp_editor( $value, $args['section'] . '-' . $args['id'] . '', array( 'teeny' => true, 'textarea_name' => $args['section'] . '[' . $args['id'] . ']', 'textarea_rows' => 10 ) );
277+
$editor_settings = array(
278+
'teeny' => true,
279+
'textarea_name' => $args['section'] . '[' . $args['id'] . ']',
280+
'textarea_rows' => 10
281+
);
282+
if ( isset( $args['options'] ) && is_array( $args['options'] ) ) {
283+
$editor_settings = array_merge( $editor_settings, $args['options'] );
284+
}
285+
286+
wp_editor( $value, $args['section'] . '-' . $args['id'], $editor_settings );
278287

279288
echo '</div>';
280289

0 commit comments

Comments
 (0)