Skip to content
  • LocationSan Pedro, Laguna, Philippines
  • Office hoursMon–Fri, 8:00 AM – 5:00 PM PHT (UTC+8)

Features

Sysgage Content TypesVersion 1.0.1Updated November 27, 2026

1. Overview

AreaWhat you get
Post typesEvery register_post_type() argument in seven tabs. Labels fill in automatically, there's a Dashicon picker, a live menu preview and seven presets.
TaxonomiesEvery register_taxonomy() argument in seven tabs, including the default term and the meta box style.
Field groups36 field types, drag-and-drop nesting, conditional logic, validation and 23 location rule types.
Options pagesTop-level pages and sub pages, each with its own capability, icon, storage ID and button labels.
Where fields appearPosts, pages, custom post types, terms, users (profile, add and register forms), attachments, comments, menus, menu items, classic widgets, options pages and field blocks.
Developer APIsgct_* template functions, optional ACF aliases, PHP registration, front-end forms.
IntegrationsREST API, shortcode, the Custom Field block, block bindings, ACF-style field blocks, WP-CLI.
WorkflowLocal JSON with sync, JSON and PHP export, import from Sysgage, ACF / ACF Pro and CPT UI, database cleanup.

How it is built:

  • No external services or CDNs at runtime. The only exception is the Google Maps script, which loads only for Google Map fields.
  • No build step and no Composer dependencies.
  • Uses only the JavaScript libraries that ship with WordPress.
  • Every string is translatable (text domain sysgage-content-types).
  • On servers older than PHP 7.4 or WordPress 6.4, the plugin shows an admin notice and does not load.

2. Admin screens

Everything is under the Content Types menu (position 80). Each screen has a header with the logo, the page title, primary actions and tabs to every other screen. On small screens the tabs scroll sideways.

ScreenSlugCapability
Dashboardsgctmanage_options (filter sgct/admin/capability)
Post Typessgct-post-typessame
Taxonomiessgct-taxonomiessame
Field Groupssgct-field-groupssame
Options Pagessgct-options-pagessame
Toolssgct-toolssame
Settingssgct-settingssame

On list screens, add &action=new to the URL to create an item, or &action=edit&key={key} to edit one.

2.1 Dashboard

  • Welcome banner with "New Field Group" and "New Post Type" buttons.
  • Stat tiles: post types, taxonomies, field groups and options pages (each with its active count), plus the total number of fields.
  • Recently updated: definitions with their type, status badge and how long ago they changed.
  • Getting started checklist:
    • create a post type
    • add a taxonomy
    • build a field group
    • create an options page
    • enable Local JSON
  • Quick actions.
  • System status:
    • plugin, WordPress and PHP versions
    • pretty permalinks
    • Local JSON folder (writable, not writable, or not created yet)
    • REST API fields
    • shortcode
    • ACF function aliases (reports when ACF itself is active)
  • Template functions cheat sheet with copy buttons. It covers:
    • displaying a field
    • looping a repeater
    • flexible content
    • options page values
    • term and user fields
    • image fields
    • the shortcode
    • registering in PHP Add your own snippets with the sgct/admin/snippets filter.

2.2 Post types

List screen. Each row shows:

  • the menu icon and label
  • the slug
  • an active/inactive toggle
  • the post count
  • the attached taxonomies
  • a "Local" badge for definitions that come from PHP or JSON

You can search and filter by All / Active / Inactive. Row actions are Edit, Duplicate, Delete and View posts.

"Add Post Type" presets. Some presets can also create a matching field group in the same step.

PresetWhat it sets up
BlankNothing, start from scratch
PortfolioA portfolio post type
EventsAn events post type
TestimonialsA testimonials post type
Team MembersSupports title, editor, thumbnail and page attributes
Products / ServicesSupports title, editor, thumbnail, excerpt and page attributes
FAQSupports title, editor and page attributes

The editor has seven tabs:

TabSettings
BasicPlural and singular labels; a post type key generated from the singular label, checked as you type (max 20 characters, a-z 0-9 _ -, no reserved or existing names); public; hierarchical; description
LabelsAll 29 WordPress labels, filled in automatically, with a "Regenerate" button
Visibility & Menushow_ui, show in menu or under a parent menu, menu position, a Dashicon picker with search, admin bar, nav menus, exclude from search, publicly queryable
Supports & TaxonomiesFeature cards: title, editor, author, thumbnail, excerpt, trackbacks, custom-fields, comments, revisions, page-attributes, post-formats. Taxonomy multi-select (core and custom).
URLsPermalink rewrite (post type key, custom slug or none), with front, feeds, pages, archive, archive slug, query variable
REST & PermissionsShow in REST, REST base, namespace, controller class, custom capability names, delete with user, can export
Editor"Enter title here" text, block template (JSON), template lock, meta box callback

A sidebar card shows a live preview of the admin menu item, along with the Save, Delete and Active controls.

Security note: the register_meta_box_cb and rest_controller_class fields name PHP code to run. They are read-only for users without unfiltered_html, and on multisite only super admins can edit them. You can change this with the sgct/store/can_set_code filter.

2.3 Taxonomies

The list screen works like the post types list.

Presets: Blank, Category style and Tag style.

The editor has seven tabs:

TabSettings
BasicLabels and key (max 32 characters), the post types to attach to (all public post types, including ones you created here), public, hierarchical
LabelsAll taxonomy labels, filled in automatically
VisibilityShow UI, menu, nav menus, tag cloud, quick edit, admin column
URLsRewrite slug, with front, hierarchical URLs, query variable
REST & PermissionsREST settings, the four term capabilities, sort
Default TermEnable, name, slug, description
Meta BoxDefault, custom callback or disabled

2.4 Field groups

List screen. Each row shows:

  • the title and description
  • the number of fields
  • a summary of the location rules
  • an active toggle
  • a "Local JSON" badge, a "PHP" badge, or "Sync available" / "Sync: new"

Row actions are Edit, Duplicate, Export JSON and Delete. You can search and filter.

