ACPT v2
  • General
    • Minimum requirements
    • Download the plugin
    • Install ACPT
    • Install ACPT with Composer
    • Managing your license
    • Migrating from v1
      • Fix data loss after migration from V1
    • Settings
    • Translations
    • How to open a ticket
  • Basics
    • Custom post types
    • Taxonomies
    • Post type-Taxonomy association
    • Option pages
  • Meta fields
    • Field groups
    • The meta fields manager
      • Group settings
      • Basics
      • Advanced options
      • Conditional rendering
      • Validation rules
    • Field types
      • Address field
      • Audio field
      • Audio multiple field
      • Color field
      • Country field
      • Currency field
      • Date field
      • Datetime field
      • Date range field
      • Editor field
      • Email field
      • Embed field
      • File field
      • Gallery field
      • HTML field
      • Icon field
      • Image field
      • Length field
      • List field
      • Number field
      • Password field
      • Phone field
      • QR Code field
      • Select, checkbox, and radio
      • Rating field
      • Repeater field
      • Relational field
      • Range field
      • Table field
      • Textarea field
      • Text field
      • Time field
      • Toggle field
      • URL field
      • Video field
      • Weight field
  • Permissions manager
    • Custom post types permissions
    • Taxonomies permissions
    • Option pages permissions
    • Meta fields permissions
  • Tools
    • Custom APIs
    • Health check
    • Datasets
    • Export data
    • Import data
  • Forms
    • Manage forms
    • The form builder
    • Examples of form usage
      • Create a new post type
      • Modify an existing post type
      • Create a new term
      • Modify an existing term
      • Create a new user
      • Modify an existing user
    • Form submissions log
  • Dynamic blocks
    • Create your first block
  • Developers
    • Functions
      • register_acpt_post_type
      • delete_acpt_post_type
      • register_acpt_taxonomy
      • delete_acpt_taxonomy
      • assoc_acpt_taxonomy_to_acpt_post
      • remove_assoc_acpt_taxonomy_from_acpt_post
      • register_acpt_option_page
      • delete_acpt_option_page
      • save_acpt_form
      • delete_acpt_form
      • save_acpt_form_field
      • delete_acpt_form_field
      • get_acpt_form_object
      • get_acpt_form_field_object
      • save_acpt_meta_group
      • delete_acpt_meta_group
      • get_acpt_meta_group_objects
      • get_acpt_meta_group_object
      • save_acpt_meta_box
      • delete_acpt_meta_box
      • get_acpt_box_object
      • save_acpt_meta_field
      • delete_acpt_meta_field
      • get_acpt_meta_field_objects
      • get_acpt_meta_field_object
      • save_acpt_meta_field_value
      • delete_acpt_meta_field_value
      • get_acpt_fields
      • acpt_field_has_rows
      • acpt_field_has_blocks
      • get_acpt_field
      • get_acpt_child_field
      • get_acpt_block
      • get_acpt_block_child_field
      • acpt_field
      • is_acpt_field_visible
    • Shortcodes
  • Integrations
    • API Rest field integration
    • Breakdance
      • Build a real estate website
      • Working with nestable fields
    • Bricks builder
      • Build a real estate website
      • Working with nestable fields
      • Working with Slider (Nestable) and Gallery field
      • Working with relational fields inside query loops
      • Additional options
      • Working with text links
    • Divi
    • Elementor
      • Basic field blocks
      • Nestable field blocks
      • Dynamic tags
    • Gutenberg
      • Basic fields block
      • Relational fields block
      • Repeater fields block
      • Working with FSE
    • Oxygen builder
    • Rank Math
    • SEOPress
    • Slim SEO
    • WooCommerce
    • WP All Import/Export
    • WP Grid Builder
    • WPGraphQL
    • WPML
    • Yoast
    • Zion builder
Powered by GitBook
On this page
  • Available shortcodes
  • Other arguments
  • Example: date field
  • Example: email field
  1. Developers

Shortcodes

How to use shortcodes

Available shortcodes

ACPT exposes different shortcodes to display meta fields.

[acpt]

Display custom post-type meta fields.

Usage example:

[acpt box='box_name' field='field_name']

It's possible to specify the post ID:

[acpt pid="234" box='box_name' field='field_name']

If not provided, the global $post object will be used to get it.

[acpt_tax]

Display taxonomy meta fields.

Usage example:

[acpt_tax box='box_name' field='field_name']

It's possible to specify the term ID:

[acpt_tax tid="234" box='box_name' field='field_name']

If no tid or terms are provided, the get_queried_object() is used to try to fetch the term ID.

[acpt_option]

Display an option page meta field.

Usage example:

acpt_option page="your-page-slug" box='box_name' field='field_name']

Where page is the page's slug.

[acpt_user]

Display user meta fields.

Usage example:

[acpt_user box='box_name' field='field_name']

It's possible to specify the user ID:

[acpt_user uid="234" box='box_name' field='field_name']

If uid is not provided, the user of logged-in user is used.

[acpt_media]

Display attachment meta fields.

Usage example:

[acpt_media pid="1203" box='box_name' field='field_name']

In this case, it's mandatory to specify the attachment ID.

Other arguments

Here is the complete allowed arguments list:

Argument
Is required
Description

box

Required

The box name

field

Required

The field name

width

The width (in px or %) of images (only for Image and Gallery fields)

height

The height (in px or %) of images (only for Image and Gallery fields)

target

The target of (only for Link field)

dateFormat

The date format (only for Date field)

timeFormat

The time format (only for Datetime and time fields)

elements

The number of elements per row (only for Gallery field)

parent

The parent element (only for Repeater nested fields)

index

The numeric index of the nested field (only for Repeater field)

blockName

The parent block name

blockIndex

The numeric index of the nested field (only for Flexible field)

render

Render the (only for Checkbox, Radio, Select, and Select Multi fields), or (only for Email and Phone fields)

list

How to (only for Checkbox, Select Multi, and List fields)

separator

Strings separator (only for Checkbox, Select Multi, and List fields)

classes

Additional CSS classes

Example: date field

Suppose you want to use a custom date format address.

Use the following syntax:

[acpt box='box_name' field='date_field' dateFormat="d/m/Y"]

Example: email field

Suppose you have an email field and want to display it as mailto link.

Do the following:

[acpt_tax box='box_name' field='field_name' render="link"]

Instead, if you want to display just the email as a text string:

[acpt_tax box='box_name' field='field_name' render="text"]
Previousis_acpt_field_visibleNextAPI Rest field integration

Last updated 10 months ago