Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • I found a solution.
    The image upload page was supposed to be displayed in the JS ThickBox, which wasn’t happening. After a little digging, I found that this was because I had called a JavaScript file from my theme’s functions.php file using
    <?php echo '<script type="text/javascript" src="myfile.js"></script>'; ?>
    The correct way to call a JS file for a plug-in or theme is to use the wp_enqueue_script() command

    <?php
    function add_custom_js() {
    	$dir = get_option( 'siteurl' );
    	$url = $dir . '/wp-content/themes/themename/my-js.js';
    	wp_enqueue_script( 'script-name', $url );
    }
    add_action('init', 'add_custom_js');
    ?>

    This solved my problem completely.

    I’ve been having the same issue.
    On WordPress 3.0.1 I can upload an image without a problem, but when it comes to inserting the image into a post, I am taken to https://*mysite*.com/wp-admin/media-upload.php?type=image&tab=library&post_id=*postnum*, which is a blank screen.

    Firebug reports that “win.send_to_editor is not a function”.
    The problem appears to be a load of missing JavaScript, but I’m not 100% sure what is needed to fix this issue.

Viewing 2 replies - 1 through 2 (of 2 total)