Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre.../EmbedPre.../Includes/Classes
File: Feature_Enhancer.php
[1000] Fix | Delete
$url_modified = $url_full;
[1001] Fix | Delete
foreach ($params as $param => $value) {
[1002] Fix | Delete
$url_modified = add_query_arg($param, $value, $url_modified);
[1003] Fix | Delete
}
[1004] Fix | Delete
$embed->embed = str_replace($url_full, $url_modified, $embed->embed);
[1005] Fix | Delete
}
[1006] Fix | Delete
[1007] Fix | Delete
return $embed;
[1008] Fix | Delete
}
[1009] Fix | Delete
public function enhance_soundcloud($embed)
[1010] Fix | Delete
{
[1011] Fix | Delete
[1012] Fix | Delete
$isSoundcloud = (isset($embed->provider_name) && strtoupper($embed->provider_name) === 'SOUNDCLOUD') || (isset($embed->url) && isset($embed->{$embed->url}) && isset($embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name']) === 'SOUNDCLOUD');
[1013] Fix | Delete
[1014] Fix | Delete
if (
[1015] Fix | Delete
$isSoundcloud && isset($embed->embed)
[1016] Fix | Delete
&& preg_match('/src=\"(.+?)\"/', $embed->embed, $match)
[1017] Fix | Delete
) {
[1018] Fix | Delete
$options = $this->getOptions('soundcloud', $this->get_soundcloud_settings_schema());
[1019] Fix | Delete
// Parse the url to retrieve all its info like variables etc.
[1020] Fix | Delete
$url_full = $match[1];
[1021] Fix | Delete
$params = [
[1022] Fix | Delete
'color' => str_replace('#', '', $options['color']),
[1023] Fix | Delete
'visual' => isset($options['visual']) && $options['visual'] == '1' ? 'true' : 'false',
[1024] Fix | Delete
'auto_play' => isset($options['autoplay']) && $options['autoplay'] == '1' ? 'true' : 'false',
[1025] Fix | Delete
'sharing' => isset($options['share_button']) && $options['share_button'] == '1' ? 'true' : 'false',
[1026] Fix | Delete
'show_comments' => isset($options['comments']) && $options['comments'] == '1' ? 'true' : 'false',
[1027] Fix | Delete
'buying' => 'false',
[1028] Fix | Delete
'download' => 'false',
[1029] Fix | Delete
'show_artwork' => isset($options['artwork']) && $options['artwork'] == '1' ? 'true' : 'false',
[1030] Fix | Delete
'show_playcount' => isset($options['play_count']) && $options['play_count'] == '1' ? 'true' : 'false',
[1031] Fix | Delete
'show_user' => isset($options['username']) && $options['username'] == '1' ? 'true' : 'false',
[1032] Fix | Delete
];
[1033] Fix | Delete
[1034] Fix | Delete
if (is_embedpress_pro_active()) {
[1035] Fix | Delete
$params['buying'] = isset($options['buy_button']) && $options['buy_button'] == '1' ? 'true' : 'false';
[1036] Fix | Delete
$params['download'] = isset($options['download_button']) && $options['download_button'] == '1' ? 'true' : 'false';
[1037] Fix | Delete
}
[1038] Fix | Delete
[1039] Fix | Delete
$url_modified = $url_full;
[1040] Fix | Delete
foreach ($params as $param => $value) {
[1041] Fix | Delete
$url_modified = add_query_arg($param, $value, $url_modified);
[1042] Fix | Delete
}
[1043] Fix | Delete
[1044] Fix | Delete
// Replaces the old url with the new one.
[1045] Fix | Delete
$embed->embed = str_replace($url_full, $url_modified, $embed->embed);
[1046] Fix | Delete
if ('false' === $params['visual']) {
[1047] Fix | Delete
$embed->embed = str_replace('height="400"', 'height="200 !important"', $embed->embed);
[1048] Fix | Delete
}
[1049] Fix | Delete
}
[1050] Fix | Delete
[1051] Fix | Delete
return $embed;
[1052] Fix | Delete
}
[1053] Fix | Delete
public function embedpress_gutenberg_register_block_youtube($youtube_params)
[1054] Fix | Delete
{
[1055] Fix | Delete
$youtube_options = $this->getOptions('youtube', $this->get_youtube_settings_schema());
[1056] Fix | Delete
return $this->get_youtube_params($youtube_options);
[1057] Fix | Delete
}
[1058] Fix | Delete
public function embedpress_gutenberg_register_block_vimeo()
[1059] Fix | Delete
{
[1060] Fix | Delete
if (function_exists('register_block_type')) :
[1061] Fix | Delete
register_block_type('embedpress/vimeo-block', array(
[1062] Fix | Delete
'attributes' => array(
[1063] Fix | Delete
'url' => array(
[1064] Fix | Delete
'type' => 'string',
[1065] Fix | Delete
'default' => ''
[1066] Fix | Delete
),
[1067] Fix | Delete
'iframeSrc' => array(
[1068] Fix | Delete
'type' => 'string',
[1069] Fix | Delete
'default' => ''
[1070] Fix | Delete
),
[1071] Fix | Delete
),
[1072] Fix | Delete
'render_callback' => [$this, 'embedpress_gutenberg_render_block_vimeo']
[1073] Fix | Delete
));
[1074] Fix | Delete
endif;
[1075] Fix | Delete
}
[1076] Fix | Delete
public function embedpress_gutenberg_render_block_vimeo($attributes)
[1077] Fix | Delete
{
[1078] Fix | Delete
ob_start();
[1079] Fix | Delete
if (!empty($attributes) && !empty($attributes['iframeSrc'])) :
[1080] Fix | Delete
$vimeo_options = $this->getOptions('vimeo', $this->get_vimeo_settings_schema());
[1081] Fix | Delete
$vimeo_params = $this->get_vimeo_params($vimeo_options);
[1082] Fix | Delete
$iframeUrl = $attributes['iframeSrc'];
[1083] Fix | Delete
$align = 'align' . (isset($attributes['align']) ? $attributes['align'] : 'center');
[1084] Fix | Delete
foreach ($vimeo_params as $param => $value) {
[1085] Fix | Delete
$iframeUrl = add_query_arg($param, $value, $iframeUrl);
[1086] Fix | Delete
}
[1087] Fix | Delete
//@TODO; test responsive without static height width, keeping for now backward compatibility
[1088] Fix | Delete
?>
[1089] Fix | Delete
<div class="ose-vimeo wp-block-embed-vimeo <?php echo esc_attr($align); ?>">
[1090] Fix | Delete
<iframe src="<?php echo esc_url($iframeUrl); ?>" allowtransparency="true" frameborder="0" width="640" height="360">
[1091] Fix | Delete
</iframe>
[1092] Fix | Delete
</div>
[1093] Fix | Delete
<?php
[1094] Fix | Delete
endif;
[1095] Fix | Delete
[1096] Fix | Delete
return apply_filters('embedpress_gutenberg_block_markup', ob_get_clean());
[1097] Fix | Delete
}
[1098] Fix | Delete
public function get_youtube_settings_schema()
[1099] Fix | Delete
{
[1100] Fix | Delete
return [
[1101] Fix | Delete
'autoplay' => [
[1102] Fix | Delete
'type' => 'bool',
[1103] Fix | Delete
'default' => false
[1104] Fix | Delete
],
[1105] Fix | Delete
'color' => [
[1106] Fix | Delete
'type' => 'string',
[1107] Fix | Delete
'default' => 'red'
[1108] Fix | Delete
],
[1109] Fix | Delete
'cc_load_policy' => [
[1110] Fix | Delete
'type' => 'bool',
[1111] Fix | Delete
'default' => false
[1112] Fix | Delete
],
[1113] Fix | Delete
'controls' => [
[1114] Fix | Delete
'type' => 'string',
[1115] Fix | Delete
'default' => '1'
[1116] Fix | Delete
],
[1117] Fix | Delete
'fs' => [
[1118] Fix | Delete
'type' => 'bool',
[1119] Fix | Delete
'default' => true
[1120] Fix | Delete
],
[1121] Fix | Delete
'iv_load_policy' => [
[1122] Fix | Delete
'type' => 'radio',
[1123] Fix | Delete
'default' => '1'
[1124] Fix | Delete
],
[1125] Fix | Delete
'rel' => [
[1126] Fix | Delete
'type' => 'bool',
[1127] Fix | Delete
'default' => true
[1128] Fix | Delete
],
[1129] Fix | Delete
'modestbranding' => [
[1130] Fix | Delete
'type' => 'string',
[1131] Fix | Delete
'default' => '0'
[1132] Fix | Delete
],
[1133] Fix | Delete
'logo_url' => [
[1134] Fix | Delete
'type' => 'url',
[1135] Fix | Delete
],
[1136] Fix | Delete
'logo_xpos' => [
[1137] Fix | Delete
'type' => 'number',
[1138] Fix | Delete
'default' => 10
[1139] Fix | Delete
],
[1140] Fix | Delete
'logo_ypos' => [
[1141] Fix | Delete
'type' => 'number',
[1142] Fix | Delete
'default' => 10
[1143] Fix | Delete
],
[1144] Fix | Delete
'cta_url' => [
[1145] Fix | Delete
'type' => 'url',
[1146] Fix | Delete
],
[1147] Fix | Delete
'start_time' => [
[1148] Fix | Delete
'type' => 'number',
[1149] Fix | Delete
'default' => 10
[1150] Fix | Delete
],
[1151] Fix | Delete
'end_time' => [
[1152] Fix | Delete
'type' => 'number',
[1153] Fix | Delete
'default' => 10
[1154] Fix | Delete
],
[1155] Fix | Delete
];
[1156] Fix | Delete
}
[1157] Fix | Delete
public function get_vimeo_settings_schema()
[1158] Fix | Delete
{
[1159] Fix | Delete
return array(
[1160] Fix | Delete
'start_time' => [
[1161] Fix | Delete
'type' => 'number',
[1162] Fix | Delete
'default' => 10
[1163] Fix | Delete
],
[1164] Fix | Delete
'autoplay' => array(
[1165] Fix | Delete
'type' => 'bool',
[1166] Fix | Delete
'default' => false
[1167] Fix | Delete
),
[1168] Fix | Delete
'loop' => array(
[1169] Fix | Delete
'type' => 'bool',
[1170] Fix | Delete
'default' => false
[1171] Fix | Delete
),
[1172] Fix | Delete
'autopause' => array(
[1173] Fix | Delete
'type' => 'bool',
[1174] Fix | Delete
'default' => false
[1175] Fix | Delete
),
[1176] Fix | Delete
'vimeo_dnt' => array(
[1177] Fix | Delete
'type' => 'bool',
[1178] Fix | Delete
'default' => true,
[1179] Fix | Delete
),
[1180] Fix | Delete
'color' => array(
[1181] Fix | Delete
'type' => 'text',
[1182] Fix | Delete
'default' => '#00adef',
[1183] Fix | Delete
'classes' => 'color-field'
[1184] Fix | Delete
),
[1185] Fix | Delete
'display_title' => array(
[1186] Fix | Delete
'type' => 'bool',
[1187] Fix | Delete
'default' => true
[1188] Fix | Delete
),
[1189] Fix | Delete
'display_author' => array(
[1190] Fix | Delete
'type' => 'bool',
[1191] Fix | Delete
'default' => true
[1192] Fix | Delete
),
[1193] Fix | Delete
'display_avatar' => array(
[1194] Fix | Delete
'type' => 'bool',
[1195] Fix | Delete
'default' => true
[1196] Fix | Delete
)
[1197] Fix | Delete
);
[1198] Fix | Delete
}
[1199] Fix | Delete
public function get_wistia_settings_schema()
[1200] Fix | Delete
{
[1201] Fix | Delete
return array(
[1202] Fix | Delete
'start_time' => [
[1203] Fix | Delete
'type' => 'number',
[1204] Fix | Delete
'default' => 0
[1205] Fix | Delete
],
[1206] Fix | Delete
'display_fullscreen_button' => array(
[1207] Fix | Delete
'type' => 'bool',
[1208] Fix | Delete
'default' => true
[1209] Fix | Delete
),
[1210] Fix | Delete
'display_playbar' => array(
[1211] Fix | Delete
'type' => 'bool',
[1212] Fix | Delete
'default' => true
[1213] Fix | Delete
),
[1214] Fix | Delete
'small_play_button' => array(
[1215] Fix | Delete
'type' => 'bool',
[1216] Fix | Delete
'default' => true
[1217] Fix | Delete
),
[1218] Fix | Delete
'display_volume_control' => array(
[1219] Fix | Delete
'type' => 'bool',
[1220] Fix | Delete
'default' => true
[1221] Fix | Delete
),
[1222] Fix | Delete
'autoplay' => array(
[1223] Fix | Delete
'type' => 'bool',
[1224] Fix | Delete
'default' => false
[1225] Fix | Delete
),
[1226] Fix | Delete
'volume' => array(
[1227] Fix | Delete
'type' => 'text',
[1228] Fix | Delete
'default' => '100'
[1229] Fix | Delete
),
[1230] Fix | Delete
'player_color' => array(
[1231] Fix | Delete
'type' => 'text',
[1232] Fix | Delete
'default' => '#00adef',
[1233] Fix | Delete
),
[1234] Fix | Delete
'plugin_resumable' => array(
[1235] Fix | Delete
'type' => 'bool',
[1236] Fix | Delete
'default' => false
[1237] Fix | Delete
),
[1238] Fix | Delete
'plugin_captions' => array(
[1239] Fix | Delete
'type' => 'bool',
[1240] Fix | Delete
'default' => false
[1241] Fix | Delete
),
[1242] Fix | Delete
'plugin_captions_default' => array(
[1243] Fix | Delete
'type' => 'bool',
[1244] Fix | Delete
'default' => false
[1245] Fix | Delete
),
[1246] Fix | Delete
'plugin_focus' => array(
[1247] Fix | Delete
'type' => 'bool',
[1248] Fix | Delete
'default' => false
[1249] Fix | Delete
),
[1250] Fix | Delete
'plugin_rewind' => array(
[1251] Fix | Delete
'type' => 'bool',
[1252] Fix | Delete
'default' => false
[1253] Fix | Delete
),
[1254] Fix | Delete
'plugin_rewind_time' => array(
[1255] Fix | Delete
'type' => 'text',
[1256] Fix | Delete
'default' => '10'
[1257] Fix | Delete
),
[1258] Fix | Delete
);
[1259] Fix | Delete
}
[1260] Fix | Delete
[1261] Fix | Delete
[1262] Fix | Delete
public function getVideoIDFromURL($url)
[1263] Fix | Delete
{
[1264] Fix | Delete
// https://fast.wistia.com/embed/medias/xf1edjzn92.jsonp
[1265] Fix | Delete
// https://ostraining-1.wistia.com/medias/xf1edjzn92
[1266] Fix | Delete
preg_match('#\/medias\\\?\/([a-z0-9]+)\.?#i', $url, $matches);
[1267] Fix | Delete
[1268] Fix | Delete
$id = false;
[1269] Fix | Delete
if (isset($matches[1])) {
[1270] Fix | Delete
$id = $matches[1];
[1271] Fix | Delete
}
[1272] Fix | Delete
[1273] Fix | Delete
return $id;
[1274] Fix | Delete
}
[1275] Fix | Delete
public function embedpress_wistia_block_after_embed($attributes)
[1276] Fix | Delete
{
[1277] Fix | Delete
$embedOptions = $this->embedpress_wistia_pro_get_options();
[1278] Fix | Delete
// Get the video ID
[1279] Fix | Delete
$videoId = $this->getVideoIDFromURL($attributes['url']);
[1280] Fix | Delete
$shortVideoId = $videoId;
[1281] Fix | Delete
[1282] Fix | Delete
$labels = array(
[1283] Fix | Delete
'watch_from_beginning' => __('Watch from the beginning', 'embedpress'),
[1284] Fix | Delete
'skip_to_where_you_left_off' => __('Skip to where you left off', 'embedpress'),
[1285] Fix | Delete
'you_have_watched_it_before' => __('It looks like you\'ve watched<br />part of this video before!', 'embedpress'),
[1286] Fix | Delete
);
[1287] Fix | Delete
$labels = json_encode($labels);
[1288] Fix | Delete
[1289] Fix | Delete
[1290] Fix | Delete
$html = '<script src="https://fast.wistia.com/assets/external/E-v1.js"></script>';
[1291] Fix | Delete
$html .= "<script>window.pp_embed_wistia_labels = {$labels};</script>\n";
[1292] Fix | Delete
$html .= "<script>wistiaEmbed = Wistia.embed( \"{$shortVideoId}\", {$embedOptions} );</script>\n";
[1293] Fix | Delete
[1294] Fix | Delete
[1295] Fix | Delete
[1296] Fix | Delete
echo $html;
[1297] Fix | Delete
}
[1298] Fix | Delete
public function embedpress_wistia_pro_get_options()
[1299] Fix | Delete
{
[1300] Fix | Delete
$options = $this->getOptions('wistia', $this->get_wistia_settings_schema());
[1301] Fix | Delete
// Embed Options
[1302] Fix | Delete
$embedOptions = new \stdClass;
[1303] Fix | Delete
// $embedOptions->videoFoam = true;
[1304] Fix | Delete
$embedOptions->fullscreenButton = (isset($options['display_fullscreen_button']) && (bool) $options['display_fullscreen_button'] === true);
[1305] Fix | Delete
$embedOptions->smallPlayButton = (isset($options['small_play_button']) && (bool) $options['small_play_button'] === true);
[1306] Fix | Delete
$embedOptions->autoPlay = (isset($options['autoplay']) && (bool) $options['autoplay'] === true);
[1307] Fix | Delete
[1308] Fix | Delete
if (isset($options['player_color'])) {
[1309] Fix | Delete
$color = $options['player_color'];
[1310] Fix | Delete
if (null !== $color) {
[1311] Fix | Delete
$embedOptions->playerColor = $color;
[1312] Fix | Delete
}
[1313] Fix | Delete
}
[1314] Fix | Delete
[1315] Fix | Delete
// Plugins
[1316] Fix | Delete
$pluginsBaseURL = plugins_url('assets/js/wistia/min', dirname(__DIR__) . '/embedpress-Wistia.php');
[1317] Fix | Delete
[1318] Fix | Delete
$pluginList = array();
[1319] Fix | Delete
[1320] Fix | Delete
// Resumable
[1321] Fix | Delete
if (isset($options['plugin_resumable'])) {
[1322] Fix | Delete
$isResumableEnabled = $options['plugin_resumable'];
[1323] Fix | Delete
if ($isResumableEnabled) {
[1324] Fix | Delete
// Add the resumable plugin
[1325] Fix | Delete
$pluginList['resumable'] = array(
[1326] Fix | Delete
'src' => '//fast.wistia.com/labs/resumable/plugin.js',
[1327] Fix | Delete
'async' => false
[1328] Fix | Delete
);
[1329] Fix | Delete
}
[1330] Fix | Delete
}
[1331] Fix | Delete
// Add a fix for the autoplay and resumable work better together
[1332] Fix | Delete
//@TODO; check baseurl deeply, not looking good
[1333] Fix | Delete
if ($options['autoplay']) {
[1334] Fix | Delete
if ($isResumableEnabled) {
[1335] Fix | Delete
$pluginList['fixautoplayresumable'] = array(
[1336] Fix | Delete
'src' => $pluginsBaseURL . '/fixautoplayresumable.min.js'
[1337] Fix | Delete
);
[1338] Fix | Delete
}
[1339] Fix | Delete
}
[1340] Fix | Delete
[1341] Fix | Delete
[1342] Fix | Delete
// Focus plugin
[1343] Fix | Delete
if (isset($options['plugin_focus'])) {
[1344] Fix | Delete
$isFocusEnabled = $options['plugin_focus'];
[1345] Fix | Delete
$pluginList['dimthelights'] = array(
[1346] Fix | Delete
'src' => '//fast.wistia.com/labs/dim-the-lights/plugin.js',
[1347] Fix | Delete
'autoDim' => $isFocusEnabled
[1348] Fix | Delete
);
[1349] Fix | Delete
$embedOptions->focus = $isFocusEnabled;
[1350] Fix | Delete
}
[1351] Fix | Delete
[1352] Fix | Delete
$embedOptions->plugin = $pluginList;
[1353] Fix | Delete
$embedOptions = apply_filters('embedpress_wistia_params', $embedOptions);
[1354] Fix | Delete
$embedOptions = json_encode($embedOptions);
[1355] Fix | Delete
return apply_filters('embedpress_wistia_params_after_encode', $embedOptions);
[1356] Fix | Delete
}
[1357] Fix | Delete
[1358] Fix | Delete
[1359] Fix | Delete
public function get_twitch_settings_schema()
[1360] Fix | Delete
{
[1361] Fix | Delete
return [
[1362] Fix | Delete
'start_time' => [
[1363] Fix | Delete
'type' => 'number',
[1364] Fix | Delete
'default' => 0,
[1365] Fix | Delete
],
[1366] Fix | Delete
'embedpress_pro_twitch_autoplay' => [
[1367] Fix | Delete
'type' => 'string',
[1368] Fix | Delete
'default' => 'no',
[1369] Fix | Delete
],
[1370] Fix | Delete
'embedpress_pro_twitch_chat' => [
[1371] Fix | Delete
'type' => 'string',
[1372] Fix | Delete
'default' => 'no',
[1373] Fix | Delete
],
[1374] Fix | Delete
[1375] Fix | Delete
'embedpress_pro_twitch_theme' => [
[1376] Fix | Delete
'type' => 'string',
[1377] Fix | Delete
'default' => 'dark',
[1378] Fix | Delete
],
[1379] Fix | Delete
'embedpress_pro_fs' => [
[1380] Fix | Delete
'type' => 'string',
[1381] Fix | Delete
'default' => 'yes',
[1382] Fix | Delete
],
[1383] Fix | Delete
'embedpress_pro_twitch_mute' => [
[1384] Fix | Delete
'type' => 'string',
[1385] Fix | Delete
'default' => 'yes',
[1386] Fix | Delete
],
[1387] Fix | Delete
[1388] Fix | Delete
];
[1389] Fix | Delete
}
[1390] Fix | Delete
public function get_dailymotion_settings_schema()
[1391] Fix | Delete
{
[1392] Fix | Delete
return [
[1393] Fix | Delete
'autoplay' => [
[1394] Fix | Delete
'type' => 'string',
[1395] Fix | Delete
'default' => ''
[1396] Fix | Delete
],
[1397] Fix | Delete
'play_on_mobile' => [
[1398] Fix | Delete
'type' => 'string',
[1399] Fix | Delete
'default' => ''
[1400] Fix | Delete
],
[1401] Fix | Delete
'color' => [
[1402] Fix | Delete
'type' => 'string',
[1403] Fix | Delete
'default' => '#dd3333'
[1404] Fix | Delete
],
[1405] Fix | Delete
'mute' => [
[1406] Fix | Delete
'type' => 'string',
[1407] Fix | Delete
'default' => ''
[1408] Fix | Delete
],
[1409] Fix | Delete
'controls' => [
[1410] Fix | Delete
'type' => 'string',
[1411] Fix | Delete
'default' => '1'
[1412] Fix | Delete
],
[1413] Fix | Delete
'video_info' => [
[1414] Fix | Delete
'type' => 'string',
[1415] Fix | Delete
'default' => '1'
[1416] Fix | Delete
],
[1417] Fix | Delete
'show_logo' => [
[1418] Fix | Delete
'type' => 'string',
[1419] Fix | Delete
'default' => '1'
[1420] Fix | Delete
],
[1421] Fix | Delete
'start_time' => [
[1422] Fix | Delete
'type' => 'string',
[1423] Fix | Delete
'default' => '0'
[1424] Fix | Delete
],
[1425] Fix | Delete
];
[1426] Fix | Delete
}
[1427] Fix | Delete
public function get_soundcloud_settings_schema()
[1428] Fix | Delete
{
[1429] Fix | Delete
return [
[1430] Fix | Delete
'visual' => [
[1431] Fix | Delete
'type' => 'string',
[1432] Fix | Delete
'default' => ''
[1433] Fix | Delete
],
[1434] Fix | Delete
'autoplay' => [
[1435] Fix | Delete
'type' => 'string',
[1436] Fix | Delete
'default' => ''
[1437] Fix | Delete
],
[1438] Fix | Delete
'play_on_mobile' => [
[1439] Fix | Delete
'type' => 'string',
[1440] Fix | Delete
'default' => ''
[1441] Fix | Delete
],
[1442] Fix | Delete
'color' => [
[1443] Fix | Delete
'type' => 'string',
[1444] Fix | Delete
'default' => '#dd3333'
[1445] Fix | Delete
],
[1446] Fix | Delete
[1447] Fix | Delete
'share_button' => [
[1448] Fix | Delete
'type' => 'string',
[1449] Fix | Delete
'default' => ''
[1450] Fix | Delete
],
[1451] Fix | Delete
'comments' => [
[1452] Fix | Delete
'type' => 'string',
[1453] Fix | Delete
'default' => '1'
[1454] Fix | Delete
],
[1455] Fix | Delete
'artwork' => [
[1456] Fix | Delete
'type' => 'string',
[1457] Fix | Delete
'default' => ''
[1458] Fix | Delete
],
[1459] Fix | Delete
'play_count' => [
[1460] Fix | Delete
'type' => 'string',
[1461] Fix | Delete
'default' => '1'
[1462] Fix | Delete
],
[1463] Fix | Delete
'username' => [
[1464] Fix | Delete
'type' => 'string',
[1465] Fix | Delete
'default' => '1'
[1466] Fix | Delete
],
[1467] Fix | Delete
'download_button' => [
[1468] Fix | Delete
'type' => 'string',
[1469] Fix | Delete
'default' => '1'
[1470] Fix | Delete
],
[1471] Fix | Delete
'buy_button' => [
[1472] Fix | Delete
'type' => 'string',
[1473] Fix | Delete
'default' => '1'
[1474] Fix | Delete
],
[1475] Fix | Delete
];
[1476] Fix | Delete
}
[1477] Fix | Delete
[1478] Fix | Delete
public function enhance_missing_title($embed)
[1479] Fix | Delete
{
[1480] Fix | Delete
[1481] Fix | Delete
$embed_arr = get_object_vars($embed);
[1482] Fix | Delete
[1483] Fix | Delete
$url = $embed->url;
[1484] Fix | Delete
[1485] Fix | Delete
if (strpos($url, 'gettyimages') !== false) {
[1486] Fix | Delete
$title = $embed_arr[$url]['title'];
[1487] Fix | Delete
$embed->embed = $embed->embed . "
[1488] Fix | Delete
<script>
[1489] Fix | Delete
if (typeof gie === 'function') {
[1490] Fix | Delete
gie(function(){
[1491] Fix | Delete
var iframe = document.querySelector('.ose-embedpress-responsive iframe');
[1492] Fix | Delete
if(iframe && !iframe.getAttribute('title')){
[1493] Fix | Delete
iframe.setAttribute('title', '$title')
[1494] Fix | Delete
}
[1495] Fix | Delete
});
[1496] Fix | Delete
}
[1497] Fix | Delete
</script>
[1498] Fix | Delete
";
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function