[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/options/oembed/providers/ -> Instagram.php (source)

   1  <?php
   2  class MP_oembed_provider_Instagram extends MP_oembed_provider_
   3  {
   4      public $id = 'Instagram';
   5  
   6  	function data2html( $html, $data, $url )
   7      {
   8  
   9          switch ( $data->type )
  10          {
  11              case 'photo' :
  12                  $html  = '<a target="_blank" href="' . esc_url( $url ) . '"';
  13                  if ( isset( $data->title ) )           $html .= ' title="' . esc_attr( $data->title ) . '"';
  14                  $html .= '>';
  15  
  16                  $html .= '<img';
  17                  if ( isset( $data->width ) )  $html .= ' width="' . $data->width . 'px"';
  18                  if ( isset( $data->height ) ) $html .= ' height="' . $data->height . 'px"';
  19                  if ( isset( $data->url ) )    $html .= ' src="' . $data->url . '"';
  20                  if ( isset( $data->title ) )  $html .= ' title="' . esc_attr( $data->title ) . '" alt="' . esc_attr( $data->title ) . '"';
  21                  $html .= ' />';
  22  
  23                  $html .= '</a>';
  24              break;
  25          }
  26          return $html;
  27      }
  28  }
  29  new MP_oembed_provider_Instagram();


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1