I would like to implement on my website that a provider can add 5 photos to an entry by default. The moment an entry receives “featured” status, it should be possible to add up to 25 photos.
I do not use the Paid Listings add-on.
I know this requires customization and I’m already working with a developer.
Is my project fundamentally possible and if so, what is the right approach?
This depends on how the featured status is implemented. If it’s a custom checkbox attribute with “featured” name, you can try using this code snippet Change the maximum number of images per listing #hivepress #listings · GitHub and adjust the maximum number of images based on the checkbox value. You can also use the hivepress/v1/models/listing/fields hook where the listing ID is already available so you can fetch its data.
thank you very much. However, it’s not exactly what I meant. I am talking about the “featured” checkbox in the wordpress backend. The moment I check this box I want the different number of images to apply to a featured listing
Please try following the same suggestions, you can use the hivepress/v1/models/listing/fields hook, and get the featured status via the listing ID (it’s available for this hook), changing the limit for the images field. Here’s a similar code snippet Change the maximum number of images per listing #hivepress #listings · GitHub
Thank you very much ihor! I am using the following code, however it doesn’t seem to work (even if the listing is featured, the maximum upload of 5 pictures applies):