Need to Max upload size up to 100 kb

I want to limit file size upto 100 kb. If anyone attempts more size image then put message “image size should be less than 100 kb”

Currently I have that much snippet in function.php please add some lines to achieve this.

//Max image allowed 
add_filter(
	'hivepress/v1/models/listing',
	function( $model ) {
		$model['fields']['images']['max_files'] = 5;

		return $model;
	},
	100
);

//Title Description Placeholder
add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		$form['fields']['title']['placeholder'] = 'Example: Bridal MakeUp Artist in Mumbai, Thane, Navi Mumbai at Affordable cost - Shalmia';
		$form['fields']['title']['description'] = '<b>Write Attractive title with detailed information having purpose and location so that your listing can get found in search</b></br> <b>Examples: Looking for graphics designer jobs in Mumbai, Thane or Navi mumbai</b></br><b>Looking for Makeup artist in thane</b>';
		$form['fields']['description']['placeholder'] = 'Write as much info as you can about your listing';
		$form['fields']['location']['description'] = '<b>Write Approximate Location. No need of full address in this field</b></br><b> Example : Dadar, Mumbai, Maharashtra, India</b>';
		$form['fields']['description']['editor'] = true;
		$form['fields']['images']['description'] = '<b>Suggested size ratio: 4:5 5:4 or 1:1 Example : 200x250 px </br> Max 5 Images are allowed. Dont upload image more than 80kb. </br>To make image size smaller <a href="https://www.iloveimg.com/compress-image"> Click Here to Compress images</a> </br> You can also upload Company logo or your on photo</b>';
		return $form;
	},
	1000
);

Unfortunately, there’s no way to restrict this with a filter, but you can adjust the media settings, and any larger image will be cropped automatically. You can also limit the maximum upload file size How to Increase Maximum File Upload Size in WordPress

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