1 | <?php |
||
9 | class DisablePosts |
||
10 | { |
||
11 | /** |
||
12 | * @var Application |
||
13 | */ |
||
14 | protected $app; |
||
15 | |||
16 | public function __construct( Application $app ) |
||
20 | |||
21 | /** |
||
22 | * @return void |
||
23 | */ |
||
24 | public function init() |
||
40 | |||
41 | /** |
||
42 | * @return void |
||
43 | * @action init |
||
44 | */ |
||
45 | public function disable() |
||
59 | |||
60 | /** |
||
61 | * http://localhost/?m=2013 - yearly archives |
||
62 | * http://localhost/?m=201303 - monthly archives |
||
63 | * http://localhost/?m=20130327 - daily archives |
||
64 | * http://localhost/?cat=1 - category archives |
||
65 | * http://localhost/?tag=foobar - tag archives |
||
66 | * http://localhost/?p=1 - single post |
||
67 | * |
||
68 | * @param array $posts |
||
69 | * @return array |
||
70 | * @filter posts_results |
||
71 | */ |
||
72 | public function filterPostQuery( $posts = [] ) |
||
79 | |||
80 | /** |
||
81 | * @return WP_Query |
||
82 | * @filter pre_get_posts |
||
83 | */ |
||
84 | public function filterSearchQuery( WP_Query $query ) |
||
94 | |||
95 | /** |
||
96 | * @return void |
||
97 | * @action wp_dashboard_setup |
||
98 | */ |
||
99 | public function modifyDashboardWidgets() |
||
112 | |||
113 | /** |
||
114 | * @return void |
||
115 | * @action welcome_panel |
||
116 | */ |
||
117 | public function modifyWelcomePanel() |
||
123 | |||
124 | /** |
||
125 | * @return void |
||
126 | * @action admin_bar_menu |
||
127 | */ |
||
128 | public function removeFromAdminBar() |
||
133 | |||
134 | /** |
||
135 | * @return void |
||
136 | * @action admin_menu |
||
137 | */ |
||
138 | public function removeFromAdminMenu() |
||
142 | |||
143 | /** |
||
144 | * @return void |
||
145 | * @action wp_dashboard_setup |
||
146 | */ |
||
147 | public function unregisterDashboardWidgets() |
||
152 | |||
153 | /** |
||
154 | * @return void |
||
155 | * @action widgets_init |
||
156 | */ |
||
157 | public function unregisterWidgets() |
||
163 | |||
164 | /** |
||
165 | * @return bool |
||
166 | */ |
||
167 | protected function isAdmin() |
||
171 | } |
||
172 |