Utility like Compost for El Capitan
After doing a quick google search, a user from MacRumors mentioned Hazel, which has this feature, although pricy at $32
TrashTimer is a free alternative app, works straight from the preference pane.
Or, for the DIY-er, this discussion on the Apple Communities forums has two answers, one by twtwtw, and one by Tony T1.


twtwtw's answer uses an Applescript and a launchd plist file to automatically  execute the script at midnight. The files in trash then gets today's date written into the comments section, and if the date matched is older than x days, deleted. TL;DR: File is deleted depending on the date written in the comments section of file. 

Tony T1's answer uses only a plist file in the launchd, and it deletes files based on the created date. Tony T1 also adds this: 


  Notes:
       -- I use -mindepth 1 -prune, so that if a FOLDER is in the Trash, every file in the folder is deleted (-R), (even is it is less than 7 days old -- good for App bundles).
       -- Some files might not be deleted if srm has an error (for example, write protected files owned by another user)
       -- This only handles the Users Home Trash.  If you have attached drives, adjust accordingly.


Sidenote for a fix for Tony T1's answer

Alternative to Compost – MacRumors forum

Apple Communities discussion