=== fauxML === Contributors: matt, donncha, andy, mdawaffe Tags: fauxml, markup, embed, video, youtube, googlevideo Stable tag: trunk Requires at least: 2.0 Tested up to: 2.2 fauxML easily converts specific fake markup into full blown XHTML. It also offers an API for adding new fauxMLs. This plugin is useless now. WordPress 2.5+ comes with this functionality already. == Description == This plugin is useless now. WordPress 2.5+ comes with this functionality already. Don't bother copying and pasting long embed codes from places like [YouTube](http://youtube.com/) or [Google Video](http://video.google.com/). With fauxML, you can just enter `[youtube {{{youtube URL}}}]` or `[googlevideo {{{google video URL}}}]` in a blog entry, and you're done. So you could, for example, enter `[youtube http://youtube.com/watch?v=vRi0m329iL4]` to see [a video about taunting poor, cute puppies][1] or `[googlevideo http://video.google.com/videoplay?docid=1098259204041420273]` to see [everyone's favorite lauging baby][2]. fauxML also provides an API for plugin developers to write their own fauxML for other services. [1]: http://youtube.com/watch?v=vRi0m329iL4 [2]: http://video.google.com/videoplay?docid=1098259204041420273 == Installation == 1. Upload `faux-ml.php` to the `/wp-content/plugins/` directory. 1. Activate the plugin through the 'Plugins' menu in WordPress. == Frequently Asked Questions == = Where do I find the URL for a YouTube or Google Video video? = Just browse to the video and copy the URL from your browser's location bar. Yup, it's that easy! == Developer FAQ / API == = I want to write a plugin that uses fauxML for this cool new site, bobs-wonder-widgets.info. How do I do that? = Just register your fauxML parser with fauxML's `wp_add_faux_ml( $your_faux_ml_name, $your_parsing_function )` function. ` wp_add_faux_ml( 'bobs-wonder-widget', 'bobs_wonder_widget_parser' ); function bobs_wonder_widget_parser( $widget_data ) { $url = trim($widget_data); // $widget_markup = do some stuff after looking at $url; return $widget_markup; } ` Then when you type `[bobs-wonder-widget some stuff]` in a post, the text between `[bobs-wonder-widget ` and `]` will be sent to your parser function and the whole thing will be replaced by the output of that function. There's only one restriction: `$your_faux_ml_name` may be made of letters, numbers and hyphens only. = But my fauxML is more complicated than just `[bobs-wonder-widget some stuff]`. Can't you help? = Yes! You can also register your fauxML parsing function with a regular expression instead of just a name. In this case, the argument sent to your parser is the array of regex matches from the regex you provided. ` wp_add_faux_ml( '!\[bobs-(wonder|neato)-widget[ =](.*?)\]!i', 'bobs_wonder_and_neato_widget_parser' ); function bobs_wonder_and_neato_widget_parser( $regex_matches_array ) { // $widget_markup = do some stuff after looking at the regex matches; return $widget_markup; } ` = Can FauxML be used elsewhere besides posts? = Yup! `wp_add_faux_ml` accepts a third argument: the name of the WordPress filter hook to which you want to add your FauxML (it defaults to `the_content`). Too allow Bob's wonder widget FauxML parsing in comments, for example, add the following line to your plugin. ` wp_add_faux_ml( 'bobs-wonder-widget', 'bobs_wonder_widget_parser', 'comment_text' ); ` == Other Plugins == This plugin offers similar markup parsing for YouTube videos. * [Youtube Brackets](http://wordpress.org/extend/plugins/youtube-brackets/) While these offer expanded presentational functionality. * [TubePress](http://wordpress.org/extend/plugins/tubepress/) * [wordTube](http://wordpress.org/extend/plugins/wordtube/) And this plugin does something quasi-related. * [Noembedder](http://wordpress.org/extend/plugins/wp-noembedder/)