Builder:

  • Title in a large input. The group key and field count appear underneath.
  • Field list:
    • Drag fields to reorder them or to nest them in repeaters, groups and flexible content layouts.
    • You can also move fields with the keyboard: focus a handle and use the arrow keys.
    • Each row shows its order number, label, name, a type badge with an icon, and buttons for Duplicate, Move (to another field list in the group, such as a repeater's sub fields) and Delete.
    • "Expand all" and "Collapse all" open or close every row.
  • "Add Field" opens a type picker:
    • six categories
    • search
    • an icon, description and preview for each type
    • keyboard navigation
  • Field settings are split into General, Validation, Presentation and Conditional Logic tabs.
    • The field name is generated from the label (snake_case) until you edit it yourself.
    • "Change field type" keeps the common settings and the ones the new type understands. It asks for confirmation before it drops sub fields.
  • Flexible content layouts: each layout can be named, labelled, given a display mode (block, table or row) and a min/max, and can be duplicated or reordered.
  • Location Rules: build OR groups of AND rules. See section 4.
  • Settings sidebar: | Setting | Options | |—|—| | Active | On / off | | Position | High (after title), Normal (after content), Side | | Style | Standard (meta box), Seamless | | Label placement | Top, Left | | Instruction placement | Below labels, Below fields | | Order No. | Number | | Description | Text | | Hide on Screen | permalink, content editor, excerpt, discussion, comments, revisions, slug, author, format, page attributes, featured image, categories, tags, send trackbacks | | Show in REST API | On / off |
  • Saving: a sticky Save Changes bar, a warning if you leave with unsaved changes, and checks before saving (required labels and names, unique names at each level, unique layout names).
  • Local and PHP groups:
    • Groups loaded from a JSON file can be edited. Saving one stores it in the database.
    • Groups registered in PHP are read-only. Duplicate one to get an editable copy.

2.5 Options pages

The list screen works like the other lists. The editor has three tabs:

TabSettings
GeneralPage title, menu title, menu slug, description
MenuParent: top level, Settings, Tools, Appearance, any admin menu, or another options page. Also capability, position, icon (Dashicon picker or URL) and "redirect to first sub page".
Storage & Buttonspost_id storage prefix (default options), autoload, Update button label, updated message

The options page itself shows the matching field groups as postboxes, with a sticky Update box in the side column.

2.6 Tools

TabPurpose
ExportPick any mix of field groups, post types, taxonomies and options pages. Then either download a JSON file or click Generate PHP to get sgct_register_post_type(), sgct_register_taxonomy(), sgct_add_options_page() and sgct_add_local_field_group() code wrapped in add_action( 'sgct/init', … ), with a copy button.
ImportUpload a JSON file. Accepted formats: Sysgage exports, ACF / ACF Pro exports (field groups, post types, taxonomies, options pages), and CPT UI exports (post types, taxonomies, or the combined file). For existing items you can Skip, Overwrite it, or Duplicate. You can also choose "Import as inactive".
Local JSON SyncLists JSON files that are newer than the database copy, or not in the database at all. Review shows the definition; Sync imports it.
Database CleanupFinds orphaned _name reference meta left behind by deleted fields and removes it. You can also delete the stored values. Asks for confirmation first.

2.7 Settings

See section 16.

2.8 Edit screens (where editors enter data)

  • Posts, pages and custom post types:
    • Meta boxes in the block editor and the classic editor, in the high, normal or side position, with standard or seamless style.
    • Tabs and accordions inside groups.
    • Inline validation.
    • In the block editor, saving is locked while a visible required field is empty.
    • Drafts are not validated (filter sgct/screens/validate_post).
  • Terms: fields on the add and edit forms.
  • Users: fields on the profile, edit, add-new and front-end registration forms.
  • Media: fields in the attachment edit screen and the media modal.
  • Comments: a meta box on the comment edit screen.
  • Menus: fields on each menu item and in the menu settings.
  • Widgets: fields inside classic widget forms.
  • Options pages: see section 6.

When field groups are on screen, the core "Custom Fields" meta box is removed, as ACF does. Filter: sgct/screens/remove_wp_meta_box.


3. Field types

3.1 Settings every field has

SettingKeyDefault
Labellabel''
Name (meta key)name''
Keykeyfield_… (generated)
Typetypetext
Instructionsinstructions''
Requiredrequiredfalse
Conditional logicconditional_logicfalse
Wrapper width % / class / idwrapper{width:'', class:'', id:''}
Default valuedefault_value''
Show in RESTshow_in_resttrue
Read onlyreadonlyfalse

The sgct_get_field() return values below assume the default $format_value = true. With false, you get the raw stored value.

3.2 Basic

TypeType-specific settings (defaults)sgct_get_field() returns
Text textplaceholder, prepend, append, maxlengthString. HTML is removed on save.
Text Area textareaplaceholder, maxlength, rows, new_lines ('' | wpautop | br)String, with wpautop() or nl2br() applied according to new_lines. HTML is filtered with wp_kses_post for users without unfiltered_html.
Number numbermin, max, step, placeholder, prepend, appendint or float; '' when empty
Range rangemin, max, step, prepend, appendint or float; '' when empty
Email emailplaceholder, prepend, appendString
URL urlplaceholderString
Password passwordplaceholder, prepend, appendString. Never exposed through REST, the shortcode, the block or bindings.

3.3 Content

TypeSettings (defaults)Returns
Image imagereturn_format (array | url | id, default array; new fields use the "Default image return format" setting), library (all | uploadedTo), preview_size (medium), min_width, min_height, min_size, max_width, max_height, max_size (MB), mime_typesarray: attachment array (see below). url: string. id: int. false when empty.
File filereturn_format (array), library, min_size, max_size, mime_typesSame as Image (no sizes, width or height for non-images)
WYSIWYG Editor wysiwygtabs (all | visual | text), toolbar (full | basic), media_upload (1), delay (0)HTML string run through the sgct_the_content filter: wptexturize, wpautop, shortcodes, embeds, wp_filter_content_tags
oEmbed oembedwidth, heightEmbed HTML, or the URL if it can't be embedded
Gallery galleryreturn_format (array), library, insert (append | prepend), preview_size, min, max, the same size, dimension and MIME limits as ImageArray of attachment arrays, URLs or IDs; false when empty

Attachment array keys:

  • ID, id, title, filename, filesize, url, link, alt
  • author, description, caption, name, status, uploaded_to
  • date, modified, menu_order
  • mime_type, type, subtype, icon
  • images only: width, height, and sizes, which holds {size}, {size}-width and {size}-height for each size

Filter the array with sgct/attachment_array.

3.4 Choice

choices are entered one per line as value : label.

TypeSettings (defaults)Returns
Select selectchoices, default_value, return_format (value | label | array), allow_null, multiple, ui (searchable select), placeholderSingle: value, label, or ['value'=>…, 'label'=>…]. Multiple: an array of these.
Checkbox checkboxchoices, default_value, return_format, allow_custom, layout (vertical | horizontal), toggle (adds a "Toggle all" box)Array of values, labels or value/label arrays
Radio Button radiochoices, default_value, return_format, allow_null, other_choice, layoutValue, label or value/label array
Button Group button_groupchoices, default_value, return_format, allow_null, layout (horizontal)Same as Radio
True / False true_falsedefault_value (0), message, ui (switch, default on), ui_on_text, ui_off_textbool

3.5 Relational

TypeSettings (defaults)Returns
Link linkreturn_format (array | url)['title'=>…, 'url'=>…, 'target'=>…] or a URL; false when empty
Post Object post_objectpost_type[], post_status[], taxonomy[] (taxonomy:slug filters), return_format (object | id), allow_null, multipleWP_Post or int; an array of them when multiple; false when empty. Trashed posts are skipped.
Page Link page_linkpost_type[], post_status[], taxonomy[], allow_archives (1), allow_null, multiplePermalink string (or array of strings); archive URLs are returned as they are
Relationship relationshippost_type[], post_status[], taxonomy[], return_format (object), min, max, filters (search, post_type, taxonomy), elements (featured_image)Array of WP_Post or IDs; false when empty
Taxonomy taxonomytaxonomy (category), field_type (checkbox | multi_select | radio | select), return_format (id | object), allow_null, add_term (1), save_terms, load_termsCheckbox / multi select: array of IDs or WP_Term. Radio / select: one ID or WP_Term. false when empty.
User userrole[], return_format (array | object | id), allow_null, multiplearray: ID, user_firstname, user_lastname, nickname, user_nicename, display_name, user_email, user_url, user_registered, user_description, user_avatar. object: WP_User. id: int. An array of these when multiple.

save_terms sets the selected terms on the post itself. load_terms reads the post's terms instead of meta. "Create Terms" (add_term) lets editors add new terms from inside the field.

3.6 Advanced

TypeSettings (defaults)Stored asReturns
Google Map google_mapcenter_lat (-37.81411), center_lng (144.96328), zoom (14), height (400)ArrayArray with address, lat, lng, zoom, place_id, name, street_number, street_name, city, state, post_code, country, country_short (empty parts are left out); false when empty. Needs an API key.
Date Picker date_pickerdisplay_format (d/m/Y), return_format (d/m/Y), first_day (1)YmdDate string in return_format (site timezone)
Date Time Picker date_time_pickerdisplay_format, return_format (d/m/Y g:i a)Y-m-d H:i:sFormatted string
Time Picker time_pickerdisplay_format, return_format (g:i a)H:i:sFormatted string
Color Picker color_pickerenable_opacity, return_format (string | array)Hex or rgba()String, or ['red','green','blue','alpha']
Icon Picker icon_pickertabs (dashicons, url), return_format (string | array){type, value}dashicons-… or the URL; or ['type'=>'dashicons'|'url', 'value'=>…]

3.7 Layout

TypeSettingsReturns
Message messagemessage, new_lines, esc_htmlNo value (display only)
Accordion accordionopen, multi_expand, endpointNo value
Tab tabplacement (top | left), selected (open by default), endpoint (start a new tab group)No value
Group grouplayout (block | table | row), sub_fieldsArray of sub field values keyed by sub field name
Repeater repeatersub_fields, min, max, layout (table | block | row, default table), button_label, collapsed (sub field shown when a row is collapsed), pagination, rows_per_page (20)List of rows, each keyed by sub field name; false when empty
Flexible Content flexible_contentlayouts (each with name, label, display, min, max, sub_fields), min, max, button_labelList of rows, each with acf_fc_layout and sgct_layout (the layout name) plus sub values by name; false when empty
Clone cloneclone (field keys and/or group keys), display (seamless | group), layout, prefix_label, prefix_nameArray of the cloned values keyed by name. With seamless display, the cloned fields are also stored as siblings, so you can read them by their own names (with the clone's name as a prefix if prefix_name is on).

Rows in a repeater or flexible content field can be added, duplicated, collapsed, reordered by dragging and removed. min and max are enforced both in the browser and on the server.

3.8 Custom field types

Extend SGCT_Field_Type and register your class on sgct/register_field_types:

add_action( 'sgct/register_field_types', function () {
	class My_Field_Rating extends SGCT_Field_Type {
		public function __construct() {
			$this->name     = 'rating';
			$this->label    = __( 'Rating', 'my-theme' );
			$this->category = 'choice';
			$this->icon     = 'dashicons-star-filled';
			$this->defaults = array( 'max_stars' => 5 );
		}
		public function render_input( array $field, $value, string $input_name ): void {
			printf( '<input type="number" min="0" max="%d" name="%s" value="%s" />',
				(int) $field['max_stars'], esc_attr( $input_name ), esc_attr( $value ) );
		}
		public function format_value( $value, array $field, $object_id ) {
			return (int) $value;
		}
	}
	SGCT_Fields::register( new My_Field_Rating() );
} );

You can override these methods: get_settings(), sanitize_value(), validate_value(), format_value(), load_value(), rest_schema(), enqueue_assets() and is_empty().


4. Location rules

A field group appears on a screen when any rule group matches. Within a group, all rules must match. Every rule offers the operators == (is equal to) and != (is not equal to).

ParamGroupValues
post_typePostAny post type that has a UI
post_templatePostTheme templates for posts, grouped by post type
post_statusPostpublish, future, draft, pending, private
post_formatPoststandard, aside, chat, gallery, link, image, quote, status, video, audio
post_categoryPostCategory terms
post_taxonomyPostAny term, as taxonomy:slug
postPostA specific post
page_templatePagePage templates
page_typePagefront_page, posts_page, top_level, parent, child
page_parentPageA specific parent page
pagePageA specific page
current_userUserlogged_in, viewing_front, viewing_back
current_user_roleUserRoles
user_formUserall, add, edit (Add / Edit), register
user_roleUserRole of the user being edited
taxonomyFormsTerm add/edit screens of a taxonomy, or all
attachmentFormsAll, or a MIME type or group
commentFormsAll, or comments on a post type
widgetFormsAll, or a widget ID base
nav_menuFormsAll, or a menu or menu location
nav_menu_itemFormsAll, or the items of a menu
options_pageFormsAn options page's menu slug
blockFormsA field block (see 13.3)

New field groups start with post_type == post.

Adding a custom rule. Register it with sgct/location/rule_types, offer its values with sgct/location/rule_values/{param}, and do the matching in sgct/location/match/{param}. The matching filter must handle the operator itself.

add_filter( 'sgct/location/rule_types', function ( $types ) {
	$types['site_language'] = array(
		'label'     => 'Site language',
		'group'     => 'Other',
		'operators' => array( '==' => 'is equal to', '!=' => 'is not equal to' ),
	);
	return $types;
} );
add_filter( 'sgct/location/rule_values/site_language', fn() => array( 'en_US' => 'English', 'de_DE' => 'German' ) );
add_filter( 'sgct/location/match/site_language', function ( $result, $rule, $screen ) {
	$match = get_locale() === $rule['value'];
	return '==' === $rule['operator'] ? $match : ! $match;
}, 10, 3 );

5. Conditional logic

Any field can be shown or hidden based on the values of other fields. Conditions are OR groups of AND rules, built on the field's Conditional Logic tab. The field select offers the fields that come before this one. When the target is a choice field, the value select shows its choices.

OperatorMeaning
== / !=Value is (or is not) equal. For multi-value fields: the list contains (or does not contain) the value.
==empty / !=emptyHas no value / has any value
==contains / !=containsValue contains (or does not contain) the text
==patternValue matches a regular expression
> / <Numeric comparison. For multi-value fields, the number of selected items is compared.
  • Scope. Conditions inside a repeater row, group or layout look at that row first, then at the whole form.
  • Hidden fields are disabled, so they are not submitted.
  • Server side: the same rules are evaluated on save, and hidden fields skip validation. This means a hidden required field never blocks saving.

Stored format, the same as ACF's:

'conditional_logic' => array(
	array( // OR group
		array( 'field' => 'field_abc123', 'operator' => '==', 'value' => 'yes' ), // AND
	),
),

6. Options pages

Options pages give you global fields (contact details, a footer, a banner) that are stored in wp_options.

  1. Create the page under Content Types > Options Pages, or in code (see section 8).
  2. Create a field group with the location rule Options Page == {menu slug}.
  3. Read the values with 'options', or with the page's custom post_id, as the object ID.
$phone = sgct_get_field( 'company_phone', 'options' );

if ( sgct_have_rows( 'social_links', 'options' ) ) {
	while ( sgct_have_rows( 'social_links', 'options' ) ) {
		sgct_the_row();
		printf( '<a href="%s">%s</a>', esc_url( sgct_get_sub_field( 'url' ) ), esc_html( sgct_get_sub_field( 'network' ) ) );
	}
}

Options page settings:

  • page_title, menu_title, menu_slug
  • parent_slug: empty means a top-level page. Otherwise use a menu file such as options-general.php or another page's slug.
  • capability (default edit_posts)
  • position, icon_url
  • redirect: a top-level page opens its first sub page
  • post_id (default options)
  • autoload (default false)
  • update_button, updated_message, description

Storage. Values are stored as {post_id}_{name}, with the field key in _{post_id}_{name} (for example options_company_phone). This is the same as ACF.

Visitors. The shortcode, the block and block bindings show options values only to users who can open that options page. To show a page's values to every visitor, tick it under Settings > Integrations > Public options pages. Only fields placed on that page are shown.


7. Template function reference

Each function takes a selector: a field name ('subtitle') or a field key ('field_65f1c2a9b3d4e').

Most functions also take an optional $post_id:

ValueObject
false / 0 / omittedThe current post in the loop, or the queried object
123 or a WP_PostA post
'term_5', '{taxonomy}_5' (e.g. 'category_5') or a WP_TermA term
'user_2' or a WP_UserA user
'comment_3' or a WP_CommentA comment
'options' or a custom options post_idAn options page
'menu_7', 'nav_menu_item_9'A menu or a menu item

7.1 Reading values

FunctionDescription
sgct_get_field( $selector, $post_id = false, $format_value = true, $escape_html = false )Returns the value. If the selector is not a registered field, returns the raw meta value, or null if there is none. $escape_html runs strings through wp_kses_post.
sgct_the_field( $selector, $post_id = false, $format_value = true )Echoes the value through wp_kses_post. Arrays are joined with , . Posts print their title, and links and images print their URL.
sgct_get_fields( $post_id = false, $format_value = true )Returns all values as name => value, or false
sgct_get_field_object( $selector, $post_id = false, $format_value = true, $load_value = true )Returns the field definition with its value, or false
sgct_get_field_objects( $post_id = false, $format_value = true )Returns name => field object, or false
<h2><?php echo esc_html( sgct_get_field( 'subtitle' ) ); ?></h2>

<?php $cover = sgct_get_field( 'cover_image' ); // Image, return format "array" ?>
<?php if ( $cover ) : ?>
	<img src="<?php echo esc_url( $cover['sizes']['large'] ); ?>" alt="<?php echo esc_attr( $cover['alt'] ); ?>" />
<?php endif; ?>

<?php foreach ( (array) sgct_get_field( 'related_books' ) as $book ) : // Relationship, return format "object" ?>
	<a href="<?php echo esc_url( get_permalink( $book ) ); ?>"><?php echo esc_html( get_the_title( $book ) ); ?></a>
<?php endforeach; ?>

7.2 Row loops: repeater, flexible content and group

FunctionDescription
sgct_have_rows( $selector, $post_id = false )true while rows remain. Inside a row, call it with a sub field name to start a nested loop.
sgct_the_row( $format = false )Moves to the next row and returns it (raw by default, or formatted and keyed by name)
sgct_get_row( $format = false )Returns the current row
sgct_get_sub_field( $selector, $format_value = true )Returns a sub field value from the current row
sgct_the_sub_field( $selector )Echoes a sub field value
sgct_get_sub_field_object( $selector, $format_value = true )Returns the sub field definition and its value
sgct_get_row_layout()Returns the layout name of the current flexible content row
sgct_get_row_index()Returns the current row number (1-based)
sgct_reset_rows()Leaves the current loop early (call it before break)

Repeater:

<?php if ( sgct_have_rows( 'chapters' ) ) : ?>
	<ol>
	<?php while ( sgct_have_rows( 'chapters' ) ) : sgct_the_row(); ?>
		<li>
			<strong><?php sgct_the_sub_field( 'title' ); ?></strong>
			<span><?php echo (int) sgct_get_sub_field( 'pages' ); ?> pages</span>

			<?php // Nested repeater ?>
			<?php if ( sgct_have_rows( 'sections' ) ) : ?>
				<ul>
				<?php while ( sgct_have_rows( 'sections' ) ) : sgct_the_row(); ?>
					<li><?php echo esc_html( sgct_get_sub_field( 'heading' ) ); ?></li>
				<?php endwhile; ?>
				</ul>
			<?php endif; ?>
		</li>
	<?php endwhile; ?>
	</ol>
<?php endif; ?>

You can also work with the whole array:

foreach ( (array) sgct_get_field( 'chapters' ) as $i => $row ) {
	echo esc_html( ( $i + 1 ) . '. ' . $row['title'] );
}

Flexible content:

<?php while ( sgct_have_rows( 'page_sections' ) ) : sgct_the_row(); ?>
	<?php switch ( sgct_get_row_layout() ) :
		case 'hero': ?>
			<section class="hero">
				<h1><?php echo esc_html( sgct_get_sub_field( 'headline' ) ); ?></h1>
				<?php $bg = sgct_get_sub_field( 'background' ); ?>
				<?php if ( $bg ) echo wp_get_attachment_image( $bg['ID'], 'full' ); ?>
			</section>
			<?php break;
		case 'text_block': ?>
			<section class="text"><?php echo wp_kses_post( sgct_get_sub_field( 'body' ) ); ?></section>
			<?php break;
		case 'quote': ?>
			<blockquote><?php sgct_the_sub_field( 'quote' ); ?></blockquote>
			<?php break;
	endswitch; ?>
<?php endwhile; ?>

Or, using templates:

while ( sgct_have_rows( 'page_sections' ) ) {
	sgct_the_row();
	get_template_part( 'sections/' . sgct_get_row_layout() );
}

Group (a loop with exactly one row, or read the array directly):

$address = sgct_get_field( 'address' ); // ['street' => …, 'city' => …]
echo esc_html( $address['city'] );

if ( sgct_have_rows( 'address' ) ) {
	while ( sgct_have_rows( 'address' ) ) {
		sgct_the_row();
		echo esc_html( sgct_get_sub_field( 'street' ) );
	}
}

7.3 Writing values

FunctionDescription
sgct_update_field( $selector, $value, $post_id = false )Saves a value, sanitized by the field type. Containers accept rows keyed by sub field name or key.
sgct_delete_field( $selector, $post_id = false )Deletes a value, including all container rows
sgct_update_sub_field( $selector, $value, $post_id = false )Inside a loop, updates a sub field of the current row. Outside a loop, pass a path such as array( 'chapters', 2, 'title' ) (row numbers are 1-based).
sgct_add_row( $selector, $row, $post_id = false )Appends a row and returns the new row count, or false. For flexible content, include 'acf_fc_layout' => 'name'.
sgct_update_row( $selector, $i, $row, $post_id = false )Merges values into row $i (1-based)
sgct_delete_row( $selector, $i, $post_id = false )Removes row $i (1-based)
sgct_update_field( 'isbn', '978-0-00-000000-0', $post_id );

sgct_update_field( 'chapters', array(
	array( 'title' => 'Prologue', 'pages' => 12 ),
	array( 'title' => 'Chapter One', 'pages' => 30 ),
), $post_id );

sgct_add_row( 'chapters', array( 'title' => 'Epilogue', 'pages' => 8 ), $post_id );
sgct_update_row( 'chapters', 2, array( 'pages' => 32 ), $post_id );
sgct_delete_row( 'chapters', 1, $post_id );

sgct_add_row( 'page_sections', array( 'acf_fc_layout' => 'quote', 'quote' => 'Hello' ), $post_id );

7.4 Users, terms, comments and menus

// Term fields on a category archive.
$term  = get_queried_object();
$color = sgct_get_field( 'genre_color', $term );               // WP_Term object
$icon  = sgct_get_field( 'genre_icon', 'genre_' . $term->term_id ); // "{taxonomy}_{id}"
$same  = sgct_get_field( 'genre_icon', 'term_' . $term->term_id );  // "term_{id}"

// User fields (e.g. author archive).
$author_id = get_the_author_meta( 'ID' );
echo esc_html( sgct_get_field( 'twitter_handle', 'user_' . $author_id ) );

// Loop through a repeater on a user.
while ( sgct_have_rows( 'awards', 'user_' . $author_id ) ) {
	sgct_the_row();
	echo esc_html( sgct_get_sub_field( 'award_name' ) );
}

// Comment and menu item fields.
$rating = sgct_get_field( 'rating', 'comment_' . $comment->comment_ID );
$badge  = sgct_get_field( 'menu_badge', $menu_item ); // in a nav walker, $menu_item is a WP_Post

8. Registering definitions in PHP

Register definitions on the sgct/init action. It runs on init priority 4, before the plugin registers post types and taxonomies. Definitions registered in code appear in the admin with a "PHP" badge and are read-only there.

add_action( 'sgct/init', function () {

	sgct_register_post_type( array(
		'key'       => 'post_type_book',
		'title'     => 'Books',
		'post_type' => 'book',
		'labels'    => array( 'name' => 'Books', 'singular_name' => 'Book' ),
		'menu_icon' => 'dashicons-book',
		'supports'  => array( 'title', 'editor', 'thumbnail' ),
		'has_archive' => true,
	) );

	sgct_register_taxonomy( array(
		'key'         => 'taxonomy_genre',
		'title'       => 'Genres',
		'taxonomy'    => 'genre',
		'object_type' => array( 'book' ),
		'hierarchical'=> true,
	) );

	sgct_add_options_page( array(
		'page_title' => 'Store Settings',
		'menu_slug'  => 'store-settings',
	) );
	sgct_add_options_sub_page( array( 'page_title' => 'Footer' ) ); // under the last top-level page

	sgct_add_local_field_group( array(
		'key'      => 'group_book_details',
		'title'    => 'Book Details',
		'fields'   => array(
			array( 'key' => 'field_book_subtitle', 'label' => 'Subtitle', 'name' => 'subtitle', 'type' => 'text' ),
			array(
				'key' => 'field_book_chapters', 'label' => 'Chapters', 'name' => 'chapters', 'type' => 'repeater',
				'sub_fields' => array(
					array( 'key' => 'field_book_ch_title', 'label' => 'Title', 'name' => 'title', 'type' => 'text' ),
				),
			),
		),
		'location' => array( array( array( 'param' => 'post_type', 'operator' => '==', 'value' => 'book' ) ) ),
	) );
} );

Notes:

  • sgct_add_options_page() and sgct_add_options_sub_page() also accept a plain page title string. Their arguments match ACF's.
  • The Tools > Export > Generate PHP button writes this code for you.
  • When ACF compatibility is on, ACF code registered on acf/init or acf/include_fields also works (see section 10).

9. Front-end forms

sgct_form() renders field groups on the front end. It works like acf_form(): it can edit an existing post, term or user, or create a new post. Submissions are signed and nonce-checked, include a honeypot field, and are processed automatically on template_redirect. If you prefer, call sgct_form_head() before get_header().

<?php sgct_form_head(); get_header(); ?>

<?php
sgct_form( array(
	'post_id'      => 'new_post',
	'new_post'     => array( 'post_type' => 'testimonial', 'post_status' => 'pending' ),
	'field_groups' => array( 'group_testimonial' ),
	'post_title'   => true,
	'submit_value' => 'Send testimonial',
	'updated_message' => 'Thanks! Your testimonial is awaiting review.',
) );
?>
ArgumentDefault
id'sgct-form'
post_idthe current object, or 'new_post'
new_postfalse (or an array of post data)
field_groupsarray()
fieldsarray()
post_titlefalse
post_contentfalse
formtrue
form_attributesarray()
return''
html_before_fields''
html_after_fields''
submit_value'Update'
updated_message'Post updated'
label_placement'top'
instruction_placement'label'
field_el'div'
uploader'wp'
honeypottrue
html_updated_message(markup)
html_submit_button(markup)
html_submit_spinner(markup)
ksestrue

Who can submit. By default any visitor can submit a form you place on a page. To restrict it, use the sgct/front_end_form/can_submit filter, for example to require login.


10. ACF compatibility and migration

10.1 What is compatible

Data format. Field values use ACF's storage format:

Field typeStorage
Any field{name} holds the value and _{name} holds the field key
RepeaterRow count in {name}, rows in {name}_{i}_{sub}
Flexible contentArray of layout names in {name}, rows in {name}_{i}_{sub}
GroupSub values in {name}_{sub}
Optionsoptions_{name}
Date / timeYmd, Y-m-d H:i:s, H:i:s

Definition format. Field group, post type, taxonomy and options page definitions use ACF's JSON shape, so ACF JSON exports import directly.

ACF-named functions. These are defined when ACF is not active and Settings > Developer > ACF-compatible functions is on (the default). A function that already exists is never redefined.

  • get_field, the_field, get_fields, get_field_object, get_field_objects
  • update_field, delete_field
  • have_rows, the_row, get_row, get_row_index, get_row_layout, reset_rows
  • get_sub_field, the_sub_field, get_sub_field_object, update_sub_field
  • add_row, update_row, delete_row
  • acf_add_local_field_group, acf_add_options_page, acf_add_options_sub_page
  • acf_form, acf_form_head
  • acf_register_block_type, acf_register_block, acf_get_block_types

ACF hooks that are honoured (when ACF is not active):

  • acf/init and acf/include_fields are fired.
  • acf/load_field, including its /type=, /name= and /key= variants, is applied to fields at runtime.
  • acf/settings/save_json and acf/settings/load_json are applied to Local JSON paths.

Everything else:

  • The shortcode.
  • The REST acf property, with acf_format=standard.
  • block.json blocks with an "acf" key.

10.2 Migrating from ACF / ACF Pro

  1. Back up the database.
  2. In ACF, go to ACF > Tools > Export and export all field groups, post types, taxonomies and options pages as JSON.
  3. In Sysgage Content Types, go to Content Types > Tools > Import and upload the file. Keys are kept, so your stored values connect to the imported fields straight away.
  4. Deactivate ACF. Your templates now use the plugin's ACF-compatible functions.
  5. Check your front-end templates and edit screens, ideally on a staging copy first.
  6. Optional: switch your templates to the sgct_ functions. Then you can turn off the ACF aliases.

If your field groups were registered in PHP with acf_add_local_field_group() on acf/init, they keep working with no changes. If they live in an acf-json folder, add that folder with the acf/settings/load_json filter, or import the files.

If ACF itself does not load (for example the code that registers your options pages), see section 8 for registering them in code.

10.3 Migrating from CPT UI

  1. In CPT UI, go to Tools and copy or download the post types and/or taxonomies JSON. The combined export also works.
  2. In Sysgage Content Types, go to Content Types > Tools > Import. Tick Import as inactive if you want to review the definitions before switching over.
  3. Deactivate CPT UI, then activate the imported definitions. The slugs are the same, so existing posts and terms appear unchanged.

10.4 Differences from ACF

  • Text fields remove HTML on save. ACF keeps it. Use a Text Area or WYSIWYG field when you need markup.
  • ACF hooks. Only the ACF hooks listed in 10.1 are bridged. Hooks such as acf/save_post, acf/format_value and acf/update_value have sgct/ equivalents (see section 17), but are not fired under the ACF name.
  • No direct database import. There is no one-click importer that reads ACF's database tables. Migrate with ACF's JSON export, as described in 10.2.

11. REST API

Turn it on or off under Settings > Integrations > REST API (on by default).

11.1 Field values on core endpoints

Field values appear on posts and custom post types, terms, users and comments (any type that is shown in REST):

  • under the sgct property
  • under acf as well, when ACF is not active and ACF compatibility is on

Only these fields are included:

  • fields in groups with Show in REST API turned on
  • fields that have their own show_in_rest setting on (the default)
  • never password fields, or fields that store no value (messages, tabs, accordions)
GET /wp-json/wp/v2/book/42
{ …, "sgct": { "subtitle": "A Novel", "cover_image": 118, "chapters": [ { "title": "Prologue", "pages": 12 } ] } }

Formats:

  • Default ("light"): IDs for attachments and related posts, terms and users, typed scalars, and containers keyed by sub field name. Flexible content rows include acf_fc_layout.
  • ?sgct_format=standard (or acf_format=standard): the same values as sgct_get_field(), such as image arrays and formatted dates.

Who can read:

ObjectRule
Password-protected postOnly users who can edit it, or requests that send the right password
UserUsers who can edit that user, or list_users
CommentUsers who can edit it

Filter: sgct/rest/can_read.

Updating:

POST /wp-json/wp/v2/book/42
{ "sgct": { "subtitle": "Second Edition", "chapters": [ { "title": "Intro", "pages": 4 } ] } }

This needs edit_post, edit_term, edit_user or edit_comment (filter sgct/rest/can_edit). Values are sanitized and validated like any other save.

11.2 Plugin routes (sgct/v1)

RouteMethodPermissionPurpose
/sgct/v1/options/{post_id}GETedit_posts + each matching page's capabilityValues of the options pages stored under {post_id} (e.g. options). Accepts sgct_format=light|standard.
/sgct/v1/options/{post_id}POST / PUT / PATCHsameUpdate values. Body: { "sgct": { … } } or { "fields": { … } }.
/sgct/v1/field-groupsGETmanage_optionsList field groups. Parameters: status=all|active|inactive, fields=true|false.
/sgct/v1/field-groups/{key}GETmanage_optionsOne field group definition
/sgct/v1/blocks/renderPOSTedit_posts / edit_postUsed by the block editor to preview field blocks

12. Shortcode




"Uncategorised"
AttributeDefaultDescription
fieldField name or key (required)
post_idcurrent postAny object ID from section 7
format10 outputs the raw value
default''Shown when the value is empty or not allowed
sizefullImage size for image and gallery fields
separator, Separator between values in a list
before / after''Text around the output (escaped)

Output by field type:

Field typeOutput
Image<img>
GalleryA row of images
File, link, URLA link
EmailAn obfuscated mailto: link
True / FalseYes / No
WYSIWYG, text area, oEmbedFiltered HTML
ColorThe color value
MapThe address
ListsJoined with separator

Built-in protections:

  • Only registered fields are shown. Arbitrary meta and wp_options rows are never read, so outputs nothing.
  • Selectors starting with _ are refused.
  • Password fields are never shown.
  • Posts must be viewable by the visitor and not password-protected. Terms must belong to a public taxonomy. User fields are shown only to users who can edit that user. Comments must be approved.
  • Options page values follow the rule in section 6.

The shortcode can be turned off in Settings. When ACF is not active, works the same way.


13. Blocks and block bindings

13.1 The "Custom Field" block (sgct/field)

A dynamic block, in the Theme category, that displays any field. It works in posts and templates, and inside the Query Loop block: it reads the post ID from context.

AttributeDefaultDescription
field''Chosen from a searchable list of all fields
postId''Empty means the current post. Also accepts options, an options page or term_5.
prefix / suffix''Text around the value
tagNamedivdiv, p, span, h1–h6, figure or section
formattrueFormat the value
imageSizelargeImage size
separator, Separator for lists
fallback''Shown when the value is empty
linkToPostfalseLink the output to the post
textAlignText alignment

The block supports wide and full alignment, anchor, colors, spacing, typography and borders. The editor shows a live server-side preview. Access rules are the same as for the shortcode.

13.2 Block bindings (WordPress 6.5+)

The plugin registers the bindings source sgct/field. Use it to connect core blocks to fields:

BlockAttributes you can bind
Paragraph, Headingcontent
Imageurl, alt, id, title
Buttonurl, text, linkTarget

Arguments: key (or field / name) and an optional post_id.

<!-- wp:heading {"metadata":{"bindings":{"content":{"source":"sgct/field","args":{"key":"subtitle"}}}}} -->
<h2 class="wp-block-heading"></h2>
<!-- /wp:heading -->

<!-- wp:image {"metadata":{"bindings":{"url":{"source":"sgct/field","args":{"key":"cover_image"}},"alt":{"source":"sgct/field","args":{"key":"cover_image"}}}}} -->
<figure class="wp-block-image"><img alt=""/></figure>
<!-- /wp:image -->

<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"sgct/field","args":{"key":"company_phone","post_id":"options"}}}}} -->
<p></p>
<!-- /wp:paragraph -->

