Skip to content

Commit f8d9f58

Browse files
committed
Merge branch 'master' of atanas_angelov_dev_github:htmlburger/carbon-fields-docs
2 parents 32f94e7 + bbc40b0 commit f8d9f58

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

documentation/20-fields/180-rich-text.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,18 @@
22

33
This field renders the built-in WordPress tinyMCE WYSIWYG editor.
44

5-
`Field::make( 'rich_text', 'crb_sidenote', 'Sidenote Content' )`
5+
`Field::make( 'rich_text', 'crb_sidenote', 'Sidenote Content' )`
6+
7+
## Usage
8+
9+
The data retrieved from a Rich Text field will generally need to be manually filtered in order to display properly. Simply echoing the field will lead to improperly formatted paragraphs.
10+
11+
### Applying wpautop filter
12+
This is the minimum you'll want to do. This will fix your paragraphs, but won't process shortcodes or perform other text enhancements (wp_texturize).
13+
14+
`echo wpautop( carbon_get_the_post_meta('crb_sidenote') );`
15+
16+
### Applying all standard content filters
17+
This will apply the same set of filters used on standard Wordpress post content.
18+
19+
`echo apply_filters( 'the_content', carbon_get_the_post_meta('crb_sidenote') );`

0 commit comments

Comments
 (0)