Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter brasofilo

    (@brasofilo)

    I already had the Re-attach feature in a plugin of mine and am shamelessly copying your unattach functions.

    It’s good practice to secure all our actions. This is what I did:

    In the column display use this URL

    $url_unattach = wp_nonce_url(
        admin_url( 'admin.php?page=unattach&noheader=true&post_id=' . $post->ID ),
        'my_nonce_name'
    );

    And in the submenu callback, put this at first

    check_admin_referer( 'my_nonce_name' );

    It’s a pity that bulk actions can only be removed . I’ll report back if I have any suggestions on this.

    cheers!

    Thread Starter brasofilo

    (@brasofilo)

    Ok, final touch. You don’t need to check for is_admin() in the following, one because it’s already targeting upload.php and the other is already an admin_* action and can be targeted as well:

    add_action( 'load-upload.php', 'bulk_action') );
    add_action( 'admin_footer-upload.php', '_admin_footer') );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to make the invisible menu’ is closed to new replies.