[ Web Proxy ]
URL:
Viewing: https://www.acf-extended.com/features/fields/code-editor [Back]  [Original]

ACF Code Editor Field – ACF Extended

Code Editor FREE

Docs Fields Code Editor

#Field Render

This field uses the built-in WP Core Codemirror library.

Display a code editor area with multiple languages highlights: Text/HTML, Javascript, CSS, PHP mixed & PHP plain.

Field Group
Code Editor
<div class="my-class"> <p>Lorem dolor sit amet conseguir</p> <p>Vestibulum ante ipsum primis in faucibus</p> </div> <div class="my-class-2"> <p>Lorem dolor sit amet conseguir</p> <p>Vestibulum ante ipsum primis in faucibus</p> </div>

#Field Settings

Setting nameDescription
Default ValueAppears when creating a new post
PlaceholderAppears within the input
Editor modeSyntax highlight: text/html, javascript, application/x-json, css, application/x-httpd-php or text/x-php
Show LinesWhether to show line numbers to the left of the editor
Indent UnitHow many spaces a block (whatever that means in the edited language) should be indented
Character LimitLeave blank for no limit
RowsSets the textarea height
Max rowsSets the textarea max height
HTML EntitiesWhenever to return value as HTML entities

#Field Value

Value can be retrieved using the common get_field() function. The returned data are encoded / decoded HTML entities based on the “HTML Entities” setting. Usage example:

$code_editor = get_field('code_editor');

/**
 * <div class="my-class">
 *     <p>Lorem ipsum dolor sit amet.</p>
 *     <p>Praesent sapien massa, convallis.</p>
 * </div>
 *
 * <div class="my-class-2">
 *     <p>Lorem ipsum dolor sit amet.</p>
 *     <p>Praesent sapien massa, convallis.</p>
 * </div>
 */

EXTENDED

2019 - 2026. ACF is a Delicious Brains Inc brand.

ACF Extended is not affiliated or endorsed by Delicious Brains.


Web Proxy Viewer  |  New URL  |  Original Page