New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Wordpress Help
agoldenberg
Member, Host Rep
in Help
I'm looking to have wordpress strip out the following class that seems to be on every image but is not used anywhere.
wp-image-nnnn where nnnn is a number reference to what I believe to be the media ID.
Can anyone lend a hand?
Comments
I think you can filter this with the
get_image_tag_class
filter. I'm basing this off a quick search of the WordPress code.as far as I can see, this is referenced in
especially the javascripts use functions like
so maybe it is not the best idea to try and get rid of it, because it may break things...
and as those files are core-files of WP and it looks like those classes are attached via js anyway, I'd definitely recommend to go and try to remove it with javascript also.
that you can easily put as a custom function into the footer of your theme or something alike. otherwise changes to the core-files will probably be overridden on the next update.
+1 for this, good hint!
just read across and it seems that only the tinymce and media editor are adding those classes via js. so maybe the risk of breaking something by removing it for the visitor changes to very low ;-)
that way one may be able to filter it before the html output is generated, as suggested over there http://wordpress.stackexchange.com/questions/120133/strip-image-classes-from-html-output