Want more features on Pastebin? Sign Up, it's FREE!

Modify oembed Tweet width

By: jan_dembowski on Jun 14th, 2012  |  syntax: PHP  |  size: 0.33 KB  |  views: 200  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. add_filter('oembed_result','twitter_no_width',10,3);
  3. // add_filter('embed_oembed_html','twitter_no_width',10,3);
  4. function twitter_no_width($html, $url, $args) {
  5.         if (false !== strpos($url, 'twitter.com')) {
  6.                 $html = str_replace('width="550"','width="200"',$html);
  7.         }
  8.         return $html;
  9. }
clone this paste RAW Paste Data