PluginProbe
Assistant – Every Day Productivity Apps / 1.5.5.1
Assistant – Every Day Productivity Apps v1.5.5.1
1.5.5.1 1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 All 72 releases
← All changes | backend/src/Hooks/AdminColumns.php +15 -1 0.6.0 → 1.5.5.1 View file →
@@ -5,12 +5,17 @@
5 5 use FL\Assistant\Data\Transformers\NotationsTransformer;
6 6 use FL\Assistant\Data\Repository\NotationsRepository;
7 7 use FL\Assistant\Data\Repository\LabelsRepository;
8 8 use FL\Assistant\Data\Transformers\LabelsTransformer;
9 +use FL\Assistant\Helpers\BeaverBuilderHelper;
9 10
10 11 class AdminColumns {
11 12
12 13 public function __construct() {
14 + if ( BeaverBuilderHelper::is_assistant_extension() ) {
15 + return;
16 + }
17 +
13 18 add_action( 'init', [ $this, 'enqueue_custom_admin_columns' ], PHP_INT_MAX );
14 19 }
15 20
16 21 public function enqueue_custom_admin_columns() {
@@ -18,13 +23,14 @@
18 23
19 24 foreach ( $types as $type => $info ) {
20 25 add_filter( "manage_{$type}_posts_columns", [ $this, 'add_columns' ] );
21 26 add_action( "manage_{$type}_posts_custom_column", [ $this, 'render_column' ], 10, 2 );
27 + add_filter( "default_hidden_columns", [ $this, 'defualt_hidden_columns' ], 10, 2 );
22 28 }
23 29 }
24 30
25 31 public function add_columns( $columns ) {
26 - $columns['fl_assistant'] = __( 'Assistant', 'fl-assistant' );
32 + $columns['fl_assistant'] = __( 'Labels', 'assistant' );
27 33 return $columns;
28 34 }
29 35
30 36 public function render_column( $column, $post_id ) {
@@ -55,6 +61,14 @@
55 61 print "<span style='{$styles}'><span style='{$dot}; background-color: {$term['color']}'></span>{$term['label']}</span>";
56 62 }
57 63 }
58 64 }
65 + }
66 +
67 + /**
68 + * Make our custom column hidden by default.
69 + */
70 + public function defualt_hidden_columns( $hidden, $screen ) {
71 + $hidden[] = 'fl_assistant';
72 + return $hidden;
59 73 }
60 74 }