[ Index ]

MailPress 7.2

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

title

Body

[close]

/mp-includes/class/ -> MP_oEmbed.class.php (source)

   1  <?php
   2  class MP_oEmbed extends WP_oEmbed
   3  {
   4  	function data2html( $data, $url )
   5      {
   6          if ( ! is_object( $data ) ) return false;
   7  
   8          if ( !class_exists( 'MP_oEmbed_providers', false ) ) new MP_oEmbed_providers();
   9  
  10          $html = '';
  11  
  12          $filter = 'MailPress_oembed_providers_data2html_' . str_replace( ' ', '_', $data->provider_name );
  13          if ( has_filter( $filter ) ) $html = apply_filters( $filter, $html, $data, $url );
  14          if ( !empty( $html ) ) return $html;
  15  
  16          foreach( array( 'thumbnail_width', 'thumbnail_height', 'thumbnail_url', 'title' ) as $var )
  17          {
  18              if ( isset( $data->{$var} ) && !empty( $data->{$var} ) ) continue;
  19  
  20              $html .= '<a target="_blank" href="' . esc_url( $url ) . '"';
  21              $html .= ' class="mp_' . $data->provider_name . '"';
  22              if ( isset( $data->title ) )         $html .= ' title="' . esc_attr( $data->title ) . '"';
  23              $html .= '>';
  24              $html .= $data->title ?? $url;
  25              $html .= '</a>';
  26          }
  27          if ( !empty( $html ) ) return $html;
  28  
  29          if ( !isset( $data->url ) ) $data->url = $url;
  30  
  31          return MailPress_embed::_embed_get( $data );
  32      }
  33  }


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