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’?
- How to Add Custom Fields to a Custom Post Type?
- Do_Shortcode not working for Embed
- Front end post editing using a form
- Display custom post type and custom fields within a Bootstrap Carousel
- how to filter by last name for custom post
- Search that will look in custom field, post title and post content
- clients list using wordpress
- Custom Taxonomy Template Post List with Sort Order
- Display Custom Post Type Fields
- How to do a custom bookmarks post type?
- How do I add media to a custom post type?
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- WordPress query by multiple Custom fields and order by date
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- add_meta_box: Datepicker like the one for postdate?
- Custom field losing p tags on display
- Using posts and postmeta table to store custom Address Book Plugin data
- Bulk edit custom excerpt text in WordPress
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Getting a “Changes you made will be lost” dialog prompt on a custom post type page
- Frontend posting – everything saves other than checkboxes?
- Search Custom Post Type Custom Fields
- Query Custom Post Types by date (custom field) range
- handling csv data with a custom post type
- How to remove slug metabox from custom post type’s page?
- Custom fields in Permalinks?
- query posts and custom post type with meta key
- Dynamically add / duplicate custom meta in custom post types
- Problem fields custom date, time, and checkbox
- Custom Post type and Custom Field WP_Query
- Adding Show Less/More link to Custom Post Meta
- Sorting custom post type columns with external data and without meta values
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- WordPress Custom Fields Won’t Save
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Meta Query Not Returning Output Despite Having Matching Values
- Repeatable Fields Metabox with Textarea (or wp_editor)
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Displaying custom field according to date
- Can anyone help me with galleries and post types?
- How to add multiple markers on the google map, at a certain meta_key and meta_value
- Custom fields for custom post type
- Warning: Invalid argument supplied for foreach() [closed]
- Add additional field to custom post_type
- Creating my own portfolio custom-type
- Getting Un Wanted Gallery Shortcode In The Page on Loop
- Add custom attributes to a post
- Get post content from another section in custom single page
- Modify Posts from Custom_Post_Type within the plugin
- How to convert custom fields to content
- Group by custom field value (start and end times)
- Variable Products as custom post types
- How to call a post’s metadata in shortcode.php?
- Ideas to connect external database table to wordpress posts as custom field source
- updating one custom meta field only
- Get post-meta value of all custom-posts – lowest to highest year-count?
- Confusion about how to use Custom Post Types, Custom Taxonomy or Category?
- Displaying Posts Using a Custom Query with a Custom Field and a term_id
- Create list from custom field comma separated values
- add_filter get array data before display in custom post_type
- How to fix the Post Preview Button (CPT & map_meta_cap)
- Having a repeating custom field in admin custom post type, what I’d go better with, for DB’s sake? ACF repeater or query a different post type?
- Create an user checklist system for a course plateform using ACF Pro and ACF Extended
- How to sort WP_Query by a custom text field (written as a date dd/mm/yyyy)
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- WP_Query get always custom post_type for first
- Post Click Redirect to Custom URL instead of Single Post Page
- wp_insert_post deleting previous post custom meta
- Show posts from WP Custom Post Type selected from a field in a metabox
- Query custom post type and custom field by URL parameters
- meta query multiple values for the same key
- Show Post columns to specific users on condition
- Custom post types – meta_query: search lesson which starts sooner
- Create Inclusions and exclusions
- Populate custom post type/custom fields from an external database
- Automatically convert standard posts with custom fields to custom post types
- Importing URLs of Audio Enclosures
- Edit is changing my custom’s post type parent id
- Retrieving custom post type fields without a post
- custom fields not showing before get_header
- pre_get_posts with multiple post types AND a meta_key
- Search form to find custom meta box generated data
- Custom Info Box at end of posts?
- Display Custom Post if custom field is marked
- predefined custom field on registration page
- Show Custom Post Type taxonomy term that matches custom field
- Query Distinct Taxonomies of Custom Post Type
- Select Menu for Custom post Type does not save
- loop through custom post-type with two meta_keys
- Allow authors to create article image
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Send email on creation of custom post type and use get_post_meta()
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- Post object GUID adding http:/
- WordPress does not show the custom fields box
- Query order by a numeric ACF field