2 Answers
2

Why don't you use apply_filters( 'the_content', $var ); when outputting your custom field? You don't really want to save the extra paragraphs, otherwise you'll end up seeing them when editing the custom field. This is not what happens with WordPress.

If you're not happy with what the_content does (it does a lot of things including wpautop) then create a custom filter like this:

That's not what I suggested. You're trying to echo the output using wpautop(); I suggested passing the userdata through wpautop() upon save.
–
Chip BennettApr 28 '11 at 17:22

Question: what is the code for your function to save the userdata to the database?
–
Chip BennettApr 28 '11 at 17:22

@Chip- do you actually want to save data with the html though? I think you just want to pass it through when you output it to the front end template.
–
MiloApr 28 '11 at 17:32

1

@Chip- WordPress only uses it internally when data is output to template, I figured that was the proper way. I try not to pollute my data with markup when I can avoid it. @mathiregister- in your wpautop function, $br should be a boolean or integer: wpautop($sidebar_title, 1);
–
MiloApr 28 '11 at 19:15