[wp-hackers] Disabling media buttons

Per Søderlind per at soderlind.no
Wed Apr 16 20:03:06 GMT 2008


From: wp-hackers-bounces at lists.automattic.com [mailto:wp-hackers-
bounces at lists.automattic.com] On Behalf Of Otto
> 
> On Wed, Apr 16, 2008 at 12:21 PM, Per Søderlind <per at soderlind.no>
> wrote:
> >  > Have you tried this in a plugin or in the theme's functions.php
> file?
> >  >
> >  > remove_action( 'media_buttons', 'media_buttons' );
> >  >
> >  > That should eliminate the buttons from showing at all.
> >
> >  It's for a plugin (ImageManager). When/where should I call it. I
> tried doing
> >  it in a method called by init, but it didn't work.
> 
> Try hooking it onto admin_head. That should be early enough and yet
> late enough.

Thanks for the help Otto, but I can't manage to make it work. I think I've
tried any possible (feels like it at least :) combinations:

By itself (i.e. when my  plugin is loaded) i.e.:
  remove_action( 'media_buttons', 'media_buttons' );
// or
  remove_action( 'init', 'media_buttons' );
// or
  remove_action( 'admin_head', 'media_buttons' );

In a routine hooked by add_action('init','MYROUTINE')
In a routine hooked by add_action(' plugins_loaded ','MYROUTINE')

function MYROUTINE() {
  remove_action( 'media_buttons', 'media_buttons' );
// or
  remove_action( 'init', 'media_buttons' );
// or
  remove_action( 'admin_head', 'media_buttons' );

}

Regards,
Per



More information about the wp-hackers mailing list