PluginProbe ʕ •ᴥ•ʔ
Admin Columns / 7.1.4
Admin Columns v7.1.4
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 3.0.2 3.0.3 3.0.5 3.0.7 3.1 3.1.1 3.1.10 3.1.2 3.1.3 3.1.5 3.2.3 3.2.7 3.3.1 3.4.1 3.4.6 3.4.8 4.0.1 4.0.3 4.1.6 4.2.2 4.2.5 4.3 4.3.2 4.4.1 4.4.4 4.4.5 4.5.5 4.6.1 4.7.18 4.7.19 4.7.20 4.7.7 7.0.13 7.0.14 7.0.16 trunk 1.0 1.1 1.1.3 1.2 1.2.1 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.5.1 1.4.6 1.4.6.1 1.4.6.2 1.4.6.3 1.4.6.4 1.4.7 1.4.8 1.4.9 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 2.2.1.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.5.1 2.2.6 2.2.6.1 2.2.6.2 2.2.6.3 2.2.6.4 2.2.7 2.2.8 2.2.8.1 2.2.9 2.3.1 2.3.2 2.3.3
codepress-admin-columns / classes / Service / QuickEdit.php
codepress-admin-columns / classes / Service Last commit date
AdminBar.php 3 days ago AdminBarEditColumns.php 3 days ago Colors.php 3 days ago CommonAssets.php 3 days ago CurrentTable.php 3 days ago ManageHeadings.php 3 days ago ManageValue.php 3 days ago NoticeChecks.php 3 days ago PluginUpdate.php 3 days ago PromoChecks.php 3 days ago QuickEdit.php 3 days ago SaveHeadings.php 3 days ago Setup.php 3 days ago TableRows.php 3 days ago Tooltips.php 3 days ago View.php 3 days ago
QuickEdit.php
99 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace AC\Service;
6
7 use AC\ListScreenRepository\Storage;
8 use AC\Registerable;
9 use AC\Table\PrimaryColumnFactory;
10 use AC\Table\TablePreference;
11 use AC\TableScreenFactory;
12 use AC\Type\TableId;
13
14 class QuickEdit implements Registerable
15 {
16 private Storage $storage;
17
18 private TablePreference $preference;
19
20 private PrimaryColumnFactory $primary_column_factory;
21
22 private TableScreenFactory $table_screen_factory;
23
24 public function __construct(
25 Storage $storage,
26 TablePreference $preference,
27 PrimaryColumnFactory $primary_column_factory,
28 TableScreenFactory $table_screen_factory
29 ) {
30 $this->storage = $storage;
31 $this->preference = $preference;
32 $this->primary_column_factory = $primary_column_factory;
33 $this->table_screen_factory = $table_screen_factory;
34 }
35
36 public function register(): void
37 {
38 add_action('admin_init', [$this, 'init_columns_on_quick_edit']);
39 }
40
41 /**
42 * Get list screen when doing Quick Edit, a native WordPress ajax call
43 */
44 public function init_columns_on_quick_edit(): void
45 {
46 if (! wp_doing_ajax()) {
47 return;
48 }
49
50 switch (filter_input(INPUT_POST, 'action')) {
51 // Quick edit post
52 case 'pll_update_post_rows':
53 case 'inline-save' :
54 $table_id = (string)filter_input(INPUT_POST, 'post_type');
55 break;
56
57 // Adding term & Quick edit term
58 case 'pll_update_term_rows':
59 case 'add-tag' :
60 case 'inline-save-tax' :
61 $table_id = 'wp-taxonomy_' . filter_input(INPUT_POST, 'taxonomy');
62 break;
63
64 // Quick edit comment & Inline reply on comment
65 case 'edit-comment' :
66 case 'replyto-comment' :
67 $table_id = 'wp-comments';
68 break;
69
70 default:
71 return;
72 }
73
74 $list_id = $this->preference->get_list_id(new TableId($table_id));
75
76 if (! $list_id) {
77 return;
78 }
79
80 $list_screen = $this->storage->find($list_id);
81
82 if (! $list_screen || ! $list_screen->is_user_allowed(wp_get_current_user())) {
83 return;
84 }
85
86 $table_screen = $this->table_screen_factory->create($list_screen->get_table_id());
87
88 add_filter(
89 'list_table_primary_column',
90 [$this->primary_column_factory->create($list_screen), 'set_primary_column'],
91 20
92 );
93
94 (new ManageHeadings())->handle($list_screen, $table_screen);
95 (new ManageValue())->handle($list_screen, $table_screen);
96 }
97
98 }
99