→
Minecraft Block
The Minecraft Block WordPress Plugin.
The Minecraft Block WordPress Plugin.
Here it is, your very own rotating* Minecraft block!
The Minecraft Block plugin is a great deal of fun and is super easy to use. Once activated, you’ll have the ability to show off your Minecraft addiction all over your blog. The plugin’s effects use CSS3 3D Transforms and absolutely no JavaScript! Amazing!
For browsers which support it, you will be able to add a CSS3 3D rotating Minecraft block of your choice anywhere on your site. For browsers that don’t support the full 3D CSS3 transforms, it will fall back to an isometric cube. Finally, on browsers that don’t support CSS transforms at all, you’ll still see a minecraft block, showing your support for Minecraft in more of a flat nature. I’ve created this plugin as a great way for WordPress users to show their support for their favorite block-world-simulator.
* Rotating only available on Webkit browsers.
More textures to come!
The shortcode accepts 4 arguments, texture, id, class, and url.
[minecraft texture='diamond' id='unique-diamond' class='floatleft' url='http://www.minecraft.net']
The only required argument is the ID argument, if none is supplied, no block will show up. The ID is given to the block’s container element, it should be a unique id. (meaning you can’t have more than 1 ‘my-minecraft-block’, if you want multiples, do something like ‘my-minecraft-block-1′, ‘my-minecraft-block-2′) It is best to use this ID to effect the CSS positioning of the element.
If no texture is provided, the block will use the texture set in the auto-block settings. Available textures are grass, dirt, gravel, sand, sandstone, mossy cobblestone (mossy), cobblestone, stone, coal, lapis lazuli (lapis), iron, redstone, gold, diamond, obsidian, bedrock, wood, plank, brick, glass, TNT (tnt), crafting table (table), chest, bookshelf, creeper, pig, skeleton, and player. I will be adding more textures for future releases so stay tuned!
You may optionally apply a CSS class to the container using the class argument, it will be applied to the same element which receives the ID. If multiple classes are to be applied, just put spaces between them inside the argument. If no class is given, none will be applied.
You may optionally apply a URL for the link to use when the block is clicked. If no URL is provided, the block will link to the URL set in the auto-block settings.
The template tag accepts the same 4 arguments as the shortcode, plus another to either return or echo the result.
<?php minecraft_block_create($texture, $id, $class, $url, $echo); ?>
The template tag works much in the same way as the shortcode. (It is actually the function the shortcode invokes to display the block) The arguments are supplied in the order given in this demonstration.
The same rules given in the shortcode also apply here. ID is required, make sure it is unique. You may optionally set the class, url, and echo parameters as well.
If no class is provided, the container will not be given any CSS classes.
If no URL is provided, the block will link to the URL set in the auto-block settings.
By default, $echo is set to true. If you would like the output of the function to be returned for more advanced uses, instead of printed to the page, set $echo to false.
← 1 2
March 26, 2012 at 7:02 am By Sebastian |
Hey Drew. This is awesome!
Can you make a tutorial on how to use it on other platforms like XenForo?
I’m fine with template edits.
April 28, 2012 at 7:06 pm By David |
I love this! Can’t wait for the addition of more blocks! I use this in my Precious Stones page on my server site.