Skip to content

Instantly share code, notes, and snippets.

@hivepress
Last active February 27, 2024 09:46
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hivepress/847da5ecfe798084d43a232f791419c5 to your computer and use it in GitHub Desktop.
Save hivepress/847da5ecfe798084d43a232f791419c5 to your computer and use it in GitHub Desktop.
Change the maximum number of images per listing #hivepress #listings
<?php
add_filter(
'hivepress/v1/models/listing',
function( $model ) {
$model['fields']['images']['max_files'] = 123;
return $model;
},
100
);
@28south-james
Copy link

Any way to have different limits depending on the listing package purchased?

@tejas2292
Copy link

image

Is it correct?? because its not working though i have tried for request

@hivepress
Copy link
Author

Please replace "listing" with "request" in the hook name then this snippet should work fine for requests.

Unfortunately there's no way to limit this per package in the current version.

@guizeras
Copy link

Work perfectly. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment