helsingborg-stad / acf-select-image-field
Installs: 11 289
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 1
Language:JavaScript
Type:wordpress-muplugin
- dev-main
- 1.6.0
- 1.5.0
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.4
- 1.3.3
- 1.3.1
- 1.3.0
- 1.2.5
- 1.2.2
- 1.2.0
- 1.1.4
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.0
- dev-feat/adding-images
- dev-feat/added-news-svg
- dev-chore/removing-console-logs
- dev-chore/adding-listing-image
- dev-fix/image-select-default-value-first
- dev-fix/only-target-image-select-field
- dev-feature/block-conditions
- dev-feature/mutation-and-field-specific-conditions
- dev-fix/remove-disabled-for-all-children
- dev-feature/adding-segment-svg
- dev-fix/styling-fixes
- dev-chore/removing-unused
- dev-feature/conditions-for-custom-field-type
This package is auto-updated.
Last update: 2024-12-19 07:31:00 UTC
README
The ACF Image Select MU (Must Use) plugin is a custom field type for Advanced Custom Fields (ACF) that allows you to use radio buttons with images as options. This makes it easy to create visually appealing and user-friendly selections in your WordPress projects.
Installation
- Download the latest release.
- Upload the
acf-image-select
folder to your WordPressmu-plugins
directory (usuallywp-content/mu-plugins
). If themu-plugins
directory does not exist, you can create it. - The plugin will be automatically activated as an MU plugin when placed in the
mu-plugins
directory.
Usage
Once the ACF Image Select MU plugin is activated, you can use the new field type in your ACF field groups. Here's how to set it up:
- Create or edit a field group in the ACF settings.
- Add a new field and select "Image Select" as the field type.
- Configure the field settings with labels (visible in the backend of a post) and the value (the name of the image and also the actual value of the field in backend).
- Add the field group to your posts, pages, or custom post types.
Customization
To add your own images:
- Upload your own svg file to the assets folder. The name of the file will now be available in the field settings. It will also automatically become the value of the field.
Limitations
Normal Conditionals (Basic) The ACF Image Select plugin has the following limitations regarding conditional logic:
-
It supports either "and" or "or" conditionals. Not both.
Supported Conditionals:
- "image select" != "condition1" AND "image select" != "condition2"
- "image select" == "condition1" OR "image select" == "condition2"
Unsupported Conditionals:
- "image select" != "condition1" OR "image select" != "condition2" AND "image select" != "condition3"
This solution will allow basic conditional logic that will work in most cases.
Use Acf Conditionals (Advanced)
- When creating an Image select field. Also create a "hidden" field with the same name like "{my_field_name}_conditional.
- Set the conditions to this field instead of Image Select.
- It will update the value of this field each time the Image Select field changes and work like default ACF conditions.
Please keep these limitations in mind when implementing conditional logic with the ACF Image Select field.