Support » Plugins » [Plugin: NextGEN Custom Fields]

  • As it stands, with NextGEN Custom Fields plugin you have to manually add a custom field you have created to each new gallery after you have created that gallery. I want to tweak the plugin code a bit so that all gallery custom fields that I have created automatically get added to each new gallery, when those galleries are created. I realise this code customisation might not survive an update of the plugin, but I would love to know how best to do it now.

    Thanks in advance for any advice.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hey Joseph

    I’m not sure I understand. When you add a new custom field, you have a list of all galleries to link it to.
    When you add a new gallery, you have a list of all custom fields to link to the gallery.

    Yep, when you go through the normal process of creating a gallery, but I use an Adobe Lightroom plugin that creates galleries as part of the upload process (basically exporting photos from a desktop app directly into nextGEN and creating the gallery like that. So I want to know if I can have a process that just automatically adds the custom fields to all galleries, without any checkboxes having to be ticked etc.

    Ah, I see.
    NGGCF currently links the fields to the galleries in a link table.
    If the Lightroom plugin is calling NextGEN APIs, then it would be possible to latch onto the NextGEN hooks, and write a separate plugin to auto link all new galleries to all custom fields.
    My guess that that it just creates the entries straight in the database though.

    Without editing the Adobe plugin, I could make a new setting that makes fields link to ALL galleries automatically.

    It would just take some thought on how to handle turning that option off. If that option later turned off for a field, would the field be unlinked from ALL galleries, or would it stay linked to existing galleries, and just not automatically link to new ones…

    Well for my purposes it is totally fine if you can never turn it off, so any gallery custom fields that are created are just always added to all galleries, and there is no choice in the matter for a user…

    I’ve got thousands of other users to keep happy too 🙂

    I’ve got a bit of a plan on how I think I can go about it, but I just need to find the time. My day job is pretty crazy right now, plus with the festive season my private geek time is short.


    Yes of course – I appreciate you helping out so far. I was hoping there might be a small tweak that could be applied, but alas.

    I’m excited to hear your solution if you find one – totally understand you don’t have time to just jump on this at the drop of a hat!

    Thanks a lot.

    Change line 276 to $qry = "SELECT * FROM ".$wpdb->prefix."nggcf_fields WHERE ngg_type = ".$wpdb->escape($ngg_type);

    That will return all fields all the time.

    Obviously it will be overwritten with any updates, but that should work for now.

    LEGEND. Please find yourself donated to.

    Glad to help, and thank you for the donation!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: NextGEN Custom Fields]’ is closed to new replies.