0

I use this code to open the popup editor.

<script>
    function edit() {
       var pop = window.open(' <?php echo get_edit_post_link(); ?> ', '_blank', 'screenX=200,screenY=200,width=1000,height=600');
        }
    </script>
<a href="" onclick="edit()" >Edit</a>

This returns this url: http://localhost/wordpress/wp-admin/post.php?post=122&amp;action=edit

But it shows: http://localhost/wordpress/wp-admin/edit.php

The problems is this "%amp;"

Any solution?

2

You need to tell get_edit_post_link to not use the ampersands as specified in the codex. Try this instead:

   var pop = window.open(' <?php echo get_edit_post_link(get_the_ID(), ''); ?> ', '_blank', 'screenX=200,screenY=200,width=1000,height=600');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.