Plugin broke my posts' image gallery
-
The Link section was working fine with this nice plugin, but broke everything else related to media upload ??
As a workaround, I hacked into the code and changed the media_send_to_custom_field() function, which was now pointing to the wrong JS function.
Here is my version (link-image-gallery.php) :
function media_send_to_custom_field($html) {
preg_match(‘/src=”([^”]+)”/’, $html, $matches);
$html_custom = $matches[1];
$html_custom = str_replace(site_url(), ”, $html_custom);
?>
<script type=”text/javascript”>
var iframeParent = window.parent.location.toString();
var matches = iframeParent.match(/link.php/);
var win = window.dialogArguments || opener || parent || top;
if (matches) win.send_to_custom_field(“<?php echo trim(addslashes($html_custom)) ?>”);
else win.send_to_editor(‘<?php echo addslashes($html); ?>’);
win.tb_remove();
</script>
<?php
exit();}
Hope this can help someone ??
- The topic ‘Plugin broke my posts' image gallery’ is closed to new replies.