4
Jun
written by admin • posted in How-To • 841 views • 10 comments
wp_add_faux_ml( 'gwave', 'wp_gwave_faux_ml' );
function wp_gwave_faux_ml( $src ) {
$srctag = str_replace("-","a",substr($src,18,8));
$obj = '<script src="http://wave-api.appspot.com/public/embed.js" type="text/javascript"></script><script type="text/javascript">function initialize'.$srctag.'() { var wavePanel = new WavePanel("http://wave.google.com/a/wavesandbox.com/"); wavePanel.loadWave("'.$src.'"); wavePanel.init(document.getElementById("waveframe'.$srctag.'")); }</script><div id="waveframe'.$srctag.'" style="width: 600px; height: 80%"></div><script type="text/javascript">initialize'.$srctag.'();</script>
';
return $obj;
}
I am using the API in the original fauxML plugin. By adding the code above to the php code, fauxML now supports the Wave insertion by the following syntax:
![]()
Remember to add onload=”initialize()” to the body tag. Something like:
<body onload="initialize()">
There are ways to trigger initialize() using other methods, one example is here. I can change my body, so I go with the easiest way. I saw this post and decide to put
<script type="text/javascript">initialize();</script>
right after the div#waveframe! Better code. No longer to tweak the body header.
Right now, I can see this (below is a screen capture, not the real wave)

only in Chrome 3, not Firefox 3.5b4 or Safari 4beta. Emm emm ……
Detailed information about the Wave Embed API is here. Enjoy waving!
10 Responses to “A quick way to embed Google Wave into blog powered by wordpress”
Leave a Reply
New in 'How-To'
Hot in 'How-To'
- analog – analog/digital – digital, VGA – DVI – HDMI - 14,219 views
- Ez-12 windsurfer antenna - 9,744 views
- How to add new ringtones to iPhone - 8,625 views
- mac osx 10.5.1 kalway on Lenovo Thinkpad T43 2668AJU - 6,725 views
- Install transmission using ipkg built packages in the MyBook World NAS - 4,944 views














at the current stage, to view the embeded wave, you need to have a wave account. and the embed only works for Chrome.
[...] from Google Wave using my modified fauxML plugin. And here is the content (you need a wave account and see it in Chrome [...]
Firefox 3.0 with Google Gears 0.5.21.0 works!
Since “-” is not allowed in some part of the JS code, I modified my php script a little to replace “-” with “a”.
Hello! I created a WordPress plugin that is similar to this, but gives you all the options of the Wave embed API, plus a button in case you forget the shortcode. My solution also takes advantage of WordPress’ inbuilt shortcode API, so having fauxML is not necessary the functionality is built into WordPress. The code is located at http://code.google.com/p/wp-wave-shortcodes/ .. it’s still a bit messy internally, but it is worth looking at… Especially if you have a Wave account already! (I don’t have one, so all I see is the “We’re in a preview” message…)
Hi Joshua, I test your plugin – somehow it is not displaying.
I saw the [wave id="wavesandbox.com!w+MkAgF3zH%1"] was convert into a wrong id … wavePanel1.loadWave(‘wavesandbox.com!w+0′);…

I was also playing with multiple waves in one post by using some str_replace; should work, but not – probably due to the buggy wave system in the current state.
oops, Joshua, I check your code and see “loadWave(‘wavesandbox.com!w+< ?php print $wave_id; ?>‘);”
so I test with [wave id="MkAgF3zH%1"], but same output wrong id is displayed
I think it might be a good idea NOT to hard code wavesandbox.com!w+ because other wave servers will have different prefix …
Hey there, yet another plugin for wordpress, Wavr, using shortcodes like you use, you can set all available options in the shortcode and it has a settings page where you can set your defaults. I hope you like it! http://wordpress.org/extend/plugins/wavr/
cool, thanks Lucas
[...] am a blogger, and I want to embed Wave easily into my blog post. Here is how. Of course, there are many solutions on the Internet which are doing the similar [...]