Listing Type Revisions
By default, MyListing will store up to 15 revisions of each Listing Type, and a new revision is created every time you change your Listing Type. While this is a good feature, storing that many revisions is unnecessary.
This is one of the items covered under the Club’s MyListing Technology Audits (Free), and if you have the default settings turned on for Listing Type revisions, you’ll hear me say that this is a waste of resources. Why? Simple.
I challenge everyone to look at your Listing Types and tell me what settings are stored in the previous revision(s). That’s right…99.9% of us cannot say for sure unless we kept a complete changelog for each Listing Type.
Some might argue that this is a waste of time. However, my counterargument is, why not do this if it takes just a couple of minutes of your time? Every bit of optimization counts when it comes to MyListing websites.
Also, note that if you really want to keep meaningful revision history for your Listings Types, the better way is to export their configuration and name the export file something meaningful. For those who proceed with this guide, I recommend setting a revision limit of no more than 5.
Note: Listing Type revisions differ from Post Revisions, which can normally be limited or cleaned up using code snippets or plugins.
Limit the Listing Type Revisions
- Within your Child Theme (/wp-content/themes/my-listing-child/), create the following folder structure: /includes/src/listing-types.
- Copy the revisions.php file from the parent theme (/wp-content/themes/my-listing/includes/src/listing-types/) to the new /wp-content/themes/my-listing-child/includes/src/listing-types/ directory.
- Edit the revisions.php file and edit the “15 value” from line 20 (shown below) as desired.
($this->max_revisioun_count = apply_filters( ‘mylisting/types/max-revision-count’, 15 );)
You know your new settings are working when the ‘Config’ section of your Listing Type displays the following message: “The previous 5 revisions of the listing type settings are stored automatically.”
