Skip to content

Commit 91b6ba7

Browse files
authored
Merge pull request #298 from codepress/release/4.2
Release/4.2
2 parents 2db8b15 + c81e06d commit 91b6ba7

File tree

106 files changed

+4443
-1756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+4443
-1756
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Thumbs.d*
1111
# Project specific
1212
*.scssc
1313
*.map
14+
/config
1415

1516
# Development
1617
node_modules

api.php

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ function ac_get_list_screen( $id ) {
181181
}
182182

183183
/**
184+
* Usage: Load after or within the 'wp_loaded' action hook.
185+
*
184186
* @param string $key e.g. post, page, wp-users, wp-media, wp-comments
185187
*
186188
* @return ListScreenCollection
@@ -190,6 +192,61 @@ function ac_get_list_screens( $key ) {
190192
return AC()->get_storage()->find_all( [ 'key' => $key ] );
191193
}
192194

195+
/**
196+
* Usage: Load after or within the 'wp_loaded' action hook.
197+
*
198+
* @param string $column_name
199+
* @param string $list_screen_id
200+
*
201+
* @return AC\Column|null
202+
* @since 4.2
203+
*/
204+
function ac_get_column( $column_name, $list_screen_id ) {
205+
try {
206+
$list_id = new ListScreenId( $list_screen_id );
207+
} catch ( Exception $e ) {
208+
return null;
209+
}
210+
211+
$list_screen = AC()->get_storage()->find( $list_id );
212+
213+
if ( ! $list_screen ) {
214+
return null;
215+
}
216+
217+
$column = $list_screen->get_column_by_name( $column_name );
218+
219+
if ( ! $column ) {
220+
return null;
221+
}
222+
223+
return $column;
224+
}
225+
226+
/**
227+
* Usage: Load after or within the 'wp_loaded' action hook.
228+
*
229+
* @param string $list_screen_id
230+
*
231+
* @return AC\Column[]
232+
* @since 4.2
233+
*/
234+
function ac_get_columns( $list_screen_id ) {
235+
try {
236+
$list_id = new ListScreenId( $list_screen_id );
237+
} catch ( Exception $e ) {
238+
return [];
239+
}
240+
241+
$list_screen = AC()->get_storage()->find( $list_id );
242+
243+
if ( ! $list_screen ) {
244+
return [];
245+
}
246+
247+
return $list_screen->get_columns();
248+
}
249+
193250
/**
194251
* @param $format
195252
* @param null $timestamp

assets/css/admin-page-columns.css

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-general.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/admin-page-addons.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

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

0 commit comments

Comments
 (0)