• Hi there,

    I cannot remove the function media_upload_max_image_resize from the action post-upload-ui.
    I call it in my plugin like this:

    remove_action( 'post-upload-ui', 'media_upload_max_image_resize');

    But its not working. Do I copy the same line into wp-admin/includes/media.php right after it gets added on line 2001, its working.
    As far as I can tell, the problem is that my plugin gets loaded before the action. How should I handle that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Not sure why you want to do this but try:

    function my_remove_mumir() {
    remove_action( 'post-upload-ui', 'media_upload_max_image_resize');
    }
    add_action('init', 'remove_mumir');

    –> And never manually edit core files!! <–

    Thread Starter pampfelimetten

    (@pampfelimetten)

    Tried that, not working either, but thanks for the tip (by the way, it should be my_remove_mumir in the last line).

    Any other suggestions?

    And well, why is it added via a action hook if I cannot modify it? And fyi, its for a cms installation with a preeeeeetty big userbase, centered on simplicity. We removed probably 80% of the standard UI already 😉

    Typos, Gotta love’m.

    You should be able to add/remove through action hooks. Your wording made it sound like you were looking to edit the actual file where the it initially adds the action. If I was correct in that then doing so will break in future updates.

    Could always add your own action to post-upload-ui that echos or logs text. Then do the same in other hooks to see when it is ran.

    Have to be honest though. I’m not an expert on all the action hooks or if the ordering is correct here:
    http://codex.ww.wp.xz.cn/Plugin_API/Action_Reference

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cannot remove action media_upload_max_image_resize’ is closed to new replies.