source: spip-zone/_plugins_/oembed/oembed/input/posttraite_soundcloud_rich.php

Last change on this file was 98148, checked in by kent1@…, 2 years ago

PSR SPIP

File size: 532 bytes
Line 
1<?php
2/**
3 * Plugin oEmbed
4 * Licence GPL3
5 *
6 */
7
8if (!defined('_ECRIRE_INC_VERSION')) {
9        return;
10}
11
12function oembed_input_posttraite_soundcloud_rich_dist($data) {
13
14        $data['media'] = 'audio';
15        $data['html'] = preg_replace(",width=['\"][0-9]+['\"],i", 'width="100%"', $data['html']);
16
17        if (!isset($data['thumbnail_url'])) {
18                $data['thumbnail_url'] = find_in_path('oembed/input/vignettes/soundcloud.png');
19        } else {
20                $data['thumbnail_url'] = preg_replace(',^http://,Uims', 'https://', $data['thumbnail_url']);
21        }
22
23        return $data;
24}
Note: See TracBrowser for help on using the repository browser.