Question: I want to make a link that goes to wp-login.php for whatever domain I'm at now. Something like:

```
<a href="http://<script>document.write(document.domain);</script>/wp-login.php">Login</a>

```

But I don't know how to write / format that properly.

Answer: 
Write a small plugin, use the follow example source to add a item in the list of the left sidebar in the media manager inside the overlay popup.

Result of the source below:
![enter image description here](https://i.stack.imgur.com/D1aLT.png)

```
add_action( 'admin_footer-post-new.php', 'wpse_78881_script' );
add_action( 'admin_footer-post.php', 'wpse_78881_script' );
function wpse_78881_script() {
    ?>
    <script type="text/javascript">
        jQuery(window).on('load', function() {
            var media   = window.wp.media,  
            Attachment  = media.model.Attachment,
            Attachments = media.model.Attachments,
            Query       = media.model.Query,
            l10n        = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n,
            My_new_item = undefined,
            Item_string = 'New Item!';

            jQuery(document).on( 'click', '.insert-media', function( event ) {
                var workflow = wp.media.editor.get();
                var options  = workflow.options;

                if ( undefined == My_new_item ) {
                    // see for wp.media.view.RouterItem also: wp-includes/js/media-views.js
                    My_new_item = new wp.media.view.RouterItem( _.extend( options, { text: Item_string } ) );
                    workflow.menu.view.views.set( '.media-menu', My_new_item, _.extend( options, { add: true } ) );
                }

            });
        });
    </script>
    <?php
}

```

* Init solution form [this WPSE Answer](https://wordpress.stackexchange.com/a/77744/170).
* [Link to draft plugin](https://gist.github.com/Fab1en/4586865) example to add a javascript menu into the WP3.5 Media Library popup
I've just encountered a case in WP 3.6 where aesqe's (very useful) answer results in images being inserted twice due to backbone's `state.get("selection")._byId` including both `id` and `cid` for each image selected. 

Changing `state.get("selection")._byId` to `state.get("selection").models` fixed this for me while preserving each object's attributes.

Hopefully this will save someone some frustration. I would have posted this as a comment instead of an answer but, alas, I have no reputation.