Skip to content
This repository
Browse code

Merge pull request #264 from gawainlynch/master

Optionally pass WYSIWYG field data through wpautop()
  • Loading branch information...
commit 2f7b6af409a59e451606619cd1e84fcb2b65c7c8 2 parents 23b4038 + b0660e0
Tran Ngoc Tuan Anh authored

Showing 2 changed files with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 0  demo/demo.php
  2. +1 1  inc/fields/wysiwyg.php
2  demo/demo.php
@@ -263,6 +263,8 @@
263 263 'name' => 'WYSIWYG / Rich Text Editor',
264 264 'id' => "{$prefix}wysiwyg",
265 265 'type' => 'wysiwyg',
  266 + // Set the 'raw' parameter to TRUE to prevent data being passed through wpautop() on save
  267 + 'raw' => false,
266 268 'std' => 'WYSIWYG default value',
267 269
268 270 // Editor settings, see wp_editor() function: look4wp.com/wp_editor
2  inc/fields/wysiwyg.php
@@ -45,7 +45,7 @@ static function add_actions()
45 45 */
46 46 static function value( $new, $old, $post_id, $field )
47 47 {
48   - return wpautop( $new );
  48 + return ( $field['raw'] ? $new : wpautop( $new ) );
49 49 }
50 50
51 51 /**

0 comments on commit 2f7b6af

Please sign in to comment.
Something went wrong with that request. Please try again.