acpt_field
Display a field value
Render a field value through the [acpt]/[acpt_tax]/[acpt_user]/[acpt_option] shortcode machinery and return the rendered output as a string. Use get_acpt_field if you want the raw value instead.
echo acpt_field([
'post_id' => 123,
'box_name' => 'box',
'field_name' => 'field',
]);Parameters
post_id
integer
Conditional
The post ID
term_id
integer
Conditional
The term ID
user_id
integer
Conditional
The user ID
comment_id
integer
Not currently functional
Accepted, but see warning below
wc_product_attribute
integer
Conditional
The WooCommerce product attribute ID
option_page
string
Conditional
The option page slug
box_name
string
Required
The meta box name
field_name
string
Required
The field name
date_format
string
Optional
PHP date format string for Date, DateTime, and Date range fields. Also accepted as dateFormat
time_format
string
Optional
PHP time format string for Time and DateTime fields. Also accepted as timeFormat
width
string | integer
Optional
Element width for Image, Video, and Gallery fields
height
string | integer
Optional
Element height for Image, Video, and Gallery fields
target
string
Optional
Link target attribute for URL fields. One of _blank, _self, _parent, _top
sort
string
Optional
Sort order for multi-value fields (e.g. Gallery, Checkbox). One of asc, desc, rand
elements
integer | string
Optional
Number of columns per row for Gallery fields
render
string
Optional
Field-type-specific render mode override
Exactly one of post_id, term_id, user_id, option_page, or wc_product_attribute must be provided to identify the location.
Return
string
The rendered field output
null
If no location key (post_id/term_id/user_id/option_page/wc_product_attribute) is provided
Last updated