C:\xampp\htdocs\landing\wp-content\plugins\amp\includes\embeds\class-amp-meetup-embed-handler.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
 * Class AMP_Meetup_Embed_Handler
 *
 * @package AMP
 * @since 0.7
 */

/**
 * Class AMP_Meetup_Embed_Handler
 *
 * @internal
 */
class AMP_Meetup_Embed_Handler extends AMP_Base_Embed_Handler {

    
/**
     * Register embed.
     */
    
public function register_embed() {
        
add_filter'embed_oembed_html', [ $this'filter_embed_oembed_html' ], 10);
    }

    
/**
     * Unregister embed.
     */
    
public function unregister_embed() {
        
remove_filter'embed_oembed_html', [ $this'filter_embed_oembed_html' ], 10 );
    }

    
/**
     * Filter oEmbed HTML for Meetup to prepare it for AMP.
     *
     * @param string $cache Cache for oEmbed.
     * @param string $url   Embed URL.
     * @return string Embed.
     */
    
public function filter_embed_oembed_html$cache$url ) {
        
$parsed_url wp_parse_url$url );
        if ( 
false !== strpos$parsed_url['host'], 'meetup.com' ) ) {

            
// Supply the width/height so that we don't have to make requests to look them up later.
            
$cache str_replace'<img ''<img width="50" height="50" '$cache );
        }
        return 
$cache;
    }
}

x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586