Support

Account

Forum Replies Created

  • I’ve had the same problem but fixed it with wpautop(). I had to run the data I got from the REST API through another function anyway and as I knew when to expect a return from a WYSIWYG field, I could return it with wpautop().

    Like so:

    
    function format_wysiwyg($value, $sType = 'default')
    {
      if ($sType === 'wysiwyg') :
        return wpautop($value);
      else :
        return $Value;
      endif;
    }
    

    I called it with format_wysiwyg($Value_from_rest, 'wysiwyg') if I knew it was WYSIWYG and just format_wysiwyg($Value_from_rest) if it wasn’t.

    Not very smart, but it worked for my case.

Viewing 1 post (of 1 total)