BuddyDev

Search

Add fields to gallery

  • Participant
    Level: Initiated
    Posts: 16
    Christophe André on #27677

    Hello,
    i’d like to add fields to mediapress galleries. Is this possible ?
    Best regards
    Christophe

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #27680

    Hi Christophe,
    Thank you for the question.

    It is not doable out of the box. With some custom development, this may be achieved.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 16
    Christophe André on #27688

    Thank you Brajesh

    Do you have an example of what i should do ?

    Best regards

    Christophe

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #27718

    Hi Christophe,
    I am sorry for the delayed reply.

    Her is an addon that shows how to add custom field on the gallery create screen

    https://github.com/mediapress/mpp-gallery-categories/blob/master/mpp-gallery-categories.php

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 16
    Christophe André on #27762

    Hi Brajesh

    this addon just adds specific categories to mediapress. It’s not what i’m looking for. I’m really surprised that such a function does not exist.

    Do you have another solution ?

    Best regards

    Christophe

  • Participant
    Level: Initiated
    Posts: 16
    Christophe André on #27929

    Hi Brajesh

    I found a solution. It will be more efficient if your developper could had a hook after de </form> line 69 in wp-content\plugins\mediapress\templates\mediapress\default\gallery\manage\settings.php.

    Do you believe that could be done in the next release ?

    Best regards

    Christophe

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #27930

    Hi Christophe,
    Sure, but why not use the available hooks?

    
    mpp_after_edit_gallery_form_fields
    
    

    or

    
    mpp_before_edit_gallery_form_submit_field
    
    

    These are already on that page.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 16
    Christophe André on #27932

    because it would make a form in a form and it does not work properly

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #27933

    Having multiple forms for the user on same page may not be a good idea.

    We provided the hook to let you add your own fields(input fields and not forms).

    And you can attach with the ‘mpp_gallery_updated’ hook to save the details.

    I will still add the hook if it helps you.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 16
    Christophe André on #27935

    I know that having to forms on a page is not a good idea. When i use the acf_form function with create form option to false it does not create the acf form.

    The problem is in this case, that when i click the mediapress save button, it saves the acf fields (with no need to write any code for that) but not mpp fields .

    Thx for your patience 😉

You must be logged in to reply to this topic.

This topic is: not resolved