WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to verify if the media-upload screen came from a click on the "feature image link" on the admin screen. How can i do it?

I've already change the way the uploader works , but I need to check this because there is a special flow for the featured image upload.

share|improve this question
up vote 3 down vote accepted

There is a filter for the html of the 'postimagediv' called 'admin_post_thumbnail_html'.

There may be more elegant ways, but this works:

add_filter('admin_post_thumbnail_html', 'wpse61502_change_thumbnail_link');

function wpse61502_change_thumbnail_link($content)
    return str_replace('media-upload.php?', 'media-upload.php?is_thumbnail=true&', $content);

In your plugin / script check the querystring:

if ( isset($_GET['is_thumbnail']) )
    // do stuff, actions, enqueue, ...
share|improve this answer
worked like a charm, ty! ps: if ( isset($_GET['is_thumbnail'] )) line needs a ending parethesis, – jonathan Aug 13 '12 at 14:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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