diff --git a/includes/CMB2_Hookup.php b/includes/CMB2_Hookup.php index 78b65749b..74c770cd9 100644 --- a/includes/CMB2_Hookup.php +++ b/includes/CMB2_Hookup.php @@ -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' ) ); } @@ -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' ) ); } @@ -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; } @@ -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']; } @@ -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'] ) @@ -558,7 +558,11 @@ public function context_box_title_markup_open( $add_handle = true ) { : ''; } - $toggle_button = ''; + $toggle_button = sprintf( + '', + /* translators: %s: name of CMB2 box (panel) */ + sprintf( __( 'Toggle panel: %s' ), $title ) + ); $title_tag = '

' . esc_attr( $title ) . '

' . "\n"; echo '
' . "\n"; @@ -576,7 +580,7 @@ public function context_box_title_markup_open( $add_handle = true ) { echo '
' . "\n"; } else { - echo $toggle_button;; + echo $toggle_button; echo $title_tag; }