Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi!

    My solution for “win.send_to_custom_field” or “win.send_to_editor”:

    I use custom field template plugin and many plugins. I’m sure that cft make the problem, conflict with hooking “media_send_to_editor” :

    add_filter( 'media_send_to_editor', array(&$this, 'media_send_to_custom_field'), 15 );

    I solved with this:

    Solution in custom-field-template.php :

    function media_send_to_custom_field($html) {
    		$options = $this->get_custom_field_template_data();
    
    		$out =  '<script type="text/javascript">' . "\n" .
    				'	/* <![CDATA[ */' . "\n" .
    				'	var win = window.dialogArguments || opener || parent || top;' . "\n" .
    				//'	win.send_to_custom_field("' . addslashes($html) . '");' . "\n" .
    				'	if(typeof win.send_to_custom_field == "function") {' . "\n" .
    				'	win.send_to_custom_field("' . addslashes($html) . '");' . "\n" .
    				'	} else {' . "\n" .
    				'	win.send_to_editor("' . addslashes($html) . '");' . "\n" .
    				'	}' . "\n" .
    				'/* ]]> */' . "\n" .
    				'</script>' . "\n";
    
    		echo $out;
    
    		if ($options['custom_field_template_use_multiple_insert']) {
    			return;
    		} else {
    			exit();
    		}
    	}

Viewing 1 replies (of 1 total)