-
-
Save bhubbard/c7aaede67eb3dea480b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
wp_oembed_add_provider( 'http://*.houzz.com/*', 'http://www.houzz.com/oembed' ); | |
function do_houzz_shortcode($atts, $content=null) { | |
$url = substr( $atts[0], 1 ); | |
$args = array(); | |
if ( isset( $atts['w'] ) && is_numeric( $atts['w'] ) ) { | |
$args['width'] = $atts['w']; | |
} | |
if ( isset( $atts['h'] ) && is_numeric( $atts['h'] ) ) { | |
$args['height'] = $atts['h']; | |
} | |
$oembed = _wp_oembed_get_object(); | |
return $oembed->get_html( $url, $args ); | |
} | |
add_shortcode('houzz', 'do_houzz_shortcode'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment