Google Photos – sorting Albums by title
-
I am new to WordPress, but have been a Joomla developer for some time. I am working on a site which uses Google Photos as the backend and noted that Photonic doesn’t support sorting by Album title.
As this was a major limitation for me I examined the code and I think I have found a simple solution to this. Obviously if I change the code, it will be overwritten on update, so I wondered if it could be considered for a future release?
Basically it just sorts the object which is built up from the Google Photo calls on Title, before it is displayed.
It is a one line change to a single file which works fine for me, but obviously I don’t know if there would be any knock on effects.
The file is: wp-content/plugins/photonic/Modules/Google-Photos.php
In function build_level_2_objects, right at the very end before it returns $objects(around line 640). add the following line:
usort($objects, function($a, $b) {return strcmp($a->title, $b->title);}); return $objects;
- The topic ‘Google Photos – sorting Albums by title’ is closed to new replies.