| 开发者 | ryabininvitaliy |
|---|---|
| 更新时间 | 2026年10月20日 23:51 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
rowanweb-image-select-for-acf folder to /wp-content/plugins/, or install the plugin from the Plugins screen.No. The field works the same way in free ACF, ACF PRO and Secure Custom Fields.
With the "Array" return format, get_field() returns everything about the selected choice:
$author = get_field( 'author' );
echo wp_get_attachment_image( $author['image_id'], 'thumbnail' );
echo esc_html( $author['label'] . ', ' . $author['extra']['position'] );
The array contains value, label, image_id, url, alt, width, height, sizes and extra (your extra fields). Whatever the return format is, rwis_get_choice( 'author' ) returns the same array, and rwis_get_choices( 'author' ) returns all choices of the field. The REST API always returns the full array.
Only the value (slug) of the selected choice, or an array of values when multiple selection is enabled — exactly like the built-in Select field.
Yes. Change the field type to Image Select: the existing choices and default value are carried over with the same values, so posts that already have a value keep it. Then add an image to each choice.
Yes. In the free version extra fields are presets: the same value for every post that uses the choice. Pro adds "Editable in post" for an extra field: the value from the choice becomes a default, and editors can write their own text in each post — for example, a different quote every time from the same author with the same photo and position. Pro also shows ready-to-paste template code in the field settings, built from the field's name, return format and extra fields.