WPThumb Shortcode #35

Closed
Thunderlab opened this Issue Jun 19, 2012 · 10 comments

Comments

Projects
None yet
4 participants

I create a simple shortcode to insert external images.
Here is the code:

function image_shortcode($atts) {
extract(shortcode_atts( array(
"url" => '',
"width" => '',
"height" => '',
"crop" => ''
), $atts));
$img = wpthumb($url,'width='.$width.'&height='.$height.'&crop='.$crop.'');
return "<img src='$img'/>";
} add_shortcode( 'img', 'image_shortcode' );

Usage
[img url="http://...theimage.jpg" width="100" height="100" crop="1"]

Owner

joehoyle commented Dec 21, 2012

this is a very interesting idea, let's decide on a shortcode name

[wpthumb httpgoogle.com.xom width=40]

Perhaps?

I think we coud not have an arg for the URL, easier to use maybe

Owner

willmot commented Dec 21, 2012

Thats a great idea.

[wpthumb httpgoogle.com.xom width=40]

Could we scrap the http?

Owner

joehoyle commented Dec 21, 2012

Could we scrap the http?

Yes I think so

joehoyle was assigned Dec 21, 2012

Owner

mattheu commented Dec 21, 2012

Really good idea.

Should be able to specify attachment ID instead of URL.

Would almost like to see all images inserted like this - Makes it much easier to filter the output - currently impossible to do this on old posts- eg replace with

Owner

joehoyle commented Dec 21, 2012

Yes, only downside if one is locking themselves into wpthumb for images in their posts, maybe we could have an uninstall optino or something to go through posts and put in the image

Owner

willmot commented Dec 21, 2012

Is there a standard WordPress image shortcode that we could just overload? That way we could be backwards compatible.

Owner

joehoyle commented Dec 21, 2012

pretty sure there is not

Owner

mattheu commented Dec 21, 2012

Yeah don't think there is.

Could have a compatibility plugin that uses the same shortcode to output the image without wpthumbing it

Owner

joehoyle commented Mar 2, 2013

Closed for p/r in #56

joehoyle closed this Mar 2, 2013

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