Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally pass WYSIWYG field data through wpautop() #264

Merged
merged 2 commits into from Mar 31, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions demo/demo.php
Expand Up @@ -263,6 +263,8 @@
'name' => 'WYSIWYG / Rich Text Editor',
'id' => "{$prefix}wysiwyg",
'type' => 'wysiwyg',
// Set the 'raw' parameter to TRUE to prevent data being passed through wpautop() on save
'raw' => false,
'std' => 'WYSIWYG default value',

// Editor settings, see wp_editor() function: look4wp.com/wp_editor
Expand Down
2 changes: 1 addition & 1 deletion inc/fields/wysiwyg.php
Expand Up @@ -45,7 +45,7 @@ static function add_actions()
*/
static function value( $new, $old, $post_id, $field )
{
return wpautop( $new );
return ( $field['raw'] ? $new : wpautop( $new ) );
}

/**
Expand Down