• Resolved janjarfalk

    (@janjarfalk)


    Hi,

    I am currently writing my first wordpress plugin and need a bit of help. From inside the admin interface I need to send the administrator to the ‘New blog post’-view with the content textbox prefilled.

    I’ve done some searching, but I don’t really know what to look for. Am I supposed to set up a hook.. filter? The filter default_content seams reltared but solving it with a hook currently seams a bit odd.

    Thanks in advance,
    Jan

Viewing 1 replies (of 1 total)
  • Thread Starter janjarfalk

    (@janjarfalk)

    I solved it by using the hook load-post-new.php

    add_action ('load-post-new.php', 'setContent');
    function setContent(){
    	?>
    	<script type="text/javascript">
    	jQuery(function($){
    		$('#content').html('<?php echo urldecode($_GET['content']); ?>');
    	});
    	</script>
    	<?php
    }

    Sending the admin to new-post.php?content=foo prefills the content textarea with the value foo.

    All for now,
    Jan

Viewing 1 replies (of 1 total)
  • The topic ‘Send admin to New Blog Post with content prefilled’ is closed to new replies.