Skip to content

Instantly share code, notes, and snippets.

@qstudio
Last active December 29, 2020 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qstudio/13d5c17ca89a42afafe92455e5eda2c9 to your computer and use it in GitHub Desktop.
Save qstudio/13d5c17ca89a42afafe92455e5eda2c9 to your computer and use it in GitHub Desktop.
// EUD - field key encoding ##
\add_filter( 'q/eud/export/value', [ get_class(), 'format_value' ], 10, 2 );
/**
* Filter export key value in EUD plugin
*
* @since 2.0.0
*/
public static function format_value( $value = null, $field = null )
{
#helper::log( 'value from EUD filter: '.$value );
if ( is_null( $value ) ) {
return false;
}
// kick it back with encoding formatting ##
return htmlentities( $value, ENT_COMPAT, 'UTF-8' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment