Skip to content

Instantly share code, notes, and snippets.

@wtmujeebu
Last active June 21, 2018 16:25
Show Gist options
  • Save wtmujeebu/38f6b173d0e53b9dd7079d4a24363158 to your computer and use it in GitHub Desktop.
Save wtmujeebu/38f6b173d0e53b9dd7079d4a24363158 to your computer and use it in GitHub Desktop.
Add custom columns into audit table - WebToffee GDPR Cookie Consent Plugin
add_filter('cli_new_columns_to_audit_table', 'wt_add_new_column',10,1);
function wt_add_new_column($table)
{
return $table .= '<th class="cookielawinfo-column-5">'.__('Cookie ID', 'cookie-law-info').'</th>';
}
add_filter('cli_new_column_values_to_audit_table','wt_add_new_value',10,2);
function wt_add_new_value($ret, $custom)
{
$_cli_cookie_slugid = ( isset ( $custom["_cli_cookie_slugid"][0] ) ) ? $custom["_cli_cookie_slugid"][0] : '';
return $ret.= '<td class="cookielawinfo-column-3">' . $_cli_cookie_slugid .'</td>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment