How to sort NextGEN galleries alphabetically for the dropdown in the Add Gallery / Images page

  • Use an FTP client to navigate to <site_root>/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php
  • Add the following code to the very top

Main code snippet

<?php
function my_cmp($a, $b) {
  if ($a->title == $b->title) {
    return 0;
  }
  return ($a->title < $b->title) ? -1 : 1;
}
usort($galleries, "my_cmp");
?>

Code snippet in context

<?php
function my_cmp($a, $b) {
  if ($a->title == $b->title) {
    return 0;
  }
  return ($a->title < $b->title) ? -1 : 1;
}
usort($galleries, "my_cmp");
?>

<?php
/**
 * @var array $galleries
 * @var string $nonce
 * @var int $max_size
 * @var C_NextGen_Settings $settings
 */
?>
5 1 vote
Article Rating
Subscribe
Notify of
guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Ebenezer Goose

Unfortunately, your Add Gallery sort pick-list solution does not work. We tried it on several of our NextGEN galleries but it does absolutely nothing. Tried it on latest versions: NextGEN 3.4.7 and 3.5.0.

Do you have any suggestions please?

2
0
Would love your thoughts, please comment.x
()
x