Image and link fields fill the matching attribute (url, alt, id, title or target). Other values become text.

You can turn this off with Settings > Integrations > Block bindings. Filter the values with sgct/blocks/binding_value.

13.3 Field blocks (acf_register_block_type() compatible)

You can build your own blocks whose content is stored in custom fields:

add_action( 'sgct/init', function () {
	sgct_register_block_type( array(
		'name'            => 'testimonial',          // becomes sgct/testimonial
		'title'           => 'Testimonial',
		'category'        => 'text',
		'icon'            => 'format-quote',
		'mode'            => 'preview',               // preview | edit | auto
		'render_template' => 'blocks/testimonial.php', // relative to the child/parent theme, or absolute
		'supports'        => array( 'align' => true ),
	) );
} );

Then create a field group with the location rule Block == sgct/testimonial. In the template, sgct_get_field( 'quote' ) reads the block's own values. The template has these variables: $block, $content, $is_preview, $post_id, $wp_block and $context. You can pass a render_callback instead of a template.

Other ways to register:

  • block.json with an "sgct" or "acf" key, for example { "acf": { "mode": "preview", "renderTemplate": "template.php" } }.
  • When ACF is not active, acf_register_block_type() registers acf/{name} blocks.

14. Local JSON

Local JSON saves every post type, taxonomy, field group and options page as a {key}.json file. This lets you keep definitions in version control and deploy them between environments.

  • Turn it on: create a folder named sgct-json in your active theme. As with ACF, the folder must exist; the plugin does not create it (filter sgct/local_json/auto_create). You can also pick another folder under Settings > Developer > JSON folder: an absolute path, or one relative to the WordPress root. It must be inside wp-content or a theme folder.
  • Saving: each save writes the file. Deleting a definition deletes its file.
  • Loading: files whose definitions are not in the database are still loaded and work as normal, with a "Local JSON" badge. A child theme also loads its parent theme's sgct-json folder.
  • Sync: when a file is newer than the database copy, or is not in the database at all, it shows up under Tools > Local JSON Sync and as a "Sync available" badge. You can also sync from the command line with wp sgct sync.
  • Multisite: only network admins can write files.

