1 | <?php |
||
15 | class Jetpack_Admin_Menu extends Admin_Menu { |
||
16 | /** |
||
17 | * Determines whether the current locale is right-to-left (RTL). |
||
18 | * |
||
19 | * Performs the check against the current locale set on the WordPress.com's account settings. |
||
20 | * See `Masterbar::__construct` in `modules/masterbar/masterbar/class-masterbar.php`. |
||
21 | */ |
||
22 | public function is_rtl() { |
||
25 | |||
26 | /** |
||
27 | * Create the desired menu output. |
||
28 | */ |
||
29 | public function reregister_menu_items() { |
||
43 | |||
44 | /** |
||
45 | * Whether to use wp-admin pages rather than Calypso. |
||
46 | * |
||
47 | * @return bool |
||
48 | */ |
||
49 | public function should_link_to_wp_admin() { |
||
53 | |||
54 | /** |
||
55 | * Adds Posts menu. |
||
56 | * |
||
57 | * @param bool $wp_admin Optional. Whether links should point to Calypso or wp-admin. Default false (Calypso). |
||
58 | */ |
||
59 | public function add_posts_menu( $wp_admin = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
63 | |||
64 | /** |
||
65 | * Adds Media menu. |
||
66 | * |
||
67 | * @param bool $wp_admin Optional. Whether links should point to Calypso or wp-admin. Default false (Calypso). |
||
68 | */ |
||
69 | public function add_media_menu( $wp_admin = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
72 | |||
73 | /** |
||
74 | * Adds Page menu. |
||
75 | * |
||
76 | * @param bool $wp_admin Optional. Whether links should point to Calypso or wp-admin. Default false (Calypso). |
||
77 | */ |
||
78 | public function add_page_menu( $wp_admin = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
82 | |||
83 | /** |
||
84 | * Adds a custom post type menu. |
||
85 | * |
||
86 | * @param string $post_type Custom post type. |
||
87 | * @param bool $wp_admin Optional. Whether links should point to Calypso or wp-admin. Default false (Calypso). |
||
88 | */ |
||
89 | public function add_custom_post_type_menu( $post_type, $wp_admin = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
110 | |||
111 | /** |
||
112 | * Adds Comments menu. |
||
113 | * |
||
114 | * @param bool $wp_admin Optional. Whether links should point to Calypso or wp-admin. Default false (Calypso). |
||
115 | */ |
||
116 | public function add_comments_menu( $wp_admin = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
119 | |||
120 | /** |
||
121 | * Adds Feedback menu. |
||
122 | */ |
||
123 | public function add_feedback_menu() { |
||
139 | |||
140 | /** |
||
141 | * Adds Jetpack menu. |
||
142 | */ |
||
143 | public function add_jetpack_menu() { |
||
157 | |||
158 | /** |
||
159 | * Adds Appearance menu. |
||
160 | * |
||
161 | * @param bool $wp_admin_themes Optional. Whether Themes link should point to Calypso or wp-admin. Default false (Calypso). |
||
162 | * @param bool $wp_admin_customize Optional. Whether Customize link should point to Calypso or wp-admin. Default false (Calypso). |
||
163 | * @return string The Customizer URL. |
||
164 | */ |
||
165 | public function add_appearance_menu( $wp_admin_themes = false, $wp_admin_customize = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
176 | |||
177 | /** |
||
178 | * Adds Plugins menu. |
||
179 | * |
||
180 | * @param bool $wp_admin Optional. Whether links should point to Calypso or wp-admin. Default false (Calypso). |
||
181 | */ |
||
182 | public function add_plugins_menu( $wp_admin = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
185 | |||
186 | /** |
||
187 | * Adds Users menu. |
||
188 | * |
||
189 | * @param bool $wp_admin Optional. Whether links should point to Calypso or wp-admin. Default false (Calypso). |
||
190 | */ |
||
191 | public function add_users_menu( $wp_admin = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
198 | |||
199 | /** |
||
200 | * Adds Tools menu. |
||
201 | * |
||
202 | * @param bool $wp_admin_import Optional. Whether Import link should point to Calypso or wp-admin. Default false (Calypso). |
||
203 | * @param bool $wp_admin_export Optional. Whether Export link should point to Calypso or wp-admin. Default false (Calypso). |
||
204 | */ |
||
205 | public function add_tools_menu( $wp_admin_import = false, $wp_admin_export = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
218 | |||
219 | /** |
||
220 | * Adds Settings menu. |
||
221 | * |
||
222 | * @param bool $wp_admin Optional. Whether links should point to Calypso or wp-admin. Default false (Calypso). |
||
223 | */ |
||
224 | public function add_options_menu( $wp_admin = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
227 | |||
228 | /** |
||
229 | * Adds WP Admin menu. |
||
230 | */ |
||
231 | public function add_wp_admin_menu() { |
||
242 | } |
||
243 |