Skip to content

Commit 2db8b15

Browse files
authored
Merge pull request #297 from codepress/release/4.1.9
Release/4.1.9
2 parents f7faf71 + 1ca7e21 commit 2db8b15

File tree

5 files changed

+35
-9
lines changed

5 files changed

+35
-9
lines changed

classes/Column/AjaxValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface AjaxValue {
77
/**
88
* @param int $id
99
*
10-
* @return void
10+
* @return string
1111
*/
1212
public function get_ajax_value( $id );
1313

classes/Helper/Html.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ public function get_ajax_toggle_box_link( $id, $label, $column_name, $label_clos
149149
] );
150150
}
151151

152+
/**
153+
* Display a modal which trigger an ajax event on click. The ajax callback calls AC\Column::get_ajax_value.
154+
*
155+
* @param int $item_id
156+
* @param string $label
157+
* @param string $column_name
158+
*
159+
* @return string
160+
*/
161+
public function get_ajax_modal_link( $item_id, $label, $column_name ) {
162+
return ac_helper()->html->link( '#', $label, [
163+
'class' => 'ac-modal-box-link',
164+
'data-column' => $column_name,
165+
'data-item-id' => $item_id,
166+
'data-ajax-populate' => 1,
167+
'data-label' => $label,
168+
] );
169+
}
170+
152171
/**
153172
* @param string $string
154173
* @param int $max_chars

classes/ThirdParty/WPML.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace AC\ThirdParty;
44

5-
use AC\ListScreenTypes;
65
use AC\Registrable;
76

87
/**
@@ -16,7 +15,7 @@ function register() {
1615
add_action( 'ac/table/list_screen', [ $this, 'replace_flags' ] );
1716

1817
// enable the translation of the column labels
19-
add_action( 'wp_loaded', [ $this, 'register_column_labels' ], 99 );
18+
add_action( 'ac/list_screens', [ $this, 'register_column_labels' ], 300 );
2019

2120
// enable the WPML translation of column headings
2221
add_filter( 'ac/headings/label', [ $this, 'register_translated_label' ], 100 );
@@ -49,11 +48,14 @@ public function register_column_labels() {
4948
return;
5049
}
5150

52-
foreach ( ListScreenTypes::instance()->get_list_screens() as $list_screen ) {
53-
foreach ( $list_screen->get_settings() as $column_name => $options ) {
54-
do_action( 'wpml_register_single_string', 'Admin Columns', $options['label'], $options['label'] );
51+
$list_screens = AC()->get_storage()->find_all();
52+
53+
foreach ( $list_screens as $list_screen ) {
54+
foreach ( $list_screen->get_columns() as $column ) {
55+
do_action( 'wpml_register_single_string', 'Admin Columns', $column->get_custom_label(), $column->get_custom_label() );
5556
}
5657
}
58+
5759
}
5860

5961
/**

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.1.8
4+
Version: 4.1.9
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.1.8' );
39+
define( 'AC_VERSION', '4.1.9' );
4040

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

readme.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: plugins, wordpress, admin, column, columns, custom columns, custom fields,
55
Requires at least: 4.7
66
Tested up to: 5.4.2
77
Requires PHP: 5.6.20
8-
Stable tag: 4.1.8
8+
Stable tag: 4.1.9
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

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

214214
== Changelog ==
215215

216+
= 4.1.9 =
217+
Release Date: July 28th, 2020
218+
219+
* [Updated] Column label translation support for WPML was updated for the latest version of WPML
220+
216221
= 4.1.8 =
217222
Release Date: July 21st, 2020
218223

0 commit comments

Comments
 (0)