Skip to main content
added 144 characters in body
Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

If I understand you, he hook you want (WordPress 3.5.1) is load-upload.php.

Proof of concept:

function t_wpse_94284() {
  wp_redirect(home_url()); 
  exit;
}
add_action('load-upload.php','t_wpse_94284');

That hook should fire only on /wp-admin/upload.php and, though I haven't tested it, I think that your function should work just fine as it is.

If I understand you, he hook you want (WordPress 3.5.1) is load-upload.php.

Proof of concept:

function t_wpse_94284() {
  wp_redirect(home_url()); 
  exit;
}
add_action('load-upload.php','t_wpse_94284');

If I understand you, he hook you want (WordPress 3.5.1) is load-upload.php.

Proof of concept:

function t_wpse_94284() {
  wp_redirect(home_url()); 
  exit;
}
add_action('load-upload.php','t_wpse_94284');

That hook should fire only on /wp-admin/upload.php and, though I haven't tested it, I think that your function should work just fine as it is.

Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

If I understand you, he hook you want (WordPress 3.5.1) is load-upload.php.

Proof of concept:

function t_wpse_94284() {
  wp_redirect(home_url()); 
  exit;
}
add_action('load-upload.php','t_wpse_94284');