# HivePress 1.7.31 ignores images max\_files snippet

**URL:** <https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959>\
**Category:** HivePress\
**Tags:** code\
**Created:** [September 3, 2026, 7:54pm UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959 "2026-09-03T19:54:13Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![K1S1N](https://community.hivepress.io/letter_avatar_proxy/v4/letter/k/3da27b/32.png) [@K1S1N](https://community.hivepress.io/u/K1S1N)\
**Post date:** [September 3, 2026, 7:54pm UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/1 "2026-09-03T19:54:13Z")

</div>

HivePress 1.7.31 ignores images max\_files snippet

The following snippet worked in 1.7.30:

```auto
add_filter(

 'hivepress/v1/models/listing',

 function( $model ) {

 $model\['fields'\]\['images'\]\['max_files'\] = 100;

 return $model;

 },

 1000

);

```

After updating to 1.7.31 the upload limit is back to 10 files and the form shows:

“Only up to 10 files can be uploaded.”

Any ideas how to fix?

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [September 3, 2026, 7:54pm UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/2 "2026-09-03T19:54:15Z")

</div>

Thanks for your message — our team will reply shortly.

In the meantime, you can also get instant help from our [AI Assistant](https://www.chatbase.co/PdfFucPZ0vUmh3dfM-oe1/help), familiar with all the docs and solutions we’ve shared over the years.

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [September 4, 2026, 3:54pm UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/4 "2026-09-04T15:54:35Z")

</div>

Hi,

Please make sure that the snippet is added correctly (as a PHP snippet instead of CSS, and it shouldn’t contain backslashes):

```auto
add_filter(
	'hivepress/v1/models/listing',
	function( $model ) {
		$model['fields']['images']['max_files'] = 100;

		return $model;
	},
	1000
);

```

Also, please refresh the page after adding the snippet because the number of images is also set in the HTML field attribute. I tested the snippet locally with 15 files and once I added it and refreshed the page, the uploader allowed adding 15 instead of 10 (default limit) files.

Hope this helps

---

<div class="post-metadata">

**Author:** ![GMe](https://community.hivepress.io/letter_avatar_proxy/v4/letter/g/5fc32e/32.png) [@GMe](https://community.hivepress.io/u/GMe)\
**Post date:** [September 8, 2026, 2:55pm UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/5 "2026-09-08T14:55:31Z")

</div>

Same problem 1.7.31 ….. is there a solution already?

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [September 8, 2026, 4:27pm UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/6 "2026-09-08T16:27:36Z")

</div>

If possible, please send a link to your site (you can also send it privately via [support@hivepress.io](mailto:support@hivepress.io)) – at the moment we can’t reproduce this issue locally and on the demo site, maybe this is something specific to the website setup.

---

<div class="post-metadata">

**Author:** ![GMe](https://community.hivepress.io/letter_avatar_proxy/v4/letter/g/5fc32e/32.png) [@GMe](https://community.hivepress.io/u/GMe)\
**Post date:** [September 9, 2026, 7:20am UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/7 "2026-09-09T07:20:35Z")

</div>

Rollback to 1.7.30 and the problem is over. I hope there comes a solution.

---

<div class="post-metadata">

**Author:** ![K1S1N](https://community.hivepress.io/letter_avatar_proxy/v4/letter/k/3da27b/32.png) [@K1S1N](https://community.hivepress.io/u/K1S1N)\
**Post date:** [September 9, 2026, 7:34am UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/8 "2026-09-09T07:34:38Z")

</div>

I found solution with new snippet

```auto
add_filter(
'hivepress/v1/fields/attachment_upload',
function( $args ) {
    $args['max_files'] = 100;

    return $args;
},
1000
);

```

I would recommend to add this feature to HivePress plugin 🙂

---

<div class="post-metadata">

**Author:** ![GMe](https://community.hivepress.io/letter_avatar_proxy/v4/letter/g/5fc32e/32.png) [@GMe](https://community.hivepress.io/u/GMe)\
**Post date:** [September 9, 2026, 9:00am UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/9 "2026-09-09T09:00:02Z")

</div>

I become this error with your snippet

**Undefined constant “‘hivepress”**

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [September 9, 2026, 11:22am UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/10 "2026-09-09T11:22:17Z")

</div>

Please note that this snippet sets the limit for any attachment field in any form, not just the listing images, but since there’s no multiple attachments option for other fields yet, it may be used as a temporary workaround.

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [September 9, 2026, 11:23am UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/11 "2026-09-09T11:23:16Z")

</div>

Please make sure that you added it as a PHP, not JS code snippet. I also fixed the formatting in the reply, you can try copying it again as there were converted quotes in the code.

---

<div class="post-metadata">

**Author:** ![GMe](https://community.hivepress.io/letter_avatar_proxy/v4/letter/g/5fc32e/32.png) [@GMe](https://community.hivepress.io/u/GMe)\
**Post date:** [September 9, 2026, 12:23pm UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/12 "2026-09-09T12:23:10Z")

</div>

Thanks, now it works as a “temporary workaround“  
I’m happy with it 🙂

---

<div class="post-metadata">

**Author:** ![kseniia](https://community.hivepress.io/user_avatar/community.hivepress.io/kseniia/32/13513_2.png) [@kseniia](https://community.hivepress.io/u/kseniia)\
**Post date:** [September 11, 2026, 9:09am UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/13 "2026-09-11T09:09:17Z")

</div>

Just a follow-up with the solution:

It turned out that this specific request was related to image uploads from the backend. The previous snippet works for the frontend uploader, so it does not affect image uploads made from the backend.

To increase the image limit beyond 10 images per listing when using the backend uploader, please use the following snippet: [Change the maximum number of images per listing #hivepress #listings · GitHub](https://gist.github.com/hivepress/847da5ecfe798084d43a232f791419c5)

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [October 11, 2026, 9:09am UTC](https://community.hivepress.io/t/hivepress-1-7-31-ignores-images-max-files-snippet/17959/14 "2026-10-11T09:09:29Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
