Skip to content

Instantly share code, notes, and snippets.

@greenhornet79
Created August 2, 2016 13:24
Show Gist options
  • Save greenhornet79/d2649fa488e7cc76b49fad3b0f864653 to your computer and use it in GitHub Desktop.
Save greenhornet79/d2649fa488e7cc76b49fad3b0f864653 to your computer and use it in GitHub Desktop.
some example use cases for using filters with IssueM Issue-to-PDF
<?php
add_filter( 'issuem_pdf_toc_title', 'zeen101_toc_title' );
function zeen101_toc_title( $toc ) {
return 'List of Articles';
}
add_filter( 'issuem_pdf_styles', 'zeen101_pdf_styles' );
function zeen101_pdf_styles( $styles ) {
$new_styles = 'h2 { color: red; }';
return $styles . $new_styles;
}
add_filter( 'issuem_pdf_html', 'zeen101_new_pdf_html', 10, 3 );
function zeen101_new_pdf_html( $results, $term, $issue_id ) {
return '<h2>Some new html</h2>' . $results;
}
@tpenberthy
Copy link

Hi,
I'd love to use issuem_pdf_html to strip out some shortcode that's appearing in my PDFs, and also to hide the author and issue title from appearing at the top of each article.

Example is here: http://prettycool.site/example.pdf

Specifically I'm asking for help with how to properly write "anywhere you see the '[' character, ignore it and everything after it until you see the ']' character."

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment