The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Hook for modifying output of field in dashboard?

Labels

This Discussion is public

Notifications

I've got some important data we're collecting/storing via Formidable and using 'frm_add_entry_meta', the data is encrypted before being stored into the database. Next step is handling decryption, so that admins are able to view that data in the dashboard. Specifically when they click into an entry and can see all of the fields.

So what I need is a hook to modify the field's data before it's displayed anywhere in the dashboard. Does something like this exist? Because I've been googling for the better part of an hour and I so tired of typing "formidable hook" it's not even funny 😉

Hi Jeremy,

You've probably already solved this by now but you might want to consider creating a View for Admins instead.. If you use a View, you can use a hook like:

https://formidableforms.com/knowledgebase/frm_display_entry_content/

This would probably allow you to decrypt the content before display. So instead of going through the WP Dashboard - Formidable Entries, create a Formidable View that pulls the content & restrict access to the Page containing the View, to Administrators only... for that you might need the WP User Manager By Alessandro Tesoro or the Hide This plugin or something similar.

Hope that helps.

Kristy

 

 

Kristy's suggestion looks to me like it would work - or the way that I would likely approach it is to use frm_setup_edit_fields_vars with a check for whether it's being accessed in the backend. Something like this:

(**fully untested** - this was modified from https://formidableforms.com/knowledgebase/frm_setup_edit_fields_vars/#kb-set-fields-to-read-only-when-editing )

add_filter('frm_setup_edit_fields_vars', 'frm_unencrypt_for_admin', 20, 3);
function frm_unencrypt_for_admin($values, $field, $entry_id){

if ( in_array( $field->id, array( 1558,554,555,556 ) ) ) { // put in your field ids that need to be de-encrypted
// If on the back-end, unencrypt
if ( FrmAppHelper::is_admin() ) {
// PUT DE-ENCRYPTION CODE HERE
}

}
return $values;
}

Discussion closed.