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() |
||
37 | |||
38 | /** |
||
39 | * @return void |
||
40 | * @action init |
||
41 | */ |
||
42 | public function disable() |
||
56 | |||
57 | /** |
||
58 | * http://localhost/?m=2013 - yearly archives |
||
59 | * http://localhost/?m=201303 - monthly archives |
||
60 | * http://localhost/?m=20130327 - daily archives |
||
61 | * http://localhost/?cat=1 - category archives |
||
62 | * http://localhost/?tag=foobar - tag archives |
||
63 | * http://localhost/?p=1 - single post |
||
64 | * |
||
65 | * @param array $posts |
||
66 | * @return array |
||
67 | * @filter posts_results |
||
68 | */ |
||
69 | public function filterPostQuery( $posts = [] ) |
||
76 | |||
77 | /** |
||
78 | * @return WP_Query |
||
79 | * @filter pre_get_posts |
||
80 | */ |
||
81 | public function filterSearchQuery( WP_Query $query ) |
||
91 | |||
92 | /** |
||
93 | * @return void |
||
94 | * @action wp_dashboard_setup |
||
95 | */ |
||
96 | public function modifyDashboardWidgets() |
||
109 | |||
110 | /** |
||
111 | * @return void |
||
112 | * @action admin_bar_menu |
||
113 | */ |
||
114 | public function removeFromAdminBar() |
||
119 | |||
120 | /** |
||
121 | * @return void |
||
122 | * @action admin_menu |
||
123 | */ |
||
124 | public function removeFromAdminMenu() |
||
128 | |||
129 | /** |
||
130 | * @return void |
||
131 | * @action wp_dashboard_setup |
||
132 | */ |
||
133 | public function unregisterDashboardWidgets() |
||
138 | |||
139 | /** |
||
140 | * @return void |
||
141 | * @action widgets_init |
||
142 | */ |
||
143 | public function unregisterWidgets() |
||
149 | |||
150 | /** |
||
151 | * @return bool |
||
152 | */ |
||
153 | protected function isAdmin() |
||
157 | } |
||
158 |