Skip to content

Commit

Permalink
PHPCS updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed Aug 22, 2023
1 parent e3cff94 commit d6abada
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions includes/CMB2_Hookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function comment_hooks() {
if ( $this->cmb->has_columns ) {
add_filter( 'manage_edit-comments_columns', array( $this, 'register_column_headers' ) );
add_action( 'manage_comments_custom_column', array( $this, 'column_display' ), 10, 3 );
add_filter( "manage_edit-comments_sortable_columns", array( $this, 'columns_sortable' ) );
add_filter( 'manage_edit-comments_sortable_columns', array( $this, 'columns_sortable' ) );
add_action( 'pre_get_posts', array( $this, 'columns_sortable_orderby' ) );
}

Expand All @@ -176,7 +176,7 @@ public function user_hooks() {
if ( $this->cmb->has_columns ) {
add_filter( 'manage_users_columns', array( $this, 'register_column_headers' ) );
add_filter( 'manage_users_custom_column', array( $this, 'return_column_display' ), 10, 3 );
add_filter( "manage_users_sortable_columns", array( $this, 'columns_sortable' ) );
add_filter( 'manage_users_sortable_columns', array( $this, 'columns_sortable' ) );
add_action( 'pre_get_posts', array( $this, 'columns_sortable_orderby' ) );
}

Expand Down Expand Up @@ -341,7 +341,7 @@ public function do_scripts( $hook ) {
* @param array $columns Array of columns available for the admin page.
*/
public function register_column_headers( $columns ) {
foreach ( $this->cmb->prop( 'fields' ) as $key => $field ) {
foreach ( $this->cmb->prop( 'fields' ) as $field ) {
if ( empty( $field['column'] ) ) {
continue;
}
Expand Down Expand Up @@ -394,7 +394,7 @@ public function column_display( $column_name, $object_id ) {
* @return array $columns An array of sortable columns with CMB2 columns.
*/
public function columns_sortable( $columns ) {
foreach ( $this->cmb->prop( 'fields' ) as $key => $field ) {
foreach ( $this->cmb->prop( 'fields' ) as $field ) {
if ( ! empty( $field['column'] ) && empty( $field['column']['disable_sortable'] ) ) {
$columns[ $field['id'] ] = $field['id'];
}
Expand All @@ -419,7 +419,7 @@ public function columns_sortable_orderby( $query ) {

$orderby = $query->get( 'orderby' );

foreach ( $this->cmb->prop( 'fields' ) as $key => $field ) {
foreach ( $this->cmb->prop( 'fields' ) as $field ) {
if (
empty( $field['column'] )
|| ! empty( $field['column']['disable_sortable'] )
Expand Down Expand Up @@ -558,7 +558,11 @@ public function context_box_title_markup_open( $add_handle = true ) {
: '';
}

$toggle_button = '<button type="button" class="handlediv button-link" aria-expanded="true"><span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $title ) . '</span><span class="toggle-indicator" aria-hidden="true"></span></button>';
$toggle_button = sprintf(
'<button type="button" class="handlediv button-link" aria-expanded="true"><span class="screen-reader-text">%s</span><span class="toggle-indicator" aria-hidden="true"></span></button>',
/* translators: %s: name of CMB2 box (panel) */
sprintf( __( 'Toggle panel: %s' ), $title )
);
$title_tag = '<h2 class="hndle"><span>' . esc_attr( $title ) . '</span></h2>' . "\n";

echo '<div id="' . $cmb_id . '" class="' . postbox_classes( $cmb_id, $page ) . $hidden_class . '">' . "\n";
Expand All @@ -576,7 +580,7 @@ public function context_box_title_markup_open( $add_handle = true ) {
echo '</div>' . "\n";

} else {
echo $toggle_button;;
echo $toggle_button;
echo $title_tag;
}

Expand Down

0 comments on commit d6abada

Please sign in to comment.