James Bradford
Forum Replies Created
-
Forum: Plugins
In reply to: [HTML Editor Syntax Highlighter] Tab indentation not preservedSwitching to the visual editor and back will do a lot more than reformat whitespace. In most cases it will overwrite your code. WordPress has designed the visual editor to do this. The only way for this not to happen is to not use the visual editor. You can disable the visual editor entirely in your wp user settings.
Sucks, I know.
This bug will be fixed in the next release:
v1.7.2
Thanks for bringing it to my attention.
Forum: Plugins
In reply to: [HTML Editor Syntax Highlighter] Enter jumps 2 lines since last update.I’m closing my dev branch now that its been merged with the master
you can download the fixed version
1.7.1
here nowForum: Plugins
In reply to: [HTML Editor Syntax Highlighter] Latest update breaks "Insert Image"I’m closing my dev branch now that its been merged with the master
you can download the fixed version
1.7.1
here nowForum: Plugins
In reply to: [HTML Editor Syntax Highlighter] Loses schema.org dataThis is not this syntax highligher plugin that is removing the html. This is the way that WordPress has designed the html and visual editors to work together.
The short answer is: only use one of them. I know it sucks, but its really the only way to get what you want.
Forum: Plugins
In reply to: [HTML Editor Syntax Highlighter] Enter jumps 2 lines since last update.Hi guys,
I’ve fixed the bugs here in a branch on the github repo(I think I actually created the bugs… sorry).
We will have to wait for Peter/nixdns(who owns the plugin)to update the plugin in the svn repo for the changes to be pushed globally.
BUT
In the meantime, if you want to download the fixed version
1.7.1
you can do that hereSorry for the troubles,
-JamesForum: Plugins
In reply to: [HTML Editor Syntax Highlighter] Latest update breaks "Insert Image"Hi guys,
I’ve fixed the bugs here in a branch on the github repo(I think I actually created the bugs… sorry).
We will have to wait for Peter/nixdns(who owns the plugin)to update the plugin in the svn repo for the changes to be pushed globally.
BUT
In the meantime, if you want to download the fixed version
1.7.1
you can do that hereSorry for the troubles,
-JamesActually…
After digging through their code, the email only appears in the source code of logged in wp users.
if you log out and reload the source code, your email will not be there.
So this is actually not an issue. Code works fine.
I second this!
Does it really need to show my email? That email has nothing to do with my HubSpot account.
It also makes my site more vulnerable to attack, giving my username and email up like that.
Please fix this.
Forum: Plugins
In reply to: [RICG Responsive Images] Set custom sizes attribute on img in the post editorAwesome!
Thanks Joe
Forum: Plugins
In reply to: [RICG Responsive Images] Set custom sizes attribute on img in the post editorJoe,
I don’t want to modify the default
sizes
attribute that is added to images.I want to detect IF there is a
sizes
attribute already set on animg
tag in the content. If there is, I want to use that. If there isn’t, I want to use the default.I cannot do this by filtering
wp_get_attachment_image_sizes
.I need to access to the
$image
string inwp_image_add_srcset_and_sizes
.I had to edit your plugin to get this to work.
In
wp_image_add_srcset_and_sizes
, I changed:if ( $srcset ) { $sizes = wp_get_attachment_image_sizes( $size_array, $image_meta, $attachment_id, $src ); }
to:
if ( $srcset ) { // Check if the sizes="" attribute was manually set on the image tag in the content. $sizes_regex = '/sizes="([^"]*)"/' ; $sizes_were_manually_set = preg_match( $sizes_regex, $image, $matches ); // If the sizes="" attribute was manually set, if( $sizes_were_manually_set == 1 ) { // delete it from the $image string $image = preg_replace( $sizes_regex, '', $image ); // and set $sizes equal to the capture group in the first match of sizes="" found in the $image string. $sizes = $matches[1]; } else { $sizes = wp_get_attachment_image_sizes( $size_array, $image_meta, $attachment_id, $src ); } }
It seems like setting a custom
sizes
attribute on eachimg
tag in the content might be a pretty common use case. The user will know how large each image will appear on their website, and it seems kind to weird that a user cannot currently setsizes
on a case to case basis.Would you consider adding some kind of functionality to your plugin to support this(especially if this is going to be included in the wp core).
Thanks a 1,000,000,
-James