
The Code (Syntax Highlighting) field can store multi-line code content. It is intended for large amounts of source code and can store any amount of code.
For HTML text or to use a WYSIWYG editor, you may want to use the WYSIWYG (Visual Editor) Field.
For plain text without a WYSIWYG editor or HTML, you may want to use the Paragraph Text Field.
For shorter text, you may want to use the Plain Text Field.
Contents
Quick Start
- Fill out the Basic Field Settings (Label, Description, and Field Name)
- Select Field Type: Code (Syntax Highlighting).
- Click Save New Field (or Save Field if you’re updating an existing field) to save your field configuration.
Settings
- Output Options
These options will change the way your field value will display.- Trim extra whitespace before/after contents
This will remove any extra spaces before or after the field value. - Allow Shortcodes
This will process any [shortcodes] that you may have in the field value.
- Trim extra whitespace before/after contents
- Maximum Length
The maximum length of text to allow (default: -1), you can set it to -1 to disable the limit.
How to Display
Display with a Shortcode
[pods field="my_code_field"]
Display with PHP: pods_field_display()
<?php echo pods_field_display( 'my_code_field' );
Display with PHP: $pod->display()
<?php $pod = pods(); echo $pod->display( 'my_code_field' );