0

When I invoke the media uploader from a certain page, I'm looking for a way to hide all of the 'Gallery Settings' options at the bottom of the Gallery tab. I have set a referrer (dd-options-footer), so I can check that to ensure the code is only added for my desired page, but it seems that whatever I add does not work.

I've tried adding both custom CSS and JS to do this, but it appears that WP overrides this in wp-admin/js/gallery-min.js when it outputs the content of the tab.

Anyone know how I can do this? Thanks.

1 Answer 1

0

David, I'm not sure if you're trying to disable the whole gallery (plus the settings) or only its fields. For the first option, you should try do deregister the admin-gallery script:

function disable_gallery() {
    $post_id = (int) $_GET['post_id'];

    // Check for your post / page ID
    if( $post_id == 343  ) {
        wp_deregister_script( 'admin-gallery' );
    }
}

add_action( 'admin_enqueue_scripts', 'disable_gallery' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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