• Resolved squarecandy

    (@squarecandy)


    Hi – I took a pretty deep look into the code and it seems that the Gender field is hard coded into the plugin in a bunch of places. This is kind of a deal-breaker for us to use the system. Would you consider making the Gender field filterable – so that it’s not visible in the admin or the signup forms? Same would be great to apply to first name, last name, language as well, but Gender is the most important one for us.

    Ideal would be to be able to totally remove them with a hook or admin setting, but a more basic solution that would be very easy to implement would be to just add unique classes so we can hide things with CSS.

    Example:

    // profile/index.php
    <tr class="newsletter-admin-gender newsletter-admin-profile-gender">
    <th><?php esc_html_e('Gender', 'newsletter') ?></th>
    <td>
    <?php $controls->checkbox2('sex') ?>
    </td>
    </tr>

    // subscription/form.php
    <tr class="newsletter-admin-gender newsletter-admin-subscription-gender">
    <th style="vertical-align: top"><?php esc_html_e('Gender', 'newsletter') ?></th>
    <td style="vertical-align: top">
    // ... etc.

    // users/edit.php
    <tr class="newsletter-admin-gender newsletter-admin-users-edit-gender">
    <th><?php esc_html_e('Gender', 'newsletter'); ?></th>
    <td>
    <?php $controls->gender('sex'); ?>
    </td>
    </tr>

    Thanks for considering it! Let us know if you accept pull requests anywhere and I would be happy to contribute a more thorough suggestion.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Michael Travan

    (@michael-travan)

    Hello,

    talking about frontend forms, all the field you’ve named can be set as optional or required, so it’s your choice whether to show them or not. For the same reason, we cannot hide them in the admin side (because they’re options, so they’re needed to set those options on or off).

    I apologize if I didn’t fully get what your needs are, if so, feel free to elaborate.

    Regards,

    Michael

    Thread Starter squarecandy

    (@squarecandy)

    Hi Michael –

    Thanks for getting back so quickly.

    Without getting into a whole conversation on gender in general – just the fixed options of Man/Woman/Not Specified and also asking for gender when it’s not required, even on the back end are not ideal for many of our clients. I get that it can be kind of a core demographic datapoint you always want to track if you’re doing a shoe or fashion website, but for our users it’s not needed at all, and the fixed set of options can be a turn off.

    I just want to leave the value as “not specified” for every single record and hide the options from the admin UI. We can’t currently do that easily because there are no classes to target things in the HTML.

    I supposed I could do things like .tnp-users-edit table.form-table tr:nth-child(4) { display: none; } but that feels a little risky to break if any new lines or options get added in the future.

    I’m also just curious why gender is hard coded into everything since custom fields of type “list” also exist… maybe it’s just for backwards compatibility?

    Plugin Support Michael Travan

    (@michael-travan)

    Hello @squarecandy,

    gender related options are hard coded for compatibility reasons and we cannot remove them. As you correctly noted, addressing those options with some css rule should be faitly easy, but of course it will need to be edited from time to time, as UI / options order may change.

    Michael

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Disable or hide “Gender” features’ is closed to new replies.