Make WordPress Core

Ticket #29789: 29789.fix2.diff

File 29789.fix2.diff, 1.2 KB (added by kitchin, 9 years ago)

revert php, add js

  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    282282                $actions = array();
    283283                $post_type_obj = get_post_type_object( $this->screen->post_type );
    284284
    285                 // Don't show bulk options if the user can't edit posts.
    286                 if ( ! current_user_can( $post_type_obj->cap->edit_posts ) ) {
    287                         return $actions;
    288                 }
    289 
    290285                if ( $this->is_trash ) {
    291286                        $actions['untrash'] = __( 'Restore' );
    292287                } else {
  • src/wp-admin/js/common.js

     
    574574                input.on('change', toggleUploadButton);
    575575        })();
    576576
     577        // Disable bulk actions select if no checkboxes
     578        (function(){
     579                if ( $('.wp-list-table').length ) {
     580                        if ( ! $('.wp-list-table tbody .check-column input[type=checkbox]').length ) {
     581                                $('.bulkactions, .check-column').hide();
     582                        }
     583                }
     584        })();
     585
    577586        function pinMenu( event ) {
    578587                var windowPos = $window.scrollTop(),
    579588                        resizing = ! event || event.type !== 'scroll';