Skip to content

Commit af057c5

Browse files
authored
Merge pull request #312 from codepress/release/4.2.7
Release/4.2.7
2 parents 67b3eb4 + 4ccf2c0 commit af057c5

File tree

8 files changed

+29
-15
lines changed

8 files changed

+29
-15
lines changed

assets/js/admin-page-columns.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/admin-page-columns.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codepress-admin-columns.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/*
33
Plugin Name: Admin Columns
4-
Version: 4.2.6
4+
Version: 4.2.7
55
Description: Customize columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
66
Author: AdminColumns.com
77
Author URI: https://www.admincolumns.com
@@ -36,7 +36,7 @@
3636
}
3737

3838
define( 'AC_FILE', __FILE__ );
39-
define( 'AC_VERSION', '4.2.6' );
39+
define( 'AC_VERSION', '4.2.7' );
4040

4141
require_once __DIR__ . '/classes/Dependencies.php';
4242

readme.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Contributors: codepress, tschutter, davidmosterd, engelen, dungengronovius
33
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZDZRSYLQ4Z76J
44
Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields, image, dashboard, sortable, filters, posts, media, users, pages, posttypes, manage columns, wp-admin
55
Requires at least: 4.7
6-
Tested up to: 5.6
6+
Tested up to: 5.6.1
77
Requires PHP: 5.6.20
8-
Stable tag: 4.2.5
8+
Stable tag: 4.2.7
99

1010
Customise columns on the administration screens for post(types), pages, media, comments, links and users with an easy to use drag-and-drop interface.
1111

@@ -209,6 +209,11 @@ You can find a list of the available actions and filters (and examples on how to
209209

210210
== Changelog ==
211211

212+
= 4.2.7 =
213+
Release Date: February 8th, 2021
214+
215+
* [Fixed] Some settings were nog saved correctly on the admin settings page
216+
212217
= 4.2.6 =
213218
Release Date: February 3rd, 2021
214219

src/js/admin/columns/column-configurator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ export default class ColumnConfigurator {
2828
initToggle(column);
2929
initIndicator(column);
3030
initTypeSelector(column);
31-
initColumnRefresh(column);
3231
initRemoveColumn(column);
3332
initClone(column);
34-
initLabel(column);
3533
initLabelSettingEvents(column);
3634
initLabelTooltipsEvent(column);
35+
initLabel(column);
36+
initColumnRefresh(column);
3737

3838
initMultiSelectFields(column);
3939
initLabelSetting(column);

src/js/admin/columns/events/label.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ export const initLabel = (column: Column) => {
55
column.getElement().querySelectorAll<HTMLSelectElement>('select[data-label="update"]').forEach((select) => {
66
select.addEventListener('change', () => {
77
let labelSetting = column.getElement().querySelector<HTMLInputElement>('input.ac-setting-input_label');
8-
let option = select.querySelector('option:selected');
8+
let option = select.selectedOptions.length > 0 ? select.selectedOptions[0] : null;
99

10-
if (labelSetting && option) {
10+
if (labelSetting && option ) {
1111
labelSetting.value = option.innerHTML;
1212
labelSetting.dispatchEvent(new Event('change'));
1313
}

src/js/admin/columns/events/refresh.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {Column} from "../column";
33
export const initColumnRefresh = (column: Column) => {
44
column.getElement().querySelectorAll<HTMLElement>('[data-refresh="column"]').forEach(element => {
55
element.addEventListener('change', () => {
6-
column.refresh();
6+
// Allow other settings to do their thing first so all changes are refreshed correctly
7+
setTimeout(() => column.refresh(), 50);
78
});
89
});
910
}

src/js/admin/columns/form.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,14 @@ export class Form {
125125

126126
getFormData(): ListScreenStorageType {
127127
let columnData: any = {};
128+
let titleElement = this.getElement().querySelector<HTMLInputElement>('input[name=title]');
129+
128130
this.getSortedColumns().forEach(column => {
129131
columnData[column.getName()] = column.getJson();
130132
});
131133

132134
return {
133-
title: '',
135+
title: titleElement ? titleElement.value : '',
134136
list_screen: AC.list_screen,
135137
list_screen_id: AC.layout,
136138
columns: columnData,
@@ -187,15 +189,21 @@ export class Form {
187189
private getPreferences(): keyAnyPair {
188190
let data: { [key: string]: any } = {};
189191
document.querySelectorAll<HTMLFormElement>('form[data-form-part=preferences]').forEach(el => {
192+
let fData = new FormData(el);
190193
// @ts-ignore
191-
for (let t of new FormData(el).entries()) {
192-
data[t[0]] = t[1];
194+
for (let entry of fData.entries()) {
195+
let key = entry[0];
196+
let value = entry[1];
197+
let element = el.elements[key];
198+
199+
data[key] = element.tagName === 'SELECT' && element.hasAttribute('multiple')
200+
? fData.getAll(key)
201+
: data[key] = value;
193202
}
194203
});
195204

196205
return data;
197206
}
198-
199207
}
200208

201209
const createColumnFromTemplate = () => {

0 commit comments

Comments
 (0)