Posted on

Premium 2.9

There’s only Premium release this time, as very large part of the changes were Premium only, and the small changes in the free version weren’t enough to justify a new release.

This version changes the way the related posts work, so especially if you have been doing custom things with the related posts functions, you may come across a deprecation notice after the update. I am confident the changes introduced here improve things and make creative use of the related posts feature easier than before.

TL; DR: The relevanssi_related_posts() should only be used if you want the full HTML code of the related posts element. If you’re only interested in post IDs, use relevanssi_get_related_post_ids() instead and if you only want post objects, use relevanssi_get_related_post_objects() instead.

Known issues

  • Nothing at the moment.

New features

  • New function relevanssi_get_related_post_ids() returns an array of related post IDs for a post.
  • New function relevanssi_get_related_post_objects() returns an array of related post objects for a post.
  • New filter hook relevanssi_related_output_objects is the same as relevanssi_related_output but for relevanssi_get_related_post_objects().
  • New filter hook relevanssi_get_approved_comments_args filters the arguments to get_approved_comments in comment indexing. This can be used to index custom comment types, for example.

Changed behaviour

  • Relevanssi related posts code has been split into separate functions. The relevanssi_related_posts() functions like before, but if you don’t want the HTML code, check the new functions.

Deprecated

  • Using relevanssi_related_posts() with $just_objects or $no_template set to true is deprecated. Use relevanssi_get_related_post_objects() and relevanssi_get_related_post_ids() instead.

Minor fixes

  • The related posts transient field uses a different name for storing objects or HTML, to avoid problems in case both styles are used at the same time.
  • Indexing subscriber profiles from the admin interface has stopped working at some point, likely due to some changes in WordPress. It is now noticed and fixed.
  • If running in multisite environment, relevanssi_get_post_status() includes the blog ID in the cache key in addition to post ID to avoid clashes where same post ID in different blogs have different statuses.
  • General improvements to the post caching in multisite environments.
  • Options that are used in admin backend only are no longer autoloaded on every page load.

The free version is available from the WordPress plugin repository. You can get the Premium version from the Download page or with the automatic update.

The download page shows two different versions of the plugin available. The basic version no longer includes tests or anything else you won’t need when actually using the plugin. The developer version includes tests and all sorts of other tooling you may find interesting if you’re a developer.

Leave a Reply

Are you a Relevanssi Premium customer looking for support? Please use the Premium support form.

Your email address will not be published. Required fields are marked *