Skip to content

Instantly share code, notes, and snippets.

@chuckreynolds
Last active June 23, 2016 09:02
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 chuckreynolds/730d63c90e50512bdffa04ac03589e77 to your computer and use it in GitHub Desktop.
Save chuckreynolds/730d63c90e50512bdffa04ac03589e77 to your computer and use it in GitHub Desktop.
Adds classes to attached images when saving a new image in the post editor. Doesn't add for old images.
<?php
function foo_no_print_class( $class ) {
return $class . ' print-no';
}
add_filter( 'get_image_tag_class', 'foo_no_print_class' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment