store->get_caps() as $cap => $granted ) { $class = 'vaa-cap-item'; $checked = (bool) $granted; // check if we've selected a capability view and we've changed some capabilities. $selected_caps = $this->store->get_view( $this->type ); if ( isset( $selected_caps[ $cap ] ) ) { $checked = (bool) $selected_caps[ $cap ]; } // Check for this capability in any view set. if ( $this->vaa->view()->current_view_can( $cap ) ) { $class .= ' current'; } // The list of capabilities. $caps_items .= '
' . VAA_View_Admin_As_Form::do_checkbox( array( 'name' => 'vaa_cap_' . esc_attr( $cap ), 'value' => $checked, 'compare' => true, 'checkbox_value' => esc_attr( $cap ), 'label' => $cap, ) ) . '
'; } $admin_bar->add_node( array( 'id' => $root . '-select-options', 'parent' => $parent, 'title' => $caps_items, 'href' => false, 'meta' => array( 'class' => 'ab-vaa-multipleselect vaa-auto-max-height', ), ) ); } else { _doing_it_wrong( __FILE__, esc_html__( 'No toolbar resources found.', VIEW_ADMIN_AS_DOMAIN ), '1.7' ); } // End if().