Skip to content

Instantly share code, notes, and snippets.

@rafaehlers
Created April 17, 2024 19:41
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 rafaehlers/18ad4bf68ccf40e779a06a5dd0342d26 to your computer and use it in GitHub Desktop.
Save rafaehlers/18ad4bf68ccf40e779a06a5dd0342d26 to your computer and use it in GitHub Desktop.
DataTables > Buttons > Print > Display link URLs
document.addEventListener('DOMContentLoaded', function() {
wp.hooks.addFilter( 'gk.datatables.options', 'dt-custom-code', function ( options ) {
options.buttons = options.buttons.map( button => {
if ( 'print' === button.extend ) {
button.exportOptions = {
stripHtml: false
}
}
return button;
} );
return options;
} );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment