Ok I don’t know if this would be the better way but I solved my problem.
I needed to fetch a random image within a specific album.
Here is what I’ve done:
- Created a new instance called album_number and added it to the update and widget functions.
- Created a new input field with number value, called album_number.
- Replaced $selected_album = $data[array_rand($data)]; with $data[$album_number];
That’s it, I am now able to select my specific album, the only thing is I am having trouble identifying my albums, I suppose they are stored in order of creation, So I had to guess mine was album number 3.
I hope this helps anyone looking to do anything similar.
Cheers,
Jay!