I’m used to deal with ACF configurations and I think that the solution to your problem is quite simple, and is integrated in the ACF “gallery” field configuration options.
Check out this link, where you will find described all the options for a “gallery” field. As you will see, there’s a parameter “minimum selection” which description is:
The minimum number of images that are required for the field to
validate. Defaults to 0
As simple as writing ‘2’ in the configuration panel for this specific field, and ACF will check before saving if there are two or more images. If not, an alert message will appear.
I hope it helps!
Related Posts:
- Custom Post Types: How-to get rid of editor (-meta box)
- Visual editor issue by having multiple tiny mce editors in a CPT
- Is it possible to activate customfield ‘text description’ upon activating the customfield ‘checkbox’?
- Extending the search context in the admin list post screen
- what is the correct way to compare dates in a WP query_posts meta_query
- Advanced search form with filters for custom taxonomies and custom fields
- Enable Gutenberg on custom post type
- How to Add Custom Fields to a Custom Post Type?
- How to display value of custom fields in page
- Prevent post from being published if custom fields not filled
- Multiple orderby values in WP_Query
- How do I set the default admin sort order for a custom post type to a custom column?
- Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?
- don’t publish custom post type post if a meta data field isn’t valid
- Do_Shortcode not working for Embed
- Possible to turn off autosave for single custom post type
- Using meta_query, how can i filter by a custom field and order by another one?
- Custom Post Type Data in Sidebar widgets?
- Front end post editing using a form
- Return all custom meta data for one custom post type
- meta_query for keys that aren’t yet set
- How can I change the admin search posts fields?
- Enable sticky posts to custom post_type
- Truncating custom fields
- How to filter custom posts by tags and custom fields?
- Development of a WordPress Search Plugin – Best Practices
- Custom field values deleted when trashing custom post type
- Automatically set post title to same value as a meta box
- How to get all custom fields of any post type
- Display custom post type and custom fields within a Bootstrap Carousel
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- WordPress 4.4+ : How to revision CPT + metadata
- Search multiple custom fields by using meta_query
- How do I Paginate Search Results for Custom Post Types?
- Custom Post Type – Taxonomy Dropdown Menu?
- How to order adjacent posts (prev / next) by custom field value?
- WP_Query orderby custom field then post_date in one query
- Using Custom Fields in Custom Post Type URL
- What should I use – Taxonomies, custom fields, Post Type?
- Query custom post type by custom field
- Hide custom post type field from author?
- how to filter by last name for custom post
- Search that will look in custom field, post title and post content
- How can I add a column/s to wp_posts table?
- Many to Many Relationship between Two Custom Post Types
- clients list using wordpress
- Filtering a WP_Query meta_query by numeric values isn’t working
- Sorting a query by custom field date
- Custom Taxonomy Template Post List with Sort Order
- Automatically fill custom field value on post publish/update
- echo value from ‘select’ field type into page template using cmb2?
- Adding meta values to permalink
- How can I generate a RSS feed based on a custom WP_Query?
- Right way of storing large number of custom post fields
- wordpress plugin error handling
- Filtering a WP Query result
- Creating Photo Gallery System with Custom Post Type
- Querying custom post type with 2 custom fields (date-range)
- manage posts custom column is not populating data from meta boxes
- Create child page within custom post type
- How to filter custom post type archive by meta value
- How to add button to post page WordPress 5.x
- Prevent reload confirmation after AJAX save
- Filter a custom field based on selection of another custom field (ACF) [closed]
- Display Custom Post Type Fields
- How do I implement custom fields without using any plugins?
- How Can I save multiple records in same meta key?
- Add custom field to media attachment image attribute in post editor
- How to get custom metabox image field?
- Set post title from two meta fields
- Using custom field as custom post title
- How to do a custom bookmarks post type?
- How do I add media to a custom post type?
- Passing Variable as URL Parameter — Security concerns?
- Is it possible to define the data type of a Custom Field?
- Detect meta value changes when post is updated (post_updated)
- Getting Bootstrap accordion working in WordPress loop with custom post type (collapsing issue)
- Creating a gallery of featured images from custom post type
- Search everything (posts, pages, tags, cpt, meta)
- How I check if the same post slug has not been used before publishing?
- How to hook get_terms() to only show count of posts that have custom meta
- Custom post type or just use custom fields
- Retrieving values of custom fields in Quick Edit mode
- ACF Relationships in Custom Post Type Permalink
- How to sort a table of custom posts by column containing custom field
- Search Custom Post Type with all meta attached?
- How to make a page template to list all galleries?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Issue with saving custom post type when editor is removed
- Rewrite custom post type url’s adding meta box values
- set and unset the custom field value
- Custom field being erased after autosave
- order by meta_value serialized array
- Order custom posts by a date metabox
- Orderby custom field for custome post type
- How to select one major category (or custom taxonomy) for a custom post type?
- How to sort CPT by custom meta value (date), and return posts month by month
- List upcoming events, ordered by date in a custom field
- Creating a gallery custom post type?
- Custom Post Type with Custom Title