PluginProbe
Admin Columns / 2.4.3
Admin Columns v2.4.3
7.1.4 7.0.19 2.3.5 2.4 2.4.1 2.4.10 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.6.1 2.5.6.2 2.5.6.3 2.5.6.4 3.0 3.0.1 All 113 releases
codepress-admin-columns / api.php
api.php
37 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * If you like to register a column of your own please have a look at our documentation.
4 * We also have a free start-kit available, which contains all the necessary files.
5 *
6 * Documentation: https://www.admincolumns.com/documentation/developer-docs/creating-new-column-type/
7 * Starter-kit: https://github.com/codepress/cac-column-template/
8 *
9 */
10
11 /**
12 * Manually set the columns for a storage model
13 * This overrides the database settings and thus renders the settings screen for this storage model useless
14 *
15 * @since 2.2
16 *
17 * @param string $storage_model Storage model key
18 * @param array $columns List of columns ([column_name] => [column_options])
19 */
20 function ac_register_columns( $storage_model, $columns ) {
21 global $_cac_exported_columns;
22
23 $storage_models = (array) $storage_model;
24
25 foreach ( $storage_models as $storage_model ) {
26 if ( isset( $_cac_exported_columns[ $storage_model ] ) ) {
27 $_cac_exported_columns[ $storage_model ] = array_merge( $_cac_exported_columns[ $storage_model ], $columns );
28 }
29 else {
30 $_cac_exported_columns[ $storage_model ] = $columns;
31 }
32 }
33 }
34
35 function cpac_set_storage_model_columns( $storage_model, $columns ) {
36 ac_register_columns( $storage_model, $columns );
37 }