PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Bug rendering a form inside an admin custom page

  1. Not sure if this is a bug regarding the user registration add-on or gravity form itself, so i'm going to post it here.

    Basically, here's what i'm trying to do:

    1) I created an "Update your profile" kind of form, and linked it to the Update feature of User Registration add-on.

    2) It works perfectly on the front-end, but what i need is to put it inside an admin page.

    3) Here's my code:
    add_action('admin_menu',function () {
    add_menu_page('Seu perfil', 'Seu perfil', 'read', 'atualize_perfil', function() {
    gravity_form(3, true);
    }, 'div');
    });

    4) Here is how the form is rendered:
    http://i.imgur.com/fksPy.png

    I tried checking the plugin code and i think it renders different according to the constant "IS_ADMIN" which is defined TRUE everytime the user enters the wp-admin, if i'm not mistaken.

    I think the fix would be something like... (but just a wild guess, i probably might be completely wrong) Changing the use of the constant for a private variable inside the rendering form class which would catch a value from outside, something like "render_for_admin", which then would catch a value from the function "gravity_form()" which would allow the programmer to pass a flag for it would be rendered for admin or not... and of course it would have a default value, which would catch it from the IS_ADMIN constant itself.

    And yes, i've seen this topic here which its OP seems to be having the same problem as mine... But no real conclusion was given to the topic so i decided to ask as well, specially because other people may have the same trouble.

    So that's pretty much all of it. Thanks in advance =)

    Posted 12 years ago on Monday December 3, 2012 | Permalink
  2. Gravity Forms is not designed to be used in the admin area. As such, we're not aware of what approach you would need to take to make it work there.

    Posted 12 years ago on Thursday December 6, 2012 | Permalink