• Resolved oxxyfx

    (@oxxyfx)


    Hello,

    I needed to add some admin only fields – which I would have preferred to be “record” fields like MFA hash and expiry. These are admin only. However these seem to – as expected – display when I open the record for editing with the [pdb_record groups=”main,admin”]. I created a pdb-record-edit.php under the /public_html/wp/wp-content/themes/colormag-hvrcf/templates where my other customizations are and it does not seem to take effect. The code I tried is:

    fields as $field ) {
    if ( in_array( $field->name, [ ‘mfa_code_hash’, ‘mfa_code_expiry’ ] ) ) {
    continue;
    }
    echo $this->display_field( $field );
    }

    Please let me know how can these 2 fields be hidden if that is even possible.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author rolandbarker

    (@rolandbarker)

    You may find it is an easier way to manage the visibility of your fields by making a separate group for these fields, then you won’t need a custom template.

    If you want to stick to the use of your template, and the code snippet looks good, you should place the template in the plugin’s custom template directory at:

    wp-content/participants-database-templates/

    Thread Starter oxxyfx

    (@oxxyfx)

    Perfect! That is the easiest solution. Thank you very much, that works.

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

The topic ‘Trying to hide some fields from edit record’ is closed to new replies.