[wp-hackers] Disabling media buttons

Otto otto at ottodestruct.com
Wed Apr 16 21:48:13 GMT 2008


Okay, I'll be more clear...

function removestuff() {
remove_action( 'media_buttons', 'media_buttons' );
}
add_action('admin_head','removestuff');


On Wed, Apr 16, 2008 at 3:03 PM, Per Søderlind <per at soderlind.no> wrote:
> 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
>
>
>
>  _______________________________________________
>  wp-hackers mailing list
>  wp-hackers at lists.automattic.com
>  http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list