Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

robbiet63 on "Thickbox height/width on admin menu page sized to default- Can I overwrite size?"

$
0
0

My thickbox is working, displaying a photo from URL, but the height and width are not adjusted. (The code from my plugin is below.) The result is a thickbox that appears to be sized according to a WP default, (used by WP for instance when providing more information on plugins etc). Is there any way to overwrite this default?

Here's my code:

add_thickbox();
echo "<a href='".$photo_url."TB_iframe=true&width=600&height=550' class='thickbox'>Click to enlarge: <img src=".$photo_url." height='30'></a>";

In the above code I include height and width settings but they are not applied by WP. Instead the default is applied making the modal window too narrow and too high.

I have found a few other posts on this topic, such as "Custom height/width for thickbox in WP Backend" but it remains unclear whether the WP default settings can be overwritten, and if they can be overwritten whether this is true both for front-end and back-end. And if the proposed solution does work I need more details to figure out how to make it work in my plugin.

Better yet, is there another way of employing modal windows as lightboxes when making WP plugins - specifically for use in the admin menu? Ideally the size of the modal window would be set according to the size of the viewer's screen, instead of being a static pre-set.

Thx


Viewing all articles
Browse latest Browse all 8245

Trending Articles