Filters: sgct/local_json/path, sgct/local_json/load_paths, sgct/local_json/enabled, sgct/local_json/save_data, sgct/local_json/allowed_roots. When ACF is not active, acf/settings/save_json and acf/settings/load_json are also applied.


15. WP-CLI

wp sgct list <post_type|taxonomy|field_group|options_page> [--status=all|active|inactive] [--fields=<cols>] [--format=table|json|csv|yaml|count|ids]
wp sgct export [--type=<type>] [--keys=<k1,k2>] [--file=<path>] [--php] [--text-domain=<domain>]
wp sgct import <file|-> [--conflict=skip|overwrite|duplicate] [--inactive] [--format=table|json|csv|yaml]
wp sgct sync [--key=<key>] [--dry-run]
wp sgct flush [--hard]

Examples:

wp sgct list field_group --format=json
wp sgct export --file=sgct-export.json
wp sgct export --php --text-domain=my-theme --file=sgct-definitions.php
wp sgct import acf-export-2026-01-01.json
wp sgct import cptui-post-types.json --conflict=duplicate --inactive
wp sgct sync --dry-run
wp sgct flush --hard
  • import accepts Sysgage, ACF / ACF Pro and CPT UI files.
  • flush clears the definition caches and the rewrite rules. With --hard, it also rewrites .htaccess.

16. Settings

Content Types > Settings stores every setting in the sgct_settings option. In code, read them with sgct_get_setting( $name ), write them with sgct_update_setting( $name, $value ), and filter them with sgct/settings.

SectionSettingKeyDefault
GeneralShow the Content Types menushow_adminon
GeneralDefault image return formatdefault_return_format_imagearray
DeveloperLocal JSONlocal_jsonon
DeveloperJSON folderjson_path'' (the theme's sgct-json folder)
DeveloperACF-compatible functionsacf_compat_functionson
IntegrationsREST APIrest_enabledon
IntegrationsShortcodeshortcode_enabledon
IntegrationsBlock bindingsenable_block_bindingson
IntegrationsPublic options pagespublic_options_pagesnone
IntegrationsGoogle Maps API keygoogle_maps_api_key''
Danger zoneDelete data on uninstalldelete_data_on_uninstalloff

Notes:

  • Show the Content Types menu. When this is off, the menu is hidden, but your post types, taxonomies and fields keep working. The Settings screen stays available at admin.php?page=sgct-settings.
  • Delete data on uninstall. When this is on, deleting the plugin removes the definitions, the sgct_* options and the plugin's transients, on every site of a multisite network. Posts, terms and field values are never deleted.

17. Hooks reference

All hooks use the sgct/ prefix. Dynamic parts are shown in {braces}.

17.1 Lifecycle

HookTypeArgumentsDescription
sgct/loadedactionAll modules are loaded
sgct/initactioninit priority 4. Register definitions here.
sgct/registeredaction$registeredPost types and taxonomies are registered (['post_type'=>[slug=>key], 'taxonomy'=>[…]])
sgct/flushed_rewrite_rulesactionThe plugin flushed rewrite rules
sgct/upgradedaction$from, $toThe plugin version changed
sgct/register_field_typesactionRegister custom field types
sgct/block_types_registeredactionQueued field block types are registered

17.2 Definitions (store)

HookTypeArgumentsDescription
sgct/store/defaultsfilter$defaults, $typeDefault definition for a store type
sgct/load_definitionfilter$def, $typeEvery definition as it loads
sgct/pre_savefilter$data, $typeA definition before validation and saving
sgct/validatefilter$errors (WP_Error), $def, $type, $existingAdd validation errors
sgct/reserved_namesfilter$names, $typeReserved post type and taxonomy names
sgct/store/can_set_codefilter$canWhether the user may save callbacks and controller classes
sgct/saved, sgct/saved/{type}action$type, $saved / $savedAfter a save
sgct/deleted, sgct/deleted/{type}action$type, $def / $defAfter a delete
sgct/duplicatedaction$type, $result, $originalAfter a duplicate
sgct/register_localaction$type, $defA PHP definition was registered
sgct/flush_cacheaction$dbThe definition caches were cleared

{type} is one of post_type, taxonomy, field_group or options_page.

17.3 Post type and taxonomy registration

HookTypeArgumentsDescription
sgct/register_post_type_argsfilter$args, $defArguments passed to register_post_type()
sgct/register_taxonomy_argsfilter$args, $defArguments passed to register_taxonomy()
sgct/taxonomy_object_typefilter$object_types, $defThe post types a taxonomy is attached to
sgct/generate_labelsfilter$labels, $type, $singular, $pluralAutomatically generated labels

17.4 Fields and values

HookTypeArgumentsDescription
sgct/prepare_fieldfilter$fieldA field after defaults are merged in
sgct/load_field (+ /type={type}, /name={name}, /key={key})filter$fieldRuntime field definition, e.g. to fill choices dynamically
sgct/field_categoriesfilter$catsType picker categories
sgct/builder_schemafilter$schemaThe builder's settings schema
sgct/sanitize_field_settingsfilter$clean, $rawA sanitized field definition from the builder
sgct/parse_object_idfilter$result, $inputHow a $post_id is resolved
sgct/api/resolve_fieldfilter$field, $selector, $oidWhich field a selector resolves to
sgct/load_value (+ /type=, /name=, /key=)filter$value, $field, $oidA raw value after it is loaded
sgct/format_value (+ /type=, /name=)filter$value, $field, $oidA formatted value
sgct/get_fieldfilter$value, $selector, $oid, $fieldThe final sgct_get_field() result
sgct/sanitize_valuefilter$clean, $value, $fieldA sanitized posted value
sgct/update_value (+ /type=, /name=, /key=)filter$value, $field, $oidA value just before it is stored
sgct/updated_valueaction$value, $field, $oid, $prefixAfter a value is stored
sgct/deleted_valueaction$field, $oid, $prefixAfter a value is deleted
sgct/validate_value (+ /type=)filter$result, $value, $field, $inputReturn true or an error message
sgct/validate_postedfilter$errors, $posted, $fieldsAll validation errors of a submission
sgct/save_postaction$post_idAfter posted values are saved (any object type)
sgct/options_autoloadfilter$autoload, $prefixAutoload for option-stored values
sgct/attachment_arrayfilter$data, $idImage, file and gallery arrays
sgct/clone/fieldsfilter$fields, $clone_fieldThe fields a clone field displays
sgct/icon_picker/dashiconsfilter$iconsIcons offered by the Icon Picker field
sgct/google_maps_api_keyfilter$keyGoogle Maps API key
sgct_the_contentfilter$htmlThe WYSIWYG content pipeline

17.5 Rendering and screens

HookTypeArgumentsDescription
sgct/prepare_field_for_render (+ /type=, /name=, /key=)filter$field, $argsChange a field before it is rendered, or return false to hide it
sgct/field_wrapper_attributesfilter$attrs, $field, $input_name, $argsAttributes of the field wrapper
sgct/render_field/before, sgct/render_field/afteraction$fieldAround each field wrapper
sgct/render_input/before, sgct/render_input/afteraction$field, $value, $input_nameAround each input control
sgct/form_js_config / sgct/fields_js_configfilter$configJavaScript config for sgctForm / sgctFields
sgct/screens/remove_wp_meta_boxfilter$remove, $post, $groupsRemove the core Custom Fields meta box
sgct/screens/validate_postfilter$validate, $postValidate this post save (drafts are skipped by default)
sgct/front_end_form/argsfilter$argsFront-end form arguments
sgct/front_end_form/can_submitfilter$allowed, $dataWho may submit a front-end form
sgct/front_end_form/validatefilter$errors, $posted, $dataFront-end validation errors
sgct/front_end_form/new_postfilter$post_data, $dataPost data for a new_post form
sgct/front_end_form/submittedaction$post_id, $dataAfter a front-end form is saved
sgct/front_end_form/returnfilter$url, $post_id, $dataRedirect URL after saving

17.6 Location rules

HookTypeArgumentsDescription
sgct/location/rule_typesfilter$typesAdd or remove rule types
sgct/location/rule_values, sgct/location/rule_values/{param}filter$values, $paramValues offered for a rule
sgct/location/match/{param}filter$result, $rule, $screen, $groupMatching for one param
sgct/location/matchfilter$result, $rule, $screen, $groupAny rule's result
sgct/location/match_groupfilter$result, $screen, $groupWhether a whole group matches
sgct/location/screenfilter$screenScreen data before matching
sgct/location/screen_groupsfilter$groups, $screenGroups shown on a screen
sgct/location/post_typesfilter$post_typesPost types offered in rules
sgct/location/post_limit, sgct/location/term_limitfilter$limit, $typeHow many items rule selects list

17.7 Options pages

HookTypeArgumentsDescription
sgct/options_pagesfilter$pagesOptions pages added to the menu
sgct/options_page/loadaction$page, $groupsAn options page loads
sgct/options_page/savedaction$post_id, $pageAfter an options page is saved

17.8 Integrations

HookTypeArgumentsDescription
sgct/rest/enabledfilter$enabledREST integration on or off
sgct/rest/acf_aliasfilter$enabledRegister the acf REST property
sgct/rest/fieldsfilter$fields, $screenFields exposed for an object
sgct/rest/valuesfilter$values, $resolved, $object_typeValues returned
sgct/rest/can_read, sgct/rest/can_editfilter$can, $resolved[, $request]REST access
sgct/rest/savedaction$oid, $postedAfter a REST update
sgct/shortcode/enabledfilter$enabledRegister
sgct/shortcode/outputfilter$html, $value, $field, $attsShortcode HTML
sgct/shortcode/allow_accessfilter$allowed, $oid, $selector, $fieldAccess check for the shortcode, the block and bindings
sgct/shortcode/public_options_pagesfilter$slugsOptions pages that any visitor can see
sgct/blocks/editor_datafilter$dataData for the block editor script
sgct/blocks/field_outputfilter$html, $value, $field, $attributesCustom Field block HTML
sgct/blocks/render_blockfilter$html, $block, $is_previewField block HTML
sgct/blocks/binding_valuefilter$result, $value, $field, $attribute, $argsBlock bindings value
sgct/ajax/capabilityfilter$cap, $actionCapability for field AJAX searches
sgct/ajax/query_posts_args, sgct/fields/{type}/queryfilter$args, $fieldPost search query for relational fields
sgct/ajax/query_terms_args, sgct/ajax/query_users_argsfilter$args, $fieldTerm and user searches

17.9 Local JSON, import and tools

HookTypeArgumentsDescription
sgct/local_json/enabledfilter$enabledLocal JSON on or off
sgct/local_json/pathfilter$pathSave folder
sgct/local_json/load_pathsfilter$pathsFolders to load from
sgct/local_json/allowed_rootsfilter$rootsWhere JSON folders may be
sgct/local_json/auto_createfilter$create, $pathCreate a missing folder
sgct/local_json/can_writefilter$canWho may write files
sgct/local_json/save_datafilter$data, $typeFile contents
sgct/local_json/acf_filtersfilter$enabledApply the acf/settings/*_json filters
sgct/local_json/sync_itemsfilter$itemsItems awaiting sync
sgct/local_json/syncedaction$type, $result, $pathAfter a file is synced
sgct/importedaction$results, $conflictAfter an import
sgct/tools/orphansfilter$orphansOrphaned references found by the cleanup tool
sgct/tools/field_reference_existsfilter$exists, $refMark a reference as still in use
sgct/tools/orphans_deletedaction$removed, $delete_valuesAfter cleanup

17.10 Admin and settings

HookTypeArgumentsDescription
sgct/settingsfilter$settingsAll settings
sgct/admin/capabilityfilter$capabilityCapability for the admin screens (default manage_options)
sgct/admin/pagesfilter$pagesAdmin pages and tabs
sgct/admin/menu_iconfilter$iconTop-level menu icon
sgct/admin/noticesfilter$messagesAdmin notice messages
sgct/admin/js_data / sgct/builder/js_datafilter$dataAdmin and builder script data
sgct/builder/terms_limitfilter$limit, $taxonomyTerms listed in the builder
sgct/admin/before_savefilter$data, $type, $raw, $extraDefinition posted from an editor
sgct/admin/savedaction$result, $type, $extra, $is_newAfter an editor save
sgct/admin/post_type_presets, sgct/admin/taxonomy_presetsfilter$presets"Add new" presets
sgct/admin/taxonomy_object_typesfilter$choicesPost types offered in the taxonomy editor
sgct/admin/parent_menu_choicesfilter$choicesParent menus offered in the editors
sgct/admin/dashiconsfilter$iconsIcons in the Dashicon picker
sgct/admin/snippetsfilter$snippetsDashboard cheat sheet snippets
sgct/admin/system_statusfilter$rowsDashboard system status rows
sgct/admin/settings_sectionsfilter$sectionsSettings screen sections
sgct/admin/save_settingsfilter$new, $beforeSettings before they are saved
sgct/settings_savedaction$after, $beforeAfter settings are saved

17.11 ACF compatibility switches

HookTypeArgumentsDescription
sgct/acf_compat_functionsfilter$enabledDefine the ACF-named functions
sgct/acf_hooksfilter$enabledApply the acf/load_field filters

Example: fill a Select field's choices dynamically

add_filter( 'sgct/load_field/name=store_location', function ( $field ) {
	$field['choices'] = array();
	foreach ( get_posts( array( 'post_type' => 'store', 'numberposts' => -1 ) ) as $store ) {
		$field['choices'][ $store->ID ] = $store->post_title;
	}
	return $field;
} );

18. Data storage

WhatWhere
Post type definitionsPrivate posts of type sgct-post-type (JSON in post_content, the key in post_name, status publish = active, draft = inactive)
Taxonomy definitionssgct-taxonomy
Field group definitionssgct-field-group
Options page definitionssgct-options-page
Field valuesPost, term, user and comment meta: {name} with its key reference in _{name}. Options use {post_id}_{name} in wp_options.
SettingsThe sgct_settings option
Local JSON{key}.json in the JSON folder

Key prefixes:

DefinitionPrefix
Post typepost_type_
Taxonomytaxonomy_
Field groupgroup_
Fieldfield_
Layoutlayout_
Options pageui_options_page_

19. FAQ and known limitations

Do I need ACF? No. The plugin works on its own and contains no ACF code.

Can ACF stay active? Yes. The ACF-named functions, the shortcode and the REST acf property are then ACF's, and the plugin's sgct_ versions stay available. Avoid giving fields from both plugins the same name on the same object.

Does it work with the classic editor? Yes. It also works with the block editor, Full Site Editing templates (through the block and block bindings) and the Query Loop block.

Is it multisite-ready? Definitions are stored per site, and uninstall cleans up every site. Local JSON writes are limited to network admins. On multisite, code fields (meta box callbacks and REST controllers) can only be edited by super admins.

How do I translate it? The text domain is sysgage-content-types and the folder is /languages. Labels you enter for post types, taxonomies and fields are stored as you typed them. To get translatable labels, use Generate PHP with a text domain (wp sgct export --php --text-domain=…).

Known limitations in 1.0.0:

  • Field groups that depend on the page template or categories are re-matched on save and reload, not live while you edit.
  • Block bindings have no visual field picker for core blocks. Set args.key in the block's Code Editor or with a pattern. The Custom Field block does have a picker.
  • Text fields remove HTML on save (see 10.4).
  • The position setting of options sub pages is not applied. Sub pages appear in the order they are registered.
  • On multisite, user fields that are filled in on the sign-up form are not kept for pending (unactivated) sign-ups.
  • Fields on the block-based widgets screen have not been confirmed. They work on the classic widgets